[Asterisk-Users] making an action based on the status of multiple extensions

C F shmaltz at gmail.com
Thu Apr 14 13:25:51 MST 2005


Don't use it multiple channels, just do like this
exten => s,1,Dial(channel1,1)
exten => s,2,SetVar(C1S=${DIALSTATUS})
exten => s,3,Dial(channel2,1)
exten => s,4,SetVar(C2S=${DIALSTATUS})
exten => ;keep on going for all your channels
then do like this:
exten => s,1,GotoIf($[${C1S} = BUSY]?500)
exten => s,2,GotoIf($[${C2S} = BUSY]?500)
and so on
if none where busy then you can keep going and ring all at once. if
noone picks up you can use VM other wise program something at 500.

exten => s,500, put your code of dialing all the channels here

This is *not* foolproof, and there are easier ways of testing and
doing what I'm doing above, but it should work. Keep in mind that for
each channel it will take at least 1 second if you have 5 channels it
means at least 5 seconds, a very long time. Try (I never tested it,
but it might work) useing Dial(channel1,.1) that is a tenth of a
second, or maybe even .01 which is 10 mil.
Have fun, and let me know how it works out.



More information about the asterisk-users mailing list