New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mjg17/data updates #45

Merged
merged 61 commits into from Oct 2, 2015

Conversation

Projects
None yet
2 participants
@mjg17
Contributor

mjg17 commented Sep 29, 2015

This pull request contains a bunch of updates to Number::Phone::Country::Data which I have identified whilst working on auto-generating it from libphonenumber. In order to do side-by-side comparisons, it is useful to get Number::Phone::Country::Data up-to-date.

I have committed each change as a separate commit, with references in the commit log.

There remain some inconsistencies with libphonenumber which I propose to code into the new build-data.country script. I reproduce them here in this commentary for completeness. Many are to deal with international prefixes which allow or require a carrier prefix.

my %prefix_overrides = (
    'BO' => { international_prefix => '00' },
    'BR' => { international_prefix => '00' }, # actual 00xx where xx is carrier code

    # Chile mandates a variable carrier code before the international prefix, but according to:
    # http://www.thephonebook.bt.com/publisha.content/en/search/international/record.publisha?id=L47
    #00 should work.
    'CL' => { international_prefix => '00' },

    # these hard-code one of the available carriers:
    'CO' => { international_prefix => '009', national_prefix => '09' },

    'FI' => { international_prefix => '00' },
    'HK' => { international_prefix => '001' },

    # this hard-codes one of the available carriers:
    'ID' => { international_prefix => '001' },

    'IL' => { international_prefix => '00' },

    # this hard-codes one of the available carriers:
    'KH' => { international_prefix => '001' },

    'KP' => { international_prefix => '00' }, # '99' also possible

    # this hard-codes one of the available carriers:
    'KR' => { international_prefix => '001' },

    'LI' => { national_prefix => undef },

    # libphonenumber uses '020' as preferred, but says:
    #   Preferred international prefix is expected to standardize on just '00'
    'MU' => { international_prefix => '00' },

    # sources seem to disagree with practice, for now we disagree with libphonenumber's comment.
    'MW' => { national_prefix => undef },

    'MX' => { international_prefix => '00' }, # 09 for person-to-person

    # Peru appears to require a variable carrier code before the international prefix, but according to:
    # http://www.thephonebook.bt.com/publisha.content/en/search/international/record.publisha?id=L175
    #00 should work.
    'PE' => { international_prefix => '00' },

    # this hard-codes one of the two available carriers (other is '012'):
    'PW' => { international_prefix => '011' },

    # not possible to definitively establish international prefix.
    # could be '00', '002', or '00' + XYZ, but BT thinks 002.
    # http://www.thephonebook.bt.com/publisha.content/en/search/international/record.publisha?id=L174
    'PY' => { international_prefix => '002' },

    'SB' => { international_prefix => '00' }, # 01 also possible

    # Various 0XY international carrier codes are available, but according to
    # https://en.wikipedia.org/wiki/Telephone_numbers_in_Singapore#International_Direct_Dialling_and_VoIP_services
    #  "The generic international call prefix when making an international call is 000,
    #   which all telecommunications service providers are required to share."
    'SG' => { international_prefix => '000' },

    # not clear if Somalia uses a trunk prefix or not, so...
    'SO' => { national_prefix => undef },

    'TH' => { international_prefix => '001' }, # references disagree with libphonenumber

    # this probably hard-codes one of the available carriers:
    'TW' => { international_prefix => '002' },

    'TZ' => { international_prefix => '000' }, # libphonenumber pattern includes Kenya & Uganda shortcodes
    'UG' => { international_prefix => '000' }, # libphonenumber pattern includes Tanzania & Uganda shortcodes

    # Not clear if the Vatican country code is actually in use, meanwhile, to match previous Country::Data:
    'VA' => { country_code => '379', international_prefix => '00', national_prefix => undef },
    );

Michael Gray added some commits Sep 18, 2015

Michael Gray
Liberia: national prefix probably '0'.
Both Wikipedia and wtng.info think there's no national prefix, but libphonenumber reckons it's '0', and some published national numbers show a leading 0.

Michael Gray added some commits Sep 25, 2015

Michael Gray
Singapore: universal international prefix is '000'.
Various 0XY international carrier codes are available, but according to
https://en.wikipedia.org/wiki/Telephone_numbers_in_Singapore#International_Direct_Dialling_and_VoIP_services
  "The generic international call prefix when making an international call is 000,
   which all telecommunications service providers are required to share."
Michael Gray
San Marino: no national prefix.
The area code is always 0549 so the leading 0 is not a trunk dialling prefix.

http://www.wtng.info/wtng-378-sm.html
@DrHyde

This comment has been minimized.

Show comment
Hide comment
@DrHyde

DrHyde Oct 2, 2015

The old data was according to WTNG, but I see that's not actually been updated for ages so we should treat anything there as being suspect.

DrHyde commented on lib/Number/Phone/Country/Data.pm in ea105fd Oct 2, 2015

The old data was according to WTNG, but I see that's not actually been updated for ages so we should treat anything there as being suspect.

This comment has been minimized.

Show comment
Hide comment
@mjg17

mjg17 Oct 2, 2015

Owner
Owner

mjg17 replied Oct 2, 2015

@DrHyde

This comment has been minimized.

Show comment
Hide comment
@DrHyde

DrHyde Oct 2, 2015

Owner

This is all excellent stuff, thanks!

Owner

DrHyde commented Oct 2, 2015

This is all excellent stuff, thanks!

DrHyde added a commit that referenced this pull request Oct 2, 2015

@DrHyde DrHyde merged commit e4df4a1 into DrHyde:master Oct 2, 2015

1 of 2 checks passed

coverage/coveralls Coverage decreased (-0.03%) to 86.393%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment