Use Microsoft Lync 2010 SDK and Microsoft Lync 2010 to participate in a Microsoft Unified Communications Managed API (UCMA) 3.0 conference.

Joining the Conversation

UCMA 3.0 can activate the Microsoft Lync 2010 Conversation window by sending a SIP invite. The SIP invite must contain a custom XML block containing the information described in the following table and the XML sample. The only software requirement on the client is that Lync 2010 must be installed.

For example, Contoso Corporation operates a contact center application, which routes incoming calls based on agent availability, skills and other attributes. On receiving a call, the application chooses an available agent and sends an instant messaging request. When the agent accepts the call, UCMA 3.0 escalates the agent to a conference with the caller, sends a SIP request and Lync 2010 opens the Conversation window.

The following table lists the data elements in the XML block. All elements except for the application ID appear in a name/value property list, as shown in the sample following the table.

Data Element

Description

Application-id

The application GUID, wrapped in curly braces.

Data

Application Data (limit 2,000 characters). Must be base 64 encoded.

SimpleLink

Shows a hyperlink in the conversation history

Name

Application Name (limit 50 characters)

InstallLink

A link to where the application can be installed (used only when the app is not installed)

See the following XML sample.

  Copy imageCopy Code
<session>
<application-id>{40499119-4B60-45A6-9A7A-DC7A384D5670}</application-id>
<additional-properties>
<entry><name>data</name><value>23423</value></entry>
<entry><name>simpleLink</name><value>http://www.microsoft.com/en/us/default.aspx</value></entry>
<entry><name>name</name><value>Contoso
Corporate Performance Management</value></entry>
<entry><name>installLink</name><value>www.Contoso.com/Download</value></entry>
</additional-properties>
</session>

Lync 2010 gets the application invite from UCMA 3.0, sets up the conversation window and opens the extensibility window with a third party Microsoft Silverlight application containing information about the caller. Once the SIP conversation is established the conversation window is shown, and UCMA 3.0 and Lync 2010 can exchange data over the channel both ways.

Sending and Updating Context

Use Conversation object methods to send and update context once the conversation is launched. See the following sample code. For more information, see the topic Send and Update Context in an Existing Conversation .

  Copy imageCopy Code
public void Process()
{
  bool succeeded = false;
  Exception exception = null;
  try
  {
	this.Conversation.BeginSendContextData(yourApplicationId,
yourWireHelpers.Request, yourWireHelpers.Serialize(_request),
this.RequestCompleted, null);
	succeeded = true;
  }
  catch (Exception ex)
  {
	exception = ex;
  }
  finally
  {
	if (!succeeded)
	{
	if (exception == null)
	{
		exception = new Exception("Request failed with unhandled
exception.");
}
	this.Complete(exception, true);
}
  }
}

private void RequestCompleted(IAsyncResult result)
{
  bool succeeded = false;
  Exception exception = null;
  try
  {
	this.Conversation.EndSendContextData(result);
	succeeded = true;
  }
  catch (Exception ex)
  {
	exception = ex;
  }
  finally
  {
	if (!succeeded)
	{
	if (exception == null)
	{
		exception = new Exception("Request failed with unhandled
exception.");
}
	this.Complete(exception, false);
}
  }
}

See Also

Other Resources