Skip to content

Commit

Permalink
FREEPBX-12534 Update npa lists for us and canada including toll free
Browse files Browse the repository at this point in the history
  • Loading branch information
jfinstrom authored and tm1000 committed Jun 13, 2016
1 parent 12bf427 commit 3d6f499
Showing 1 changed file with 42 additions and 37 deletions.
79 changes: 42 additions & 37 deletions includes/superfecta_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,57 +562,62 @@ function IsValidNumber($country, $thenumber, &$rPart1=null, &$rPart2=null, &$rPa
$station = substr($thenumber, 6, 4);

// Check for Toll-Free numbers
if ($npa == '800' || $npa == '866' || $npa == '877' || $npa == '888') {
if ($npa == '800' || $npa == '866' || $npa == '877' || $npa == '888' || $npa == '844' || $npa == '855') {
$TFnpa = true;
}

if ($country == 'US' && !$number_error) {
// Check for valid US NPA
// 06/13/2016 https://www.nationalnanpa.com/reports/reports_npa.html
$npalistUS = array(
"201", "202", "203", "205", "206", "207", "208", "209", "210", "212",
"213", "214", "215", "216", "217", "218", "219", "224", "225", "228",
"229", "231", "234", "239", "240", "242", "246", "248", "251", "252",
"253", "254", "256", "260", "262", "264", "267", "268", "269", "270",
"276", "281", "284", "301", "302", "303", "304", "305", "307", "308",
"309", "310", "312", "313", "314", "315", "316", "317", "318", "319",
"320", "321", "323", "325", "330", "331", "334", "336", "337", "339",
"340", "345", "347", "351", "352", "360", "361", "386", "401", "402",
"404", "405", "406", "407", "408", "409", "410", "412", "413", "414",
"415", "417", "419", "423", "424", "425", "430", "432", "434", "435",
"440", "441", "443", "456", "469", "473", "478", "479", "480", "484",
"500", "501", "502", "503", "504", "505", "507", "508", "509", "510",
"512", "513", "515", "516", "517", "518", "520", "530", "540", "541",
"551", "559", "561", "562", "563", "567", "570", "571", "573", "574",
"575", "580", "585", "586", "600", "601", "602", "603", "605", "606",
"607", "608", "609", "610", "612", "614", "615", "616", "617", "618",
"619", "620", "623", "626", "630", "631", "636", "641", "646", "649",
"650", "651", "660", "661", "662", "664", "670", "671", "678", "682",
"684", "700", "701", "702", "703", "704", "706", "707", "708", "710",
"712", "713", "714", "715", "716", "717", "718", "719", "720", "724",
"727", "731", "732", "734", "740", "754", "757", "758", "760", "762",
"763", "765", "767", "769", "770", "772", "773", "774", "775", "779",
"781", "784", "785", "786", "787", "801", "802", "803", "804", "805",
"806", "808", "809", "810", "812", "813", "814", "815", "816", "817",
"818", "828", "829", "830", "831", "832", "843", "845", "847", "848",
"850", "856", "857", "858", "859", "860", "862", "863", "864", "865",
"868", "869", "870", "876", "878", "900", "901", "903", "904", "906",
"907", "908", "909", "910", "912", "913", "914", "915", "916", "917",
"918", "919", "920", "925", "928", "931", "936", "937", "939", "940",
"941", "947", "949", "951", "952", "954", "956", "970", "971", "972",
"973", "978", "979", "980", "985", "989",
"800", "866", "877", "888"
"201","202","203","205","206","207","208","209","210","212",
"213","214","215","216","217","218","219","220","224","225",
"227","228","229","231","234","239","240","248","251","252",
"253","254","256","260","262","267","269","270","272","274",
"276","281","283","301","302","303","304","305","307","308",
"309","310","312","313","314","315","316","317","318","319",
"320","321","323","325","327","330","331","332","334","336",
"337","339","340","346","347","351","352","360","361","364",
"380","385","386","401","402","404","405","406","407","408",
"409","410","412","413","414","415","417","419","423","424",
"425","430","432","434","435","440","442","443","447","456",
"458","463","464","469","470","475","478","479","480","484",
"501","502","503","504","505","507","508","509","510","512",
"513","515","516","517","518","520","530","531","534","539",
"540","541","551","557","559","561","562","563","564","567",
"570","571","573","574","575","580","585","586","601","602",
"603","605","606","607","608","609","610","612","614","615",
"616","617","618","619","620","623","626","628","629","630",
"631","636","641","646","650","651","657","659","660","661",
"662","667","669","670","671","678","679","680","681","682",
"684","689","701","702","703","704","706","707","708","710",
"712","713","714","715","716","717","718","719","720","724",
"725","727","730","731","732","734","737","740","743","747",
"754","757","760","762","763","765","769","770","772","773",
"774","775","779","781","785","786","787","801","802","803",
"804","805","806","808","810","812","813","814","815","816",
"817","818","828","830","831","832","843","845","847","848",
"850","854","856","857","858","859","860","862","863","864",
"865","870","872","878","901","903","904","906","907","908",
"909","910","912","913","914","915","916","917","918","919",
"920","925","928","929","930","931","934","936","937","938",
"939","940","941","947","949","951","952","954","956","959",
"970","971","972","973","975","978","979","980","984","985",
"986","989","800","844","855","866","877","888"
);

$validnpaUS = in_array($npa, $npalistUS);
}

if ($country == 'CA' && !$number_error) {
// Check for valid CAN NPA
// 06/13/2016 https://www.nationalnanpa.com/reports/reports_npa.html
$npalistCAN = array(
"204", "226", "249", "250", "289", "306", "343", "365", "403", "416", "418", "438", "450",
"506", "514", "519", "581", "587", "579", "604", "613", "647", "705", "709",
"778", "780", "807", "819", "867", "873", "902", "905",
"800", "866", "877", "888"
"204","226","236","249","250","289","306","343","365","403",
"416","418","431","437","438","450","456","506","514","519",
"548","579","581","587","604","613","639","647","705","709",
"778","780","782","807","819","825","867","873","902","905",
"800","844","855","866","877","888"
);

$validnpaCAN = in_array($npa, $npalistCAN);
Expand Down

0 comments on commit 3d6f499

Please sign in to comment.