Parsing Lync-published category instances

Applies to: Lync 2013 | Lync Server 2013

The following table shows how to parse some of the presence category instances that are published by Microsoft Lync 2013.


Category name

Presence data

Description

calendarData category instance value element

freeBusy information

Lync 2013 describes the contiguous block of free and busy time slots according to the user’s calendar.

This block of free-busy time slots is described by a Base64 encoded string of a stream of binary bits.

Every 2 bits represent the smallest unit of time (or the smallest time slot).

Four types of distinct time slots are used. Each represents a time when the user is free, tentative busy, busy, or out of office (OOF).

The corresponding binary bits are 00, 01, 10, and 11, respectively.

Thus, if the time slot is 15 minutes, a contiguous one-hour block of 30 minutes free and 30 minutes busy is described by a stream of binary bits of 00001010.

The corresponding Base64 encoded string value is "Cg==".

The following is an example of a calendar data containing a freeBusy block.

<calendarData xmlns="http://schemas.microsoft.com/2006/09/sip/calendarData"
              mailboxID="johnD@exchange.contoso.com">
   <freeBusy startTime="2009-11-18T08:00:00Z" 
             granularity="PT15M" encodingVersion="1">AAAAAAAAAAAAAAAAAAAAVQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVQoAqqoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
   </freeBusy>
</calendarData>

In this example, the length of the smallest time slot is 15 minutes that is specified by the granularity attribute PT15M value, where PT stands for Pacific Time.

The user is identified by the mailboxID attribute johnD@exchange.contoso.com value.

The free-busy block starts at midnight of the US Pacific time on November 18, 2009, which is specified by the startTime attribute.

Once properly decoded, the length of the entire free-busy block is 96 hours, which can be determined by counting the number of bytes in the Base64 encoded string.

state[@type='aggregateState'] element

Availability

Lync 2013 interprets the received availability number as follows.

Availability number range

Availability mode

Description

0-2999

Undefined

The contact is not found in the network.

3000-4499

Available

The contact is willing and able to communicate.

4500-5999

Available - Idle

The contact is willing but may be unable to communicate.

6000-7499

Busy

The contact is able but may be unwilling to communicate.

7500-8999

Busy - Idle

The contact is able but may be unwilling to communicate.

9000-11999

Do Not Disturb

The contact is able but unwilling to communicate.

12000-14999

Be Right Back

The contact is willing but unable to communicate.

15000-17999

Away

The contact is unable to communicate.

18000 and higher

Offline

The contact is not connected to the network.

Standard Activities

Lync 2013 interprets the received activity tokens as the following standard activity strings, if the activity element is not specified in a received aggregateState instance.

Standard activity token

Standard activity string

in-a-meeting

In a meeting

In-a-conference

In a conference

on-the-phone

In a call

out-of-office

Out of office

Urgent-interruptions-only

Urgent interruptions only

NOTE: Activity tokens are case-sensitive.

Default Activity Strings

Lync 2013 maps the availability modes to the following default activity strings, if no activity is specified in the received aggregateState instance.

Availability number

Default activity string

0-2999

Presence unknown

3000-4499

Available

4500-5999

Inactive

6000-7499

Busy

7500-8999

Busy

9000-11999

Do not disturb

12000-14999

Be right back

15000-17999

Away

18000 or higher

Offline

Unspecified

Offline

Activity string display

Lync 2013 uses the following logic to display a contact’s activity string:

  • For a blocked contact, the activity string of "Blocked" is displayed.

  • If a standard activity token is specified, the corresponding standard activity string is displayed.

  • If a standard activity token is not specified but an activity string is specified, the specified activity string is displayed.

  • If a standard activity token is not specified and no activity strings are specified, the default activity string corresponding to the specified availability number is displayed.

Capabilities Summary String

Lync 2013 displays the following capabilities summary string to supplement an activity string.

Capabilities summary string

Description

No IM

This is displayed when the availability of the most active device supporting an instant messaging capability is Offline and the aggregated availability is not Offline.

Voice Only

This is displayed when the availability of the most active device supporting an instant messaging capability is Offline and the aggregated availability is no less active than Inactive.

Mobile

This is displayed if the only active endpoint is a mobile device.

lastActive attribute

For an inactive mode of Available – Idle, Busy – Idle, Be Right Back, Away, or Offline, Lync 2013 displays the time period in which an aggregated state has remained inactive since the last active mode of Available, Busy, or Do Not Disturb. This inactive time period is appended to an inactive state as "Inactive for 5 mins", "Away for 5 hours" or "Offline for 20 mins". The following example shows how this scenario is computed. lastActiveTime has the value of the lastActive attribute of an appropriate aggregated state.

`inactiveTimePeriod = currentTime - lastActiveTime`

Location

The subscriber receives a computed location that is determined in the following manner:

When the aggregated availability number is less than 12000 and the most active computer (with the lowest availability number) has its location specified (in the state/endpointLocation element element), this location information will be included in the state[@type='aggregateState'] element instance.

NOTE: The received location information indicates a place either set by the publisher or provided by the Microsoft Lync Server 2013 Location Information Service. The location information that the publisher wants the remote watchers to see is present. It's not necessarily the location where the user is actually located.

See also