Asterisk with 2 ip's on different nic card

cleard used Ask the Experts™
Hi all,

My sip provider as supplied me with 2 trunk
my Linux server as 2 nic card 2 different ips
trunk 1 external ip is router with static route going to internal ip should be for long distance calls.
trunk 2 external ip is going to internal ip should be for local calls
my problem is that when I do long distance call is going on ip 2.29 and when I do local calls it goes to the same ip.
My question i how can I get long distance calls to route from Asterisk to the right ip (

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
This is interesting, I don´t think Asterisk can differentiate. When it writes SIP packets it fills the headers with whatever your sip.conf is configured with, but then passes the data to the TCP/IP stack (linux) for routing. I believe once the packet is encapsulated in UDP datagrams by the OS, the routing is left to it making it use the best route to reach the LD carrier. Can you post a route -n here?



here it is:   U     0      0        0 eth0   U     0      0        0 eth1     U     0      0        0 eth1         UG    0      0        0 eth0


don't forget I did my static route on my cisco pix
I couldn´t have forgotten cuz you didn´t mention it!

Now, in your sip.conf the 2 trunks should be configured separately with a host=x.x.x.x line in it. In the extensions.conf, there should be a extension configuration that matches calls to long distance numbers. The Dial() application will invoke the trunk for outgoing calls, using the right IP. I think this is the whole deal.



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial