Asterisk Device state INUSE


Recently I got a task: SIP/100 should accept two calls at the same time and if first line “busy” caller should hear “Operator busy. Please wait”.

I tried to solve that with queue but queue cant announce “OP busy” because it was not busy (2-nd line call).

So I solved that task in next way:

exten => s,n,NoOp(SIP/100 has state ${DEVICE_STATE(SIP/100)})
exten => s,n,GotoIf($["${DEVICE_STATE(SIP/100)}" = "INUSE"]?busy)
exten => s,n,Dial(SIP/100,60,tm(moh1))
exten => s,n,Hangup()
exten => s,n(busy),Dial(SIP/100,60,tm(mohbusy))
exten => s,n,Hangup()

Two musiconhold’s: one for NOT BUSY and one for BUSY/INUSE state.

Leave a Reply

Your email address will not be published. Required fields are marked *