Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I'm moving this issue over here from the ip2cc queue (http://drupal.org/project/ip2cc), another module that I maintain. I think this functionality is possibly more suited to the country codes API. Thoughts??
It is possible. Part of the reason for migrating the module to a database was to support additional features such as this. I'll work on a patch to add this data.
I think that if we do add this data, it should be as a submodule, since most people using the api will not want the additional functional, or overhead.
FYI: I've just contributed the world_phone module, which includes exactly this functionality: a mapping from ISO 3166 codes to international telephone calling codes. The list I used is derived from the official ITU calling code standards, and it is actually a bit longer than the lists linked in the original issue, above -- it includes, for example, the four-digit telephone codes, starting with 1, that are used by various small nations in the Western Hemisphere.
(Of course, at the moment world_phone also includes its very own private implementation of country_api. ;) That's because country_api didn't exist when I started writing world_phone. My plan is for future releases of world_phone to rely on country_api for short names instead of maintaining redundant versions of that API.)
If you would like to international telephone codes to country_api I can rip that code out of world_phone module and submit it as a patch. Then I'll eventually be able to derive the phone codes from country_api as well. Alternatively, we can encourage people who need to look up telephone codes to simply download world_phone and use its API. Thoughts?
Comments
Comment #1
mrfelton commentedI'm moving this issue over here from the ip2cc queue (http://drupal.org/project/ip2cc), another module that I maintain. I think this functionality is possibly more suited to the country codes API. Thoughts??
Comment #2
ngmaloney commentedIt is possible. Part of the reason for migrating the module to a database was to support additional features such as this. I'll work on a patch to add this data.
Comment #3
mrfelton commentedI think that if we do add this data, it should be as a submodule, since most people using the api will not want the additional functional, or overhead.
Comment #4
mike booth commentedFYI: I've just contributed the world_phone module, which includes exactly this functionality: a mapping from ISO 3166 codes to international telephone calling codes. The list I used is derived from the official ITU calling code standards, and it is actually a bit longer than the lists linked in the original issue, above -- it includes, for example, the four-digit telephone codes, starting with 1, that are used by various small nations in the Western Hemisphere.
(Of course, at the moment world_phone also includes its very own private implementation of country_api. ;) That's because country_api didn't exist when I started writing world_phone. My plan is for future releases of world_phone to rely on country_api for short names instead of maintaining redundant versions of that API.)
If you would like to international telephone codes to country_api I can rip that code out of world_phone module and submit it as a patch. Then I'll eventually be able to derive the phone codes from country_api as well. Alternatively, we can encourage people who need to look up telephone codes to simply download world_phone and use its API. Thoughts?
Comment #5
Scyther commented