[HELP] One asterisk server, 2 dsl lines and 2 voip providers

Hi to all!

I would like to understand if it is possible manage this situation:

I have a configured and well working asterisk server with 6 SIP accounts. 5 are from the same VoIP provider (provider1). One account is from another one (provider2).

I also have 2 DSL lines so I would like to use the first_router with the provider1 and the second_router for the provider2

My idea was to setup a routing like this:

route add default gw first_router (for all, including viip.provider1.com)
route add -host voip.provider2.com gw second_router

I tried this solution but also the voip.provider2.com is reached on the first_router, that is the default router.

May be this is because I defined the externip that is the external ip of the first_router?

I tried to find more info but I am not sure if it is possible to setup 2 different externip and also if it possible to manage this kind of situation.

Any ideas on how to solve the problem?

Thank you in advance!

Are you saying that voip.provider2.com is trying to come back through first_router even with a route that sends it out the second router?

i would have thought that the externip setting in sip.conf would have kinda guaranteed that !!

not sure how to “fix” this, i guess you could either rewrite all packets destined for the affected provider, or it might be easier to write “chan_sip2” :question:


also if the voip.provider2.com route is set to the second router, asterisk uses in any case the first router also for the second sip provider.

Using the traceroute function the route isc correctly displayed. But asterisk things different.

But I just discovered thath all is OK with IAX instead of SIP. In fact the provider2 is another asterisk that uses the same ISP of my second router.

I asked to configure for my asterisk an Iax extension and trunk. Now all is ok!

Many thanks!