DEVICE_STATE()
Synopsis
Get or Set a device state.
Description
The DEVICE_STATE function can be used to retrieve the device state from any device state provider. For example:
NoOp(SIP/mypeer has state ${DEVICE_STATE(SIP/mypeer)})
NoOp(Conference number 1234 has state ${DEVICE_STATE(MeetMe:1234)})
The DEVICE_STATE function can also be used to set custom device state from the dialplan. The Custom:
prefix must be used. For example:
Set(DEVICE_STATE(Custom:lamp1)=BUSY)
Set(DEVICE_STATE(Custom:lamp2)=NOT_INUSE)
You can subscribe to the status of a custom device state using a hint in the dialplan:
exten => 1234,hint,Custom:lamp1
The possible values for both uses of this function are:
UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING | RINGINUSE | ONHOLD
Syntax
DEVICE_STATE(device)
Arguments
device
See Also
Import Version
This documentation was imported from Asterisk Version Unknown
1 Comment
Matt Lehner
With Asterisk 1.8, you must set the callcounter = yes variable in sip.conf global section or on the devices you want to monitor. DEVICE_STATE will return NOT_INUSE otherwise.