This is my queue status that shows invalid state. Could someone help with a hint on how to get local channels to work with queues and states?
Members:
+223344556677 (local/+223344556677@cust131-dial from Custom:+223344556677) (ringinuse disabled) (realtime) (Invalid) has taken no calls yet
And this is the extension I use for local channel
[cust131-dial]
exten => _X.,1,NoOp(Cust131 Queue localchannel dial ${EXTEN})
same => n,Set(DEVICE_STATE(Custom:${EXTEN})=INUSE)
same => n,Dial(PJSIP/test/sip:${EXTEN}@sip.test.com,300,b(add-p-pref^+223344556677^1))
same => n,Hangup()
same => h,Set(DEVICE_STATE(Custom:${EXTEN})=NOT_INUSE)
Device states aren’t limited to SIP or even to VoIP; see:
The OP needs a state interface, because chan_local only returns invalid or not in use, depending on whether the extension exists
He also needs it because the device is remote to Asterisk, and Asterisk will only know the state of the trunk, not a particular number at the end of that trunk.