Multiple Outbound Routes & Trunks

My bad - shouldn’t post incomplete code examples as later, someone going back might not get the whole thing.

My dialing examples are what are allowed outbound to be dialed from the phone, but here are my actual dial plans that we use:

  1. Drop - A route that matches all the Carribean Prefixes to a dummy SIP trunk that kills the calls into nowhere. I got them from Level(3) after a customer put one of my boxes on a Public IP and 11 hours and $4K of toll fraud later, we always put this route in first to kill outbound to any of these prefixes. In case anyone gets this post on a search, here they are:

1242NXXXXXX
1246NXXXXXX
1264NXXXXXX
1268NXXXXXX
1284NXXXXXX
1340NXXXXXX
1345NXXXXXX
1441NXXXXXX
1473NXXXXXX
1649NXXXXXX
1664NXXXXXX
1758NXXXXXX
1767NXXXXXX
1784NXXXXXX
1787NXXXXXX
1809NXXXXXX
1829NXXXXXX
1849NXXXXXX
1868NXXXXXX
1869NXXXXXX
1876NXXXXXX

Note also that we check for all three permutations of the above to not miss anything that might have been dialed so for instance we check for 876NXXXXXX, 1876NXXXXXX and +1866NXXXXXX - it would have just made the list too long.

  1. Emergency - 911 and 9911 stripping the first 9 so if someone panics and dials the extra 9 it is dropped
  2. Local - All my customers home bases are in the 505 so NXXXXXX and 505NXXXXXX and 1505NXXXXXX
  3. Toll Free - Matching all the 8XXNXXXXXX and 18XXNXXXXXX Toll Free prefixes - again the very first route would have already peeled off the bad exchanges.
  4. Long Distance - Here we match NXXNXXXXXX and 1NXXNXXXXXX since it didn’t match anything before.
  5. International - Turned off for 98% of my customers, but 011. with a PIN.

Thanks for the heads up - probably should have posted a better example.