[Asterisk-Users] Fail over to Pri on VoIP connection failure

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Fri Jan 27 14:44:41 MST 2006


On Friday 27 January 2006 16:24, Damon Estep wrote:
> If you have qualify=yes I assume that triggers a sip query to get
> channel capabilities from the peer? What is the qualify timeout? Can it
> be manipulated?

qualify (for SIP) sends a SIP OPTIONS packet to the peer and waits for a 
response.  If it does not receive one within 1000ms (by default) and 
qualifysmoothing is not enabled, it will flag the peer as UNREACHABLE which 
means that any attempts to Dial() the peer will fail immediately with 
CHANUNAVAIL.  Asterisk continues to send these "pings" until it receives a 
response within the accepted timeframe and once it gets responses again it 
will flag the peer as being available once again.

There are some other tuning parameters which can be used to modify this 
behaviour slightly but this is what qualify does in a nutshell.

> If the goal was strictly to try one provider, and if the channel fails
> qualify, then try the next, is the macro you posted needed?

Correct.

> Couldn't you just;
>
> Exten => ####,1,Dial(SIP/{$exten at peer1}
> Exten => ####,2,Dial(SIP/{$exten at peer2}
> Exten => ####,3,Congestion(15)
> Exnte => ####,4,Hangup

Well I've never been a fan of just letting things "fall off the edge" and 
expecting them to work reliably.  I use the 'g' Dial() option so that I can 
handle failover and call completion correctly or properly -- instead of just 
letting it do "whatever svn trunk deems right at this point" I specifically 
do things based on how the call terminated.  It's just a nicer way of doing 
what you've provided, and ends up being more robust to code policy changes.

-A.



More information about the asterisk-users mailing list