[trunk_check]
exten => s,1,Noop(-----START-OUT-CALL-----)
same => n,Set(lineList=213135;213136)
same => n(next_trunk),Noop(-------NEXT-TRUNK-----)
same => n,Set(OUT_LINE=${CUT(lineList,;,1)});
same => n,Set(__lineList=${CUT(lineList,;,2-)});
same => n,GotoIf($["${DEVICE_STATE(SIP/${OUT_LINE})}"="NOT_INUSE"]?:next_trunk)
same => n,Dial(SIP/${ARG1}@${OUT_LINE},45,T)
same => n,GotoIf($["${DIALSTATUS}"="BUSY"]?end_call)
same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?end_call)
same => n,GotoIf($[${LEN(${lineList})} > 0]?next_trunk)
same => n,PlayBack(all_lines_busy)
same => n(end_call),Hangup()