Lync 2013 Explained: Understanding Presence Flow

User presence is key feature of any unified communication solution today. Based user presence that we see in the client software we known if the user we are trying to reach is Available, Busy or Out of the Office even without asking someone.

What is Presence?

 Presence expresses the availability and willingness of a user to join a conversation by using a SIP client such as Microsoft Lync 2010 or Lync 2013. There are two main activities involved in presence:

  • Presence Publication
  • Presence Subscription

Let look at each of the two activity in detail. For illustration we shall use two Lync user Luser1 and Luser2 both enabled for sip domain @contoso.com

Presence Subscription

Presence subscription is an operation that lets the Lync client know which users that you are interested in seeing refreshed presence information from and what aspect of their enhanced presence you are interested in. When the Lync client creates a presence subscription for a set of users and a set of enhanced presence information, it sends this request or subscription to Lync server. Then the Lync server responds back with the latest information about the user in response back to the Lync client. Presence subscription happens when one user is trying get the update presence information of another user.

Figure 1 : Presence subscription

In the snooper trace this what it would look like

  

Presence Publication

The question here is how the Lync server does some to know of a user’s presence?  Presence publication is the publishing of user local presence information using the Lync Client after the user signs in for the use of other users who have subscribed to this presence. Your application can set the presence of the local signed-in user to such availability as available, busy, do not disturb, be right back, off work, or appear away. Presence publication happens when one user is trying update its own presence information to another user.

Figure 2 Presence publication

In the snooper trace this what it would look like

 

Presence Polling

Lync Client manage contact lists for users requires persistent subscriptions to receive the most current presence state of their contacts. For this reason polling for presence is required at regular intervals. Polling is performing Presence subscription at regular interval. In a polling subscription, the Lync client periodically queries the Lync server to obtain the data. The difference between a subscription and a query lies in the fact that the subscription is tied to a period of time whereas the presence query is one-time only. The difference between a persistent subscription and a polling subscription lies in the fact that a SIP dialog is involved in a persistent subscription whereas it is not in a polling subscription.

For a polling subscription, the Lync Server client repeats the process at a given time interval. For a persistent subscription, the Lync Server pushes the publication down to the subscribers by sending them a NOTIFY or BENOTIFY request containing the presence data is created, modified, or removed. For the NOTIFY request, the server expects the client to respond with SIP response. For the BENOTIFY request, a client response is not needed. The process continues until the subscription is terminated, at the request of the subscribing client or when the subscribing user logs off.

User Presence Change

When user Luser2 changes his or her presence. The Lync Client for user Luser2 send out Presence publication to the Lync server. Lync serve send out Notify or Benotify request all users who have Luser2 added as a contact for presence update.

 

Figure 3 User Presence Change

In the snooper trace this what it would look like

Summary

Presence subscription is activity done by the Lync user who wants updated presence of another user. Presence Publication is an activity done by Lync user to update  own presence to the other users. Presence polling is activity of keeping every user presence updated to another user in the Lync environment at regular interval.