Showing results for 
Search instead for 
Did you mean: 

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


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?

2 Replies 2

David Trad
Rising star
Rising star

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 :)



Cheers, David Trad. **When you rate a persons post, you are indicating a thank you or that it helped, but at the same time you are also helping to maintain the community spirit - You don't have to rate posts and you wont be looked down upon :) *

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: