Creating Call Center Applications with Unified Communications SDKs: Agent Application (Part 3 of 4)
Summary: Learn how to use Unified Communications SDKs to implement speech synthesis, speech recognition, and call control technologies to create a simple call center application.
Applies to: Microsoft Unified Communications Managed API (UCMA) 3.0 Core SDK or Microsoft Unified Communications Managed API 4.0 SDK | Microsoft Lync 2010 SDK | Microsoft Speech Platform SDK version (x64) 10.2
Published: April 2012 | Provided by: John Clarkson and Mark Parker, Microsoft | About the Author
Contents
Additional Resources
This is the third in a series of four articles about how to create a call center application.
Creating Call Center Applications with Unified Communications SDKs: Introduction (Part 1 of 4)
Creating Call Center Applications with Unified Communications SDKs: Bot Application (Part 2 of 4)
Creating Call Center Applications with Unified Communications SDKs: Code Listing (Part 4 of 4)
Agent Application Prerequisites
Microsoft Silverlight 4 SDK.
Microsoft Silverlight 4 Tools for Visual Studio 2010.
Microsoft Lync 2010 SDK.
On each computer that is running the deployed Microsoft Silverlight application:
Add the web server that is hosting the Silverlight application to the trusted sites list.
Sign in to the Microsoft Lync 2010 client.
Using the XAML Page to Create a Silverlight UI
Figure 1. XAML page and Silverlight controls
The following XAML creates three labeled text boxes and a button. The button is attached to a Click event handler on the code-behind.
<Grid x:Name="LayoutRoot">
<TextBox Height="23" HorizontalAlignment="Left" Margin="21,74,0,0" Name=" textBoxCustomerID" VerticalAlignment="Top" Width="120" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="21,128,0,0" Name=" textBoxCustomerName" VerticalAlignment="Top" Width="120" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="21,179,0,0" Name=" textBoxCustomerBalance" VerticalAlignment="Top" Width="120" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="173,78,0,0" Name="textBlock1" Text="ID" VerticalAlignment="Top" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="173,132,0,0" Name="textBlock2" Text="Name" VerticalAlignment="Top" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="173,179,0,0" Name="textBlock3" Text="Balance" VerticalAlignment="Top" />
<Button Click="GetUserInfo_Click" Content="GetUserInfo" Height="23" HorizontalAlignment="Left" Margin="21,33,0,0" Name="button1" VerticalAlignment="Top" Width="75" />
</Grid>
Using the Code-Behind to Display the Contextual Data
Get the Conversation object.
Note
The GetHostingConversation() method is available only in Silverlight applications.
Conversation conversation = (Conversation)Microsoft.Lync.Model.LyncClient.GetHostingConversation();
Use the GetApplicationData method to get the initial context data. For more information about the methods that you can use to get contextual data, see Working With Lync 2010 Contextual Data Methods and Events.
string text = conversation.GetApplicationData(appId);
Parse the data into a string array. The three fields are semi-colon delimited.
char[] delimiter = { ';' }; string[] custData = text.Split(delimiter); //Display the contents of array elements in the textboxes. textBoxCustomerID.Text = custData[0]; textBoxCustomerName.Text = custData[1]; textBoxCustomerBalance.Text = custData[2];
Registering the Application
Create a GUID for the application, and create a registry entry using this GUID as the key. For information about how to create a GUID for the application, see Create GUID (guidgen.exe).
To identify the conversation, the applications at each end of the conversation (in this case the bot application and the agent application) must reference the same GUID. See the following sample registry entry for the bot application. For more information, see Application Registration for Lync 2010 Contextual Applications.
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Communicator\ContextPackages\{your application GUID}]
"InternalURL"="path to the Silverlight test page .html"
"Name"="CallCenterDemo"
Additional Resources
For more information, see the following resources:
Sample code: Creating Call Center Application with UCMA 3.0 Core SDK and Lync 2010
SDK download: Microsoft Unified Communications Managed API 3.0 Software Development Kit
About the Author
Mark Parker is a programming writer at Microsoft Corporation. His principal responsibility is the UCMA SDK documentation.
John Clarkson is also a programming writer on the Microsoft Lync feature team.