Hello,
I need to add a remote PSTN phone number as a member in a queue and update a device’s status to reflect the real state as soon as an agent answers. Setting the IN_USE state is successful, but resetting the status to NOT_INUSE either does not occur before the end of the call or never occurs.
Here are the different tests I have done.
What is the solution to modify the variable just after the end of the call ?
Test 1
[demo-context]
exten => _800Z,1,Verbose(1,Calling queue)
same => n,Queue(Queue01)
same => n,Hangup()
exten => johnRemote,1,NoOp()
same => n,Set(DEVICE_STATE(Custom:johnRemote)=INUSE)
same => n,Dial(PJSIP/gw/sip:0600112233@<ip SIP gateway>:5060)
same => n,Set(DEVICE_STATE(Custom:johnRemote)=NOT_INUSE)
Result: It doesn’t work; the last line is never reached.
Test 2
[demo-context]
exten => _800Z,1,Verbose(1,Calling queue)
same => n,Queue(Queue01)
same => n(after),Verbose(1, Test after)
same => n(reset),Set(DEVICE_STATE(Custom:johnRemote)=NOT_INUSE)
same => n,Hangup()
exten => johnRemote,1,NoOp()
same => n,Set(DEVICE_STATE(Custom:johnRemote)=INUSE)
same => n,Dial(PJSIP/gw/sip:0600112233@<ip SIP gateway>:5060)
Result: It doesn’t work; the (reset) priority is never reached even after the end of the call.
Test 3
[demo-context]
exten => _800Z,1,Verbose(1,Calling queue)
same => n,Queue(Queue01)
same => n(after),Verbose(1, Test after)
same => n,Hangup()
exten => johnRemote,1,NoOp()
same => n,Set(DEVICE_STATE(Custom:johnRemote)=INUSE)
same => n,Dial(PJSIP/gw/sip:0600112233@<ip SIP gateway>:5060,30,G(demo-context,johnRemote,reset))
same => n(reset),Set(DEVICE_STATE(Custom:johnRemote)=NOT_INUSE)
Result: It doesn’t work; soon after the hang up, the status is modified to NOT_USE before the end of the call, and a second call is initiated on the ongoing call.
Test 4
[demo-context]
exten => _800Z,1,Verbose(1,Calling queue)
same => n,Queue(Queue01)
same => n(after),Verbose(1, Test after)
same => n(reset),Set(DEVICE_STATE(Custom:johnRemote)=NOT_INUSE)
same => n,Hangup()
exten => johnRemote,1,NoOp()
same => n,Set(DEVICE_STATE(Custom:johnRemote)=INUSE)
same => n,Dial(PJSIP/gw/sip:0600112233@<ip SIP gateway>:5060,30,G(demo-context,_800Z,after))
Result: It doesn’t work; soon after the hang up, the status is modified to NOT_USE before the end of the call, and a second call is initiated on the ongoing call.