Dual SIP-trunks over two WANs

Hello guys!

I have a question that I was not able to find clear answer yet.
Is it possible to have two SIP-trunks each running over separate WAN on one Asterisk server? Second SIP-trunk and WAN should kick in only if primary WAN goes down. Is there a way to dynamically change servers external IP address if it is behind the NAT? Or such behavior can be achieved by connecting server directly to ISPs?

Thanks.

Regards, Volodymyr.

Running with WANs that don’t form an internet is fiddly. In some cases you may need to run an instance of Asterisk for each WAN.

The correct way of handling multi-homing is to use autonomous system numbers for routing and the border gateway protocol. You will probably only get support from this from ISPs if you are a big user.

The correct way of doing fallback for outbound calls without proper homing is to operate within the internet address space and rely on the OS routing tables to get to the right ISP.

Thanks david55 for pointing me in right direction. I think It’s possible to manipulate routes with script. And the only way to make secondary SIT-trunk work properly on secondary ISP would be to edit externip in sip.conf and than perform sip reload.