[Asterisk-Dev] check availability for several SIP and Zap channels by order

Guo-Wei Chiuan gwchiuan at gmail.com
Thu Dec 1 00:40:47 MST 2005


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20051201/7d06bec1/attachment.htm


More information about the asterisk-dev mailing list