connected to the DPMA are capable of only Available and DND (Phone returns 486 to Asterisk) status. Digium Phones using the DPMA are
capable of much more, with a Status application that allows users to change their presence on the server, opening up new methods for call
routing based on user-presence, and not merely device presence.
Defining User Presence in Asterisk
The fundamentals of how user presence is represented in Asterisk mirrors the concepts currently used with device state. Device state changes
are triggered by device state providers.
Example Device State provider mapped to extension.
A hint for extension 1111 is mapped to the sip peer 1111 device state provider. In this example,
endpoints subscribing to hint 1111 will receive a device state update anytime the device state changes
for sip peer 1111.
exten => 1111,hint,SIP/1111
exten => 1111,1,Dial(SIP/1111)
Using the same pattern, user presence is changed by a CustomPresence user presence provider. A CustomPresence provider works in the same
way a Custom device state provider does. CustomPresence providers are both defined and updated using a dialplan function,
PRESENCE_STATE().
Example Device State and Presence State providers mapped to a single extension.
A hint for extension 1111 is mapped to both the sip peer 1111 device state provider and the
CustomerPresence:1111 user presence provider. Endpoints subscribing to hint 1111 will receive both
device state and user presence notifications for extension 1111.
exten => 1111,hint,SIP/1111,CustomPresence:1111
exten => 1111,1,Dial(SIP/1111)
Manipulating User Presence through Dialplan and AMI
PRESENCE_STATE() Dialplan Function
User presence information is modified through the use of the PRESENCE_STATE() dialplan function. This function allows a custom user
presence provider's information to be both read and written via the dialplan and AMI.
Write Syntax
PRESENCE_STATE(<presence state provider>)=value[,subtype[,message[,options]]]
Valid State Values
"unavailable"
"available"
"away"
"xa"
"chat"
"dnd"