[Asterisk-Dev] check availability for several SIP and Zap
channels by order
Kaloyan Kovachev
kkovachev at varna.net
Thu Dec 1 01:03:11 MST 2005
Hi
not sure if it is the best way, but by simply dialing the first channel and
then check the dialstatus should work. If the dialstatus is CHANUNAVAIL or
CONGESTION then dial the next one. Adding the s option to ChanIsAvail could
also help.
On Thu, 1 Dec 2005 15:40:47 +0800, Guo-Wei Chiuan wrote
> Hi All,
>
> I am wondering how I program my dialplan to meet this senario.
>
> - I have several SIP and ZAP channels, i.e. SIP/1, SIP/2(to Vonage), Zap/1,
Zap/2(to AT&T)
> - Due to cost consideration, I would like to check availability for SIP
channels first, then Zap channels, dial out via the first available channel.
>
> First, I tried to use ChanIsAvail() in my dialplan like this
>
> ; try SIP/1 which is cheapest, then SIP/2, Zap/1, and Zap/2 which is most
expensive
> exten => 123,1,ChanIsAvail(SIP/1&SIP/2&Zap/1&Zap2)
> exten => 123,2,Dial(${AVAILORIGCHAN}/14082223333)
> ; go to 101 if none is available
> exten => 123,102,Playback(all-circuits-busy-now)
>
>
> However, it does not work that well. For instance if SIP/1 is a invalid
channel, ChanIsAvail() still presents it is available.
> Thus, the call always goes out via SIP/1 and never succeeds.
> I doubt that ChanIsAvail() only works properly for Zap channels.
>
> So, does anybody have other ideas how to write dialplan to cost down phone
call expense in this case?
>
>
> thanks
> JC
>
>
>
More information about the asterisk-dev
mailing list