NANP Area Code dial patterns for barred numbers outside US and Canada

One hurdle I came across was setting up Outbound Routes and Trunks for calls within the US and Canada (on unlimited plan), but due to the NANP (North American Numbering Plan) there are lots of other area codes that are outside the US and Canada that will match the dial pattern (and cost you big bucks if called).

So I did some research, and this is my list of dial patterns I came up with that need to be blocked… hopefully this is useful to somebody else.

Dial Patterns for North American Numbering Plan
Information taken from the following websites:
http://en.wikipedia.org/wiki/List_of_North_American_Numbering_Pla
http://www.nanpa.com/

Special Purpose (probably will always want to block these)
456NXXXXXX 1456NXXXXXX 456 numbers
500NXXXXXX 1500NXXXXXX 500 numbers
522NXXXXXX 1522NXXXXXX 522 numbers
533NXXXXXX 1533NXXXXXX 533 numbers
544NXXXXXX 1544NXXXXXX 544 numbers
566NXXXXXX 1566NXXXXXX 566 numbers
577NXXXXXX 1577NXXXXXX 577 numbers
588NXXXXXX 1588NXXXXXX 588 numbers
600NXXXXXX 1600NXXXXXX Canada Remote Satellite Phone Service
700NXXXXXX 1700NXXXXXX 700 numbers
900NXXXXXX 1900NXXXXXX 900 numbers
NXX976XXXX 1NXX976XXXX Any area code + 976 + XXXX

Outside Canada/US (These are international calls, so may want to block them)
242NXXXXXX 1242NXXXXXX BAHAMAS
246NXXXXXX 1246NXXXXXX BARBADOS
264NXXXXXX 1264NXXXXXX ANGUILLA
268NXXXXXX 1268NXXXXXX ANTIGUA/BARBUDA
284NXXXXXX 1284NXXXXXX BRITISH VIRGIN ISLANDS
345NXXXXXX 1345NXXXXXX CAYMAN ISLANDS
441NXXXXXX 1441NXXXXXX BERMUDA
473NXXXXXX 1473NXXXXXX GRENADA
649NXXXXXX 1649NXXXXXX TURKS & CAICOS ISLANDS
664NXXXXXX 1664NXXXXXX MONTSERRAT
721NXXXXXX 1721NXXXXXX SINT MAARTEN
758NXXXXXX 1758NXXXXXX ST. LUCIA
767NXXXXXX 1767NXXXXXX DOMINICA
784NXXXXXX 1784NXXXXXX ST. VINCENT & GRENADINES
809NXXXXXX 1809NXXXXXX DOMINICAN REPUBLIC
829NXXXXXX 1829NXXXXXX DOMINICAN REPUBLIC
849NXXXXXX 1849NXXXXXX DOMINICAN REPUBLIC
868NXXXXXX 1868NXXXXXX TRINIDAD AND TOBAGO
869NXXXXXX 1869NXXXXXX ST. KITTS AND NEVIS
876NXXXXXX 1876NXXXXXX JAMAICA

Other US related (these can sometimes be costly calls even though they are part of US)
684NXXXXXX 1684NXXXXXX AMERICAN SAMOA
670NXXXXXX 1670NXXXXXX NORTHERN MARIANAS ISLANDS
671NXXXXXX 1671NXXXXXX GUAM
340NXXXXXX 1340NXXXXXX US VIRGIN ISLANDS
907NXXXXXX 1907NXXXXXX ALASKA
808NXXXXXX 1808NXXXXXX HAWAII
787NXXXXXX 1787NXXXXXX PUERTO RICO
939NXXXXXX 1939NXXXXXX PUERTO RICO

Toll Free Numbers (I usually leave these unblocked, but you may want to block them)
800NXXXXXX 1800NXXXXXX 800 numbers
822NXXXXXX 1822NXXXXXX 822 numbers
833NXXXXXX 1833NXXXXXX 833 numbers
844NXXXXXX 1844NXXXXXX 844 numbers
855NXXXXXX 1855NXXXXXX 855 numbers
866NXXXXXX 1866NXXXXXX 866 numbers
877NXXXXXX 1877NXXXXXX 877 numbers
888NXXXXXX 1888NXXXXXX 888 numbers

BLACKLIST METHOD
The method I am using to implement these patterns is using a Barred Outbound Route and a Barred Trunk. See this post for details:
http://www.freepbx.org/news/2008-11-05/restricting-outbound-calls-in-freepbx-blacklist

EDIT:
If you are using a newer version that allows you to import routes from a CSV file, here is a copy and paste version of the above numbers you can save as csv for import:

Special Purpose (probably will always want to block these)
,456NXXXXXX,
,1456NXXXXXX,
,500NXXXXXX,
,1500NXXXXXX,
,522NXXXXXX,
,1522NXXXXXX,
,533NXXXXXX,
,1533NXXXXXX,
,544NXXXXXX,
,1544NXXXXXX,
,566NXXXXXX,
,1566NXXXXXX,
,577NXXXXXX,
,1577NXXXXXX,
,588NXXXXXX,
,1588NXXXXXX,
,600NXXXXXX,
,1600NXXXXXX,
,700NXXXXXX,
,1700NXXXXXX,
,900NXXXXXX,
,1900NXXXXXX,
,NXX976XXXX,
,1NXX976XXXX,

Outside Canada/US (These are international calls, so may want to block them)
,242NXXXXXX,
,1242NXXXXXX,
,246NXXXXXX,
,1246NXXXXXX,
,264NXXXXXX,
,1264NXXXXXX,
,268NXXXXXX,
,1268NXXXXXX,
,284NXXXXXX,
,1284NXXXXXX,
,345NXXXXXX,
,1345NXXXXXX,
,441NXXXXXX,
,1441NXXXXXX,
,473NXXXXXX,
,1473NXXXXXX,
,649NXXXXXX,
,1649NXXXXXX,
,664NXXXXXX,
,1664NXXXXXX,
,721NXXXXXX,
,1721NXXXXXX,
,758NXXXXXX,
,1758NXXXXXX,
,767NXXXXXX,
,1767NXXXXXX,
,784NXXXXXX,
,1784NXXXXXX,
,809NXXXXXX,
,1809NXXXXXX,
,829NXXXXXX,
,1829NXXXXXX,
,849NXXXXXX,
,1849NXXXXXX,
,868NXXXXXX,
,1868NXXXXXX,
,869NXXXXXX,
,1869NXXXXXX,
,876NXXXXXX,
,1876NXXXXXX,

Other US related (these can sometimes be costly calls even though they are part of US)
,684NXXXXXX,
,1684NXXXXXX,
,670NXXXXXX,
,1670NXXXXXX,
,671NXXXXXX,
,1671NXXXXXX,
,340NXXXXXX,
,1340NXXXXXX,
,907NXXXXXX,
,1907NXXXXXX,
,808NXXXXXX,
,1808NXXXXXX,
,787NXXXXXX,
,1787NXXXXXX,
,939NXXXXXX,
,1939NXXXXXX,

Thanks !!!

BF

Great info, but…

Several weeks ago there was a post concerning the cut and past functionality that was available pre 2.8 to facilitate entering many pattern matches. Has there been any new development in this or some other method of bulk input of pattern matches.

I’ve tried to import this directly into mysql through phpmyadmin, but keep getting errors.

Thanks

BF

I am using v2.7.0.5 and have not had any problems at all with copy and paste (from either a text file or from Excel).

If you send me a private message with your email address, I can send you an Excel spreadsheet which might work better for copy and paste.

EDIT: I found the following post, and can see that the copy and paste issue is with v2.8, not v2.7:
http://www.freepbx.org/forum/freepbx/beta-program-issues/2-8-dial-pattern-and-rules

Bill,

It was added in r10159, #4445

I have tested it and it works great.

That seems to be the 2.9 port. I was wondering about 2.8.

Bill

If it is working as it should it will be ported to 2.8. Hint: we need more testers

You need some folks to put up a 2.9 system?

BF

Well, the 2.9 is still in alpha so there is no release yet, just svn.

I have done some heavy testing in 2,9 but we need a couple of more testers.

If you feel like it just download these files:

http://www.freepbx.org/trac/browser/modules/branches/2.9/core/core.css
http://www.freepbx.org/trac/browser/modules/branches/2.9/core/page.routing.php
http://www.freepbx.org/trac/browser/modules/branches/2.9/core/page.trunks.php
Note: Select Original Format at the end of the page to get the raw file.

And replace them in modules/core on a FreePBX 2.8 TEST SYSTEM!!!
Remember to change owner for those files in modules/core (chown asterisk.asterisk *)

Then go to Outbound Routes, hover with the mouse over Dial Pattern Wizards to read the tooltip, then select Upload from CSV in the drop-down list and load a .csv file.

Example for a csv file with match pattern:
match pattern
800NXXXXXX
822NXXXXXX
833NXXXXXX
844NXXXXXX
855NXXXXXX
866NXXXXXX
877NXXXXXX
888NXXXXXX

Example for a csv file for two fields:
prepend, match pattern
1,800NXXXXXX
1,822NXXXXXX
1,833NXXXXXX
1,844NXXXXXX
1,855NXXXXXX
1,866NXXXXXX
1,877NXXXXXX
1,888NXXXXXX

You get the idea when you test.

Tested it on my 2.8 test system. Works, as you say, great. Didn’t see anything askew.

Bill

Hi jsherk,

Nice job on those NANP area code. I was going to do the same homework for the office when I came up across with your listing. At least it saves me time compiling them myself. Thanks again for sharing!

I just updated my original post:

205 area code is actually Alabama not Alaska as I had it listed, so I removed it.

If you are using a newer version that allows you to import routes from a CSV file, here is a copy and paste version of the above numbers you can save as csv for import:

Special Purpose (probably will always want to block these)
,456NXXXXXX,
,1456NXXXXXX,
,500NXXXXXX,
,1500NXXXXXX,
,522NXXXXXX,
,1522NXXXXXX,
,533NXXXXXX,
,1533NXXXXXX,
,544NXXXXXX,
,1544NXXXXXX,
,566NXXXXXX,
,1566NXXXXXX,
,577NXXXXXX,
,1577NXXXXXX,
,588NXXXXXX,
,1588NXXXXXX,
,600NXXXXXX,
,1600NXXXXXX,
,700NXXXXXX,
,1700NXXXXXX,
,900NXXXXXX,
,1900NXXXXXX,
,NXX976XXXX,
,1NXX976XXXX,

Outside Canada/US (These are international calls, so may want to block them)
,242NXXXXXX,
,1242NXXXXXX,
,246NXXXXXX,
,1246NXXXXXX,
,264NXXXXXX,
,1264NXXXXXX,
,268NXXXXXX,
,1268NXXXXXX,
,284NXXXXXX,
,1284NXXXXXX,
,345NXXXXXX,
,1345NXXXXXX,
,441NXXXXXX,
,1441NXXXXXX,
,473NXXXXXX,
,1473NXXXXXX,
,649NXXXXXX,
,1649NXXXXXX,
,664NXXXXXX,
,1664NXXXXXX,
,721NXXXXXX,
,1721NXXXXXX,
,758NXXXXXX,
,1758NXXXXXX,
,767NXXXXXX,
,1767NXXXXXX,
,784NXXXXXX,
,1784NXXXXXX,
,809NXXXXXX,
,1809NXXXXXX,
,829NXXXXXX,
,1829NXXXXXX,
,849NXXXXXX,
,1849NXXXXXX,
,868NXXXXXX,
,1868NXXXXXX,
,869NXXXXXX,
,1869NXXXXXX,
,876NXXXXXX,
,1876NXXXXXX,

Other US related (these can sometimes be costly calls even though they are part of US)
,684NXXXXXX,
,1684NXXXXXX,
,670NXXXXXX,
,1670NXXXXXX,
,671NXXXXXX,
,1671NXXXXXX,
,340NXXXXXX,
,1340NXXXXXX,
,907NXXXXXX,
,1907NXXXXXX,
,808NXXXXXX,
,1808NXXXXXX,
,787NXXXXXX,
,1787NXXXXXX,
,939NXXXXXX,
,1939NXXXXXX,