System information
Virtual device Description
Park:<exten@context> The state of a spot in a call parking lot. The state information will reflect whether or not a
caller is currently parked at that extension. More information about call parking in Asterisk
can be found in “Parking Lots” on page 228.
Calendar:<calendar
name>
Calendar state. Asterisk will use the contents of the named calendar to set the state to
available or busy. More information about calendar integration in Asterisk can be found
in Chapter 18.
A device state is a simple one-to-one mapping to a device. Figure 14-1 shows this
mapping.
Figure 14-1. Device state mappings
Checking Device States
The DEVICE_STATE() dialplan function can be used to read the current state of a device.
Here is a simple example of it being used in the dialplan:
exten => 7012,1,Answer()
; *** This line should not have any line breaks
same => n,Verbose(3,The state of SIP/0004F2060EB4 is
${DEVICE_STATE(SIP/0004F2060EB4)})
same => n,Hangup()
If we call extension 7012 from the same device that we are checking the state of, the
following verbose message comes up on the Asterisk console:
-- The state of SIP/0004F2060EB4 is INUSE
302 | Chapter 14: Device States