[asterisk-dev] How to detect Asterisk failure

Benny Amorsen benny+usenet at amorsen.dk
Thu Feb 25 08:20:32 CST 2010


I have a setup with two gateways to the PSTN, and a lot of customers
each with their own Asterisk server. Should one of the PSTN gateways
fail, I would like customers to automatically use the other one.

There are a number of challenges here.

The naïve solution is to simply Dial() the first gateway and if that
returns CONGESTION, try the other one. This is not optimal, because
calls may return CONGESTION for many reasons, e.g. when the dialed
number is invalid. The invalid number is then tried on both gateways,
which is a waste.

How can I determine that the call failed because the remote Asterisk is
unreachable? I.e. the remote Asterisk either fails to reply to the SIP
INVITE or the remote Asterisk is considered UNREACHABLE by qualify.


/Benny





More information about the asterisk-dev mailing list