[asterisk-users] Use SRV for failover proxy

Gareth Blades mailinglist+asterisk at dns99.co.uk
Fri Sep 6 07:21:08 CDT 2013


On 06/09/13 09:42, Dominique Haeber wrote:
> Hi all,
>
> is it possible that asterisk uses two proxies with SRV?
> The enddevices are registered on one of the two Proxies (Kamailio).
> The two proxies communicate with each other.
> And asterisk can choose one of this proxies with SRV.
>
> asterisk
> |       \
> |        \
> Proxy1    Proxy2
>
>
> I have tries to solve this problem with two trunks for this proxies
> and Dial(... at proxytrunk) but on this way the properties of the
> enddevices are lost and the properties from trunk are taken.
>
> So i'd like to use SRV, if that is possible.
>
> Very thanks
> Dominique
No asterisk will always use the first SRV record and wont load balance 
or switch to a backup if its not reachable.

What we do is have each endpoint defined in sip.conf with qualify=yes 
and then in the dialplan use the ${SIPPEER(x)} variable to pull out the 
status of each peer and pass it into an AGI application to perform the 
load balancing etc...

If you are happy with wone being a primary and one being a backup then 
if you have qualify=yes set for both you could just dial using the first 
one and then an execif hangupcause=20 then try dialing the backup.



More information about the asterisk-users mailing list