Connect To Remote GW

Home » Asterisk Users » Connect To Remote GW
Asterisk Users 2 Comments

If SIP channel driver needs to connect to a remote GW over a dedicated SIP trunk BUT the remote GW has a ‘standby’ in case of failure, how can the sip configuration file be configured for the remote GW when there are actually two IP addresses. If the main remote GW fails control automatically switches to the standby GW, so how could the SIP configuration file hande this switch and support both host IP addresses. There is no DNS so straight IP addressing is used.

2 thoughts on - Connect To Remote GW

  • Make two trunk entries in sip.conf for both IPs and do the failover routing in extensions.conf

    Mitul

  • Doing it in the dialplan is a bit of a bodge but perfectly possible. Just make sure you have qualify=yes so if a GW does down asterisk spots it and the Dial() command returns quickly. You might also wish to reduce the check interval down from the default of every minute.

    The proper way is to make use of DVS SRV however Asterisk doesnt support it properly (doesnt fail over). Not sure if that has been fixed in version 12.

    If there is just one active GW and one or more backups then the its normally fairly easy to create a virtual IP address on the GW so if one fails then another takes over. Only works if they are on the same network though.

    Alternatively use something like opensips as a front end. Thats what we do and it load balances between multiple asterisk server and detects if one fails. You can make use of keepalived to provide a virtual IP
    address which moves between boxes if one dies or the opensips process stops running.