[asterisk-users] Check if SIP is avaible to dial

Jakub Syrek arkon at nast.pl
Fri Nov 23 07:47:27 CST 2007


> See the doc/queues-with-callback-members.txt - it has good samples of
> GROUP_COUNT and OUTBOUND_GROUP commands.
>
> Regards,
> Atis

According to this i wrote macro like this below, is it correct?

[macro-call]
;sip1 - firs channel from sip outgoing cals operator
;sip2 - second channel from sip outgoing cals operator
;sipn - N channel from sip outgoing cals operator
;ARG1 - outgoing telephone number
exten => s,1,SetGroup(${ARG1})
exten => s,2,GotoIf($[ ${GROUP_COUNT(${ARG1})} < 2 ]?dial-ok)

;outgoing number was called previously by someone else?
exten => s,n,NoOp(-- Call destination was previously called and its busy --)
exten => s,n,Hangup

;we can dial
;now chack witch chanel is free to meake a call with
exten => s,n(dial-ok)GotoIf($[ ${GROUP_COUNT(sip1)} > 1 ]?sip1-busy)
exten => s,n,Dial(SIP/sip1/${ARG1},25,m)
exten => s,n,Hangup

exten => s,n(sip1-busy),GotoIf($[ ${GROUP_COUNT(sip1)} > 1 ]?sip2-busy)
exten => s,n,Dial(SIP/sip2/${ARG1},25,m)
exten => s,n,Hangup

;and so on to last one

exten => s,n(sipN-busy),GotoIf($[ ${GROUP_COUNT(sip1)} > 1 ]?all-busy)
exten => s,n,Dial(SIP/sip2/${ARG1},25,m)
exten => s,n,Hangup

;every channel is busy
exten => s,n(all-busy),Hangup 




More information about the asterisk-users mailing list