This article describes the way how to enable and alter the device presence feature based on the RFCs 3265 – 3865 -3863 -4480. The feature leverages the built-in XML definitions capability of our D-series phones.
The only prerequisite is that the phone has firmware version 10.1.90.0 or higher.
Presence works on two fronts, like a normal BLF. The first one is the phone which has to send a SIP message indicating its status to the PBX. The second one is the monitoring phone which receives a SIP message from the PBX containing the status of the monitored phone. The difference is that the messages will not be of type DIALOG, but PRESENCE.
The following code works exclusively for Identity 1 (change the value of <identity value="1"/> to change the identity number). For more informations about XML definitions please check these pages: XML Definitions, XML Definitions Tutorial, XML Definitions Syntax
With this code the phone automatically check its own status and, when the status change (when="on change"), sends a PUBLISH type SIP message including the information in the message body XML code. The possible statuses are:
Offline
Available
In_A_Call
Forwarded
Dnd_All
This is an example of a PUBLISH message sent when the phone change from Available to In_A_Call. As you can see in the body, the phone built the XML code to inser <note>On the phone</note>. This information will be read from the PBX and translated into a NOTIFY message for the monitoring phones.
Sent to Udp:xxx from Udp:192.168.1.85:5060 at Jun 15 11:09:39.163 (1224 bytes):
On the monitoring phone we need a new type of key, able to process the incoming presence NOTIFY and to reach this result we will use the ReplacementPlan tag and specifically the <key> tag that defines a key-type that will get listed in fkey-WUI-page as type for a line-key https://docs.snom.com/display/wiki/%3CReplacementPlan%3E+tag
After provisioning the Snom phone with the following code, we will see a new type of key in the fkey drop-down menu, called PresenceBLF. In the Number field we will inser the monitored extension and the phone will send a Presence type SUBSCRIBE for that extension.
Press the key to call the extension and call pickup are also possible.
Note: the pickup code is hard coded into the XML, you can change the code here: <variable name="pickup_code" value="*8"/>
Thanks to the <NotifyParsingRules type="state"> section, the phone fetch the incoming NOTIFY message looking for a state at a predetermined point in the body of the message. The search is systematic from the first level to the last and when a rule is matched, the following ones are not considered.
The following is a NOFITY body example that match the level4 rule: