exten => s,1,NoOp()
exten => s,n,Wait(1)
exten => s,n,SetVar(SPYGROUP=10001)
exten => s,n,ChanIsAvail(SIP/${ARG1}|js) ; j is for dump and s is for ANY call
;-----------------------------------------------------------------------------
;if when the queue calls this extension and the extension is busy, the queue will go to the next extension without trying to present here first
exten => s,n,GotoIf($[${GROUP_COUNT(${MACRO_EXTEN}@agents)} = 0]?avail:busy)
;-----------------------------------------------------------------------------
exten => s,n(avail),Set(OUTBOUND_GROUP=${MACRO_EXTEN}@agents)
exten => s,n,Dial(SIP/${ARG1},20)
exten => s,104(busy),Busy()