How to auto select an outgoing trunk based on called number area code?

Unanswered Question
Apr 28th, 2010

I have a client with 2 vonage ATA (3 PSTN) lines. Each of the primary lines are registered to a different area code. The UC520 setup has one ata as a local for #1 area code (905) while the other is local for the second area code (705). A third line is a DID Fax.

However, when I config the dial plan to use the appropriate local line for outgoing I cant seem to have the call select the proper outgoing trunk for that local line. I have tried using the full 10 digit number or 7 digits and still no success. I have tested the dial plan and see with SIP it is using the primary SIP server followed by secondary SIP servers then round robin for all four FXO's even though the 4th FXO is disabled. All the FXO's are precedence of 5.

Switching to PSTN only offers the FXO ports in a round robin fashion with the same results.

I have setup two PSTN trunk groups with only one FXO for each local area code and set them as the preferred trunk but in every example CCA defaults to a round robin or random trunk selection using all 4 FXO's. Oddly the FXO's also show precedence of 5 even though I have changed these with no apparent difference.

Has anyone else run up against this problem and/or have any suggestions for me here?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
David Trad Wed, 04/28/2010 - 15:58

Hi Paul,

This process can be a little cumbersome and annoying, but it is the only way I know how to make it work properly with little challenges (The way I like it).

You can manipulate the call routing quite easily with the Dial-Peers, below is a very basic outline/guide on how to do it, and is based on having 3 different ATA adapters connected:

  • Create 3 different dial-eers, each dial-peer pointing to a different ATA adapter, and each one in the order of preference
  • To point it to a specific ATA adapter use the "port 0/0/0" command (Change the 0/0/0 part to the right port number)
  • If you have an ATA adapter that allows for multiple lines, then you will need to configure each line to only allow for certain outbound calling (This extremely tricky, and do not recommend this as an approach).

The bottom line is, it can be done, and you just need to manipulate the dial-peers, I am not sure if you can you do this with CCA as I find doing it via CLI quicker and more efficient then CCA, so if you want to do it on the CLI, basically you do the following:

  • Copy your entire dial-peer config over into a text file
  • Create two more sets of Dial-Peers (Make sure they are POTS dial-peers not VoIP)
  • Put each set of dial-peers in the order of preference, so if the first ATA adapter is busy you may want to pay the extra costs and have it route through a secondary or third ATA adapter so your call continue to flow freely.

I hope i have not misunderstood you in this manner :)



paul.sheehan Thu, 05/06/2010 - 08:59

Hi David;

Thanks for the advice. I will try to redirect the calls via the hardware port definitions (port 0/0/0) but as you mentioned i have one ata with multiple lines and so will need to config the peers with more distinction. Thanks for the input and I will update the post when I get feedback from  the client.


This Discussion