[asterisk-users] how to use qualify times to route calls

Danny Nicholas danny at debsinc.com
Wed Mar 2 16:34:53 CST 2011


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of sean darcy
Sent: Wednesday, March 02, 2011 4:29 PM
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] how to use qualify times to route calls

I'm using 1.8.3, and have 2 sip providers. Both are set with 
qualify=yes. Each of them sometimes have qualify times 10+ times the 
other. For instance, one will be at 10-15ms, the other at 200ms.

Is there a way I can route an outgoing call to the provider with the 
lower qualify time?

sean

You could do a context using an AGI to do a "sip show peers" and select the
provider from that.  Something like this

[pick_prov]
exten => s,1,AGI(getprov.agi)
exten => s,n,Dial(SIP/${EXTEN}@${BESTPROV},30,m)

getprov.agi does "sip show peers" and gets the qualify time from status.
The low value is returned in the variable BESTPROV.

Should be about 50 lines of PERL or PHP.




More information about the asterisk-users mailing list