Tuesday, February 1, 2011

Adding Custom Presence to Lync

Office Communicator has supported the customization of up to 4 additional presence states for some times, and there are many articles all over the Internet on this topic.  But I have not yet seen one specifically for Lync, so here is a brief overview. 

Basically the same configuration steps are used as what Office Communicator 2007 R2 required, since a change to the default security behavior was added after the 2007 (R1) client which prevented the use of non HTTPS connections to the configuration file.

  1. Create a new XML file on the local workstation and customize the presence states and descriptions.
  2. Disable SIP High Security Mode within Lync.
  3. Enable Custom Presence States within Lync.

So if you already know how to do this in the OCS R2 client, then follow the same steps.  For those of you new to the Communications Server products then here is a step-by-step walkthrough specifically for Lync.

Configuration File

The custom configuration information is stored in an XML file that must be manually created first.  Unique entries can be created with a few limitations: a maximum of 4 states and a limit of 64 characters in the description text.  This file can be accessed by the Lync client using either direct access to the file (via local disk or shared directory on a remote server) or as a web client using HTTP or HTTPS.

The aforementioned change between OC 2007 and 2007 R2 is the default behavior is now to force a secure connection to the XML file, limiting the option to only accessing the file via HTTPS.  This is fine when you want the same custom states to be available for multiple users across all workstations, but for simply adding the additional states to a single primary workstation for yourself using a local file is the best approach.

Because Lync follows the same default behavior of forcing HTTPS then in order to use a local XML file this behavior will need to be disabled, which will be addressed in the next section.  For now the following steps should be performed to create the configuration file and store it on the local workstation.

  • Copy the following text and save into a new text file named presence.xml saved somewhere on the local workstation. (e.g. c:\Windows\presence.xml).  (This file can be saved anywhere as long as file security settings allow read access to it.  Commonly it can be stored in either the client installation directory or user's documents folder.  I simply prefer to drop stuff in the system directory and the path is simple and does not include spaces which often require encapsulating paths within quotes.)

<customStates>
  <customState ID="1" availability="Busy">
    <activity LCID="1033">Urgent Interruptions Only</activity>
  </customState>
  <customState ID="2" availability="Busy">
    <activity LCID="1033">Customer Demo</activity>
  </customState>
  <customState ID="3" availability="Busy">
    <activity LCID="1033">In a Video Call</activity>
  </customState>
  <customState ID="4" availability="Busy">
    <activity LCID="1033">In Training Session</activity>
  </customState>
</customStates>

  • Within the presence.xml file edit the availability values and description text to customize each of the 4 custom states to the desired information.  The availability values are limited to the following strings: Online, Busy, and Do-Not-Disturb.  The activity string text is limited to a maximum of 64 characters.

Registry Settings

To trigger the Lync client to import and use the custom state information two settings will need to be set within the local  workstation's registry.  The first is to allow a local file to be read and removed the HTTPS requirement while the second settings tell Lync where to find the presence configuration file.

  • Create a new REG_DWORD value named EnableSIPHighSecurityMode in the Communicator Software Policies key shown below.  Enter the value of '0' to disable this security mode.

Path: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Communicator
Name: EnableSIPHighSecurityMode
Value: 0

  • Create a new REG_SZ value named CustomStateURL in the same key as shown below.  Enter the absolute path to the presence.xml file using the file:/// URL format.

Path: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Communicator
Name: CustomStateURL
Value: file:///C:/Windows/presence.xml

image

Restart Lync

  • Exit and restart the Lync client to pick up the configuration changes and then pull down the status menu to locate the new choices.

image

1 comment:

  1. hi jeff,

    does still work today?
    i am trying to follow this and it seems that it does not work...
    can you assist?

    ReplyDelete