Skip to content

Commit

Permalink
checked all the remaining manually maintained data; some very minor c…
Browse files Browse the repository at this point in the history
…orrections
  • Loading branch information
DrHyde committed Mar 25, 2018
1 parent a2b9885 commit 52aefd0
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 49 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
XXXX-XX-XX XXXXXX We now have some data from libphonenumber for Kosovo
(see https://github.com/DrHyde/perl-modules-Number-Phone/issues/66);
Kosovo has migrated to +383 so get rid of the special cases in +377 etc;
N::P::Country::Data is now mostly built from libphonenumber
(see https://github.com/DrHyde/perl-modules-Number-Phone/issues/34);
Corrected the Vatican's area code within the Italian numbering plan;
Added a special case for San Marino within the Italian numbering plan;
Data updates

2018-02-03 3.4003 UK "protected" numbers should have false is_allocated();
Expand Down
97 changes: 55 additions & 42 deletions build-data.country-mapping
Original file line number Diff line number Diff line change
Expand Up @@ -126,69 +126,78 @@ foreach my $tuple (
[ 672 => ['AQ', 'NF' ]], # no AQ in libphonenumber
[ 7 => ['RU', 'KZ' ]],

# checked on 2011-07-08
# next check due 2017-12-01 (annually)
[ 2125288 => 'EH' ], # see http://en.wikipedia.org/wiki/List_of_country_calling_codes#At_a_glance
[ 2125289 => 'EH' ], # see http://en.wikipedia.org/wiki/List_of_country_calling_codes#At_a_glance
[ 262269 => 'YT' ], # ??? Mayotte fixed lines
[ 262639 => 'YT' ], # ??? Mayotte GSM
[ 35348 => 'GB' ], # ??? Northern Ireland in Irish dialling plan
[ 379 => 'VA' ], # ??? Vatican; (not in use?)
[ 3966982 => 'VA' ], # ??? Vatican in Italian dialling plan

# see http://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom#Crown_dependencies
# checked on 2011-07-08
# next check due 2017-12-01 (annually)
# checked on 2018-03-24
# next check due 2018-12-01 (annually)
[ 2125288 => 'EH' ], # see https://en.wikipedia.org/wiki/Telephone_numbers_in_Western_Sahara
[ 2125289 => 'EH' ], # see https://en.wikipedia.org/wiki/Telephone_numbers_in_Western_Sahara
[ 262269 => 'YT' ], # Mayotte fixed lines, see http://www.wtng.info/wtng-262-fr.html
[ 262639 => 'YT' ], # Mayotte GSM, see http://www.wtng.info/wtng-262-fr.html
[ 35348 => 'GB' ], # https://en.wikipedia.org/wiki/Telephone_numbers_in_the_Republic_of_Ireland#Calls_to_Northern_Ireland
[ 379 => 'VA' ], # Vatican (not in use, missing from libphonenumber), see https://en.wikipedia.org/wiki/Telephone_numbers_in_Vatican_City
[ 3906698 => 'VA' ], # Vatican in Italian dialling plan, see https://en.wikipedia.org/wiki/Telephone_numbers_in_Vatican_City
[ 390549 => 'SM' ], # San Marino in Italian dialling plan, see https://en.wikipedia.org/wiki/Telephone_numbers_in_San_Marino

# sourced from libphonenumber
# checked on 2018-03-24
# next check due 2018-12-01 (annually)
[ 441481 => 'GG' ],
[ 447781 => 'GG' ],
[ 447839 => 'GG' ],
[ 447911 => 'GG' ],
[ 441534 => 'JE' ],
[ 447509 => 'JE' ],
[ 447797 => 'JE' ],
[ 447937 => 'JE' ],
[ 447700 => 'JE' ],
[ 447797 => 'JE' ],
[ 447829 => 'JE' ],
[ 447937 => 'JE' ],
[ 441624 => 'IM' ],
[ 447624 => 'IM' ],
[ 447457 => 'IM' ],
[ 447524 => 'IM' ],
[ 447624 => 'IM' ],
[ 447924 => 'IM' ],

# see ???
# checked on 2011-07-08
# next check due 2017-12-01 (annually)
[ 5999 => 'CW' ],
# see https://en.wikipedia.org/wiki/Telephone_numbers_in_Cura%C3%A7ao_and_the_Caribbean_Netherlands
# see https://en.wikipedia.org/wiki/Cocos_(Keeling)_Islands#Communications
# see http://wtng.info/ccod-6.html#CC61 (Christmas Island)
# see https://en.wikipedia.org/wiki/Telephone_numbers_in_the_Australian_Antarctic_Territory
# checked on 2018-03-25
# next check due 2018-12-01 (annually)
[ 5999 => 'CW' ], # Curacao
[ 6189162 => 'CC' ], # Cocos (Keeling) Islands
[ 6189164 => 'CX' ], # Christmas Island
[ 67210 => 'AQ' ], # Davis station \
[ 67211 => 'AQ' ], # Mawson | Australian Antarctic bases
[ 67212 => 'AQ' ], # Casey |
[ 67213 => 'AQ' ], # Macquarie Island /
[ 67211 => 'AQ' ], # Mawson |
[ 67212 => 'AQ' ], # Casey | Australian Antarctic bases
[ 67213 => 'AQ' ], # Macquarie Island |
[ 67214 => 'AQ' ], # Wilkins, mobiles /
[ 6723 => 'NF' ], # Norfolk Island

# see http://en.wikipedia.org/wiki/Telephone_numbers_in_Kazakhstan
# checked on 2011-07-08
# next check due 2017-12-01 (annually)
# checked on 2018-03-24
# next check due 2019-12-01 (bi-annually)
[ 76 => 'KZ' ],
[ 77 => 'KZ' ],

# see http://en.wikipedia.org/wiki/List_of_country_calling_codes#At_a_glance
# checked on 2017-03-22
# next check due 2017-12-01 (annually)
[ 37744 => 'XK' ],
[ 37745 => 'XK' ],
[ 38128 => 'XK' ],
[ 38129 => 'XK' ],
[ 38138 => 'XK' ],
[ 38139 => 'XK' ],
[ 38643 => 'XK' ],
[ 38649 => 'XK' ],
# see https://en.wikipedia.org/wiki/Telephone_numbers_in_Kosovo
# apparently it no longer uses chunks of numbers from
# all over the place (since some time in 2017)
# checked on 2018-03-25
# next check due 2018-12-01 (annually)
# delete this section if there's no evidence of use at end of 2018
# [ 37744 => 'XK' ],
# [ 37745 => 'XK' ],
# [ 38128 => 'XK' ],
# [ 38129 => 'XK' ],
# [ 38138 => 'XK' ],
# [ 38139 => 'XK' ],
# [ 38643 => 'XK' ],
# [ 38649 => 'XK' ],

# see https://en.wikipedia.org/wiki/Global_Mobile_Satellite_System
# https://en.wikipedia.org/wiki/International_Networks_%28country_code%29
# wtng.infos
# checked on 2011-07-08
# next check due 2017-12-01 (annually)
# wtng.info
# checked on 2018-03-25
# next check due 2019-12-01 (bi-annually)
[ 800 => 'InternationalFreephone' ],
[ 808 => 'SharedCostServices' ],
[ 870 => 'Inmarsat' ],
Expand All @@ -200,15 +209,19 @@ foreach my $tuple (
[ 881 => 'GMSS', ], # \ Sat-phones
[ 8810 => 'ICO', ], # |
[ 8811 => 'ICO', ], # |
[ 8812 => 'Ellipso', ], # |
[ 8813 => 'Ellipso', ], # |
# 8812 and 8813 assigned to Ellipso # |
# but that apparently never launched # |
# 8814 is spare # |
# 8815 is spare # |
[ 8816 => 'Iridium', ], # |
[ 8817 => 'Iridium', ], # |
[ 8818 => 'Globalstar', ], # |
[ 8819 => 'Globalstar', ], # /
[ 882 => 'InternationalNetworks' ],
[ 882 => 'InternationalNetworks' ], # many allocations not listed as I don't know if they're diallable, see wtng.info
[ 88213 => 'Telespazio' ], # Sat-ohone
[ 88216 => 'Thuraya' ], # Sat-phone
[ 88220 => 'GarudaMobile' ], # Sat-phone
[ 88234 => 'AQ' ], # Global Networks Switzerland antarctic service
[ 883 => 'InternationalNetworks' ],
[ 883120 => 'Telenor' ],
[ 883130 => 'Mobistar' ],
Expand Down
20 changes: 13 additions & 7 deletions lib/Number/Phone/Country.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ sub phone2country {
our %NANP_areas = (
CA => do {
# see http://www.cnac.ca/co_codes/co_code_status.htm
# checked on 2017-07-14
# next check due 2017-12-01 (semi-annually)
# checked on 2018-03-25
# next check due 2018-09-25 (semi-annually)
my $canada = join('|', qw(
204 226 236 249 250 289
306 343 365 367
Expand All @@ -45,17 +45,23 @@ our %NANP_areas = (
902 905
));
# handful of non-geographic country-specific codes ...
# see https://en.wikipedia.org/wiki/Area_code_600
# checked on 2018-03-25
# next check due 2018-09-25 (semi-annually)
$canada = join('|', $canada, 600, 622, 633, 644, 655, 677, 688);
},
US => do {
# see http://www.nanpa.com/enas/geoAreaCodeAlphabetReport.do
# checked on 2017-07-14
# next check due 2017-12-01 (semi-annually)
# see https://www.allareacodes.com/area_code_listings_by_state.htm
# checked on 2018-03-25
# next check due 2018-09-25 (semi-annually)
my $usa = join('|', qw(
907 334 251 205 938 256 501 479 870 520 480 928 602 623 619 562 628 650 657 661 408 415 424 442 626 559 530 510 323 310 951 949 925 916 209 213 669 707 714 747 760 805 818 831 858 909 719 303 970 720 475 203 860 959 202 302 407 561 727 754 772 786 813 850 863 904 941 954 305 321 352 386 239 404 229 762 470 678 706 478 770 912 808 515 712 641 319 563 208 708 224 217 618 630 331 312 309 872 847 815 779 773 219 317 463 812 574 930 765 260 913 316 785 620 502 859 364 270 606 225 985 504 337 318 774 617 351 508 857 978 413 339 781 240 410 301 443 667 207 734 248 231 586 616 517 313 269 989 947 906 810 952 320 218 651 763 612 507 314 573 660 816 636 417 601 662 228 769 406 704 252 980 828 910 919 743 984 336 701 308 531 402 603 856 848 908 732 973 201 609 862 551 575 505 725 702 775 315 332 680 347 212 585 646 516 518 631 607 845 934 716 718 929 917 914 614 567 513 380 330 937 740 234 220 216 440 419 405 539 580 918 541 971 503 458 610 412 215 717 724 814 484 570 878 267 272 401 843 803 864 854 605 931 423 629 901 615 865 731 737 806 817 512 832 903 915 940 956 972 979 936 281 325 346 361 713 682 254 214 210 469 432 430 409 830 385 435 801 434 703 757 571 804 276 540 802 360 253 206 425 509 262 920 534 414 608 715 304 681 307
205 251 256 334 938 907 480 520 602 623 928 479 501 870 209 213 310 323 408 415 424 442 510 530 559 562 619 626 628 650 657 661 669 707 714 747 760 805 818 831 858 909 916 925 949 951 303 719 720 970 203 475 860 959 302 239 305 321 352 386 407 561 727 754 772 786 813 850 863 904 941 954 229 404 470 478 678 706 762 770 912 808 208 217 224 309 312 331 618 630 708 773 779 815 847 872 219 260 317 463 574 765 812 930 319 515 563 641 712 316 620 785 913 270 364 502 606 859 225 318 337 504 985 207 240 301 410 443 667 339 351 413 508 617 774 781 857 978 231 248 269 313 517 586 616 734 810 906 947 989 218 320 507 612 651 763 952 228 601 662 769 314 417 573 636 660 816 406 308 402 531 702 725 775 603 201 551 609 732 848 856 862 908 973 505 575 212 315 332 347 516 518 585 607 631 646 680 716 718 845 914 917 929 934 252 336 704 743 828 910 919 980 984 701 216 220 234 330 380 419 440 513 567 614 740 937 405 539 580 918 458 503 541 971 215 267 272 412 484 570 610 717 724 814 878 401 803 843 854 864 605 423 615 629 731 865 901 931 210 214 254 281 325 346 361 409 430 432 469 512 682 713 737 806 817 830 832 903 915 936 940 956 972 979 385 435 801 802 276 434 540 571 703 757 804 206 253 360 425 509 202 304 681 262 414 534 608 715 920 307
));
# handful of non-geographic country-specific codes ...
$usa = join('|', $usa, 710);
# see https://en.wikipedia.org/wiki/Area_code_710
# checked on 2018-03-25
# next check due 2018-09-25 (semi-annually)
$usa = join('|', $usa, 710);
},
# see https://en.wikipedia.org/wiki/North_American_Numbering_Plan#NANP_countries_and_territories
# checked on 2018-03-23
Expand Down

0 comments on commit 52aefd0

Please sign in to comment.