Walkthrough: Use the generic listener adapter for CTI event routing
This walkthrough demonstrates how you can use the CTI Desktop Manager and generic listener in Unified Service Desk to expose the CTI events as screen pops in Unified Service Desk. For this walkthrough, we will use a sample CTI Simulator application that sends CTI requests to Unified Service Desk.
In this walkthrough, you’ll:
Search for a contact record in the sample Microsoft Dynamics CRM data based on an email address specified in the sample CTI Call Tester application.
Create a window navigation rule to display the matching record in a session in Unified Service Desk.
In This Topic
Step 1: Configure a CTI Desktop Manager hosted control in Unified Service Desk
Step 2: Test if the CTI events are raised in Unified Service Desk
Step 3: Define a window navigation rule to route the CtiLookUpRequest
Test your CTI adapter
Prerequisites
Microsoft .NET Framework 4.5.2
Unified Service Desk client application; required for testing the hosted control.
Microsoft Visual Studio 2012 or Visual Studio 2013
Download the sample CTI Simulator Application Visual Studio project to your computer. Build the project, and run the application (.exe file) from the bin\debug folder of the sample application project. You must run the USD CTI Simulator application on the same computer where Unified Service Desk client is running to test the application.
Step 1: Configure a CTI Desktop Manager hosted control in Unified Service Desk
Sign in to Microsoft Dynamics CRM.
On the nav bar, choose Microsoft Dynamics CRM > Settings > Unified Service Desk.
On the Unified Service Desk page, choose Hosted Controls.
On the Hosted Controls page, choose New.
On the New Hosted Control page, specify the following values.
Field Value Name
CTITest
USD Component Type
CTI Desktop Manager
Display Group
HiddenPanel
Assembly URI
Microsoft.Crm.UnifiedServiceDesk.GenericListener
Assembly Type
Microsoft.Crm.UnifiedServiceDesk.GenericListener.DesktopManager
Note
The values specified in the Assembly URI and Assembly Type fields are the generic listener values for the CTI Desktop Manager hosted control type.
Click Save to create the hosted control.
Step 2: Test if the CTI events are raised in Unified Service Desk
Start Unified Service Desk client, and connect to your CRM instance. After the client is up, choose Settings in the top-right corner to display the debugger control, and then choose Clear Debug Output to clear the desktop.
Start the USD CTI Simulator application, type Email in the Key column and specify a random value in the Value column. Click Send to USD.
A screen pop-up occurs in the client application to expose the CTI event. In this case, a CTILookUpRequest is initiated with the value that was specified in the USD CTI Simulator application. Because you haven’t wired it yet with a window navigation rule, nothing further happens.
Step 3: Define a window navigation rule to route the CtiLookUpRequest
Create a window navigation rule to create a session if a match is found, and then display the matching contact record in a session in Unified Service Desk
Sign in to Microsoft Dynamics CRM.
Navigate to the advanced find for contacts, and create a query where you search for active contacts where the email, email address 2, or email address 3 field equals a certain value, for example, someone_c@example.com.
Click Download Fetch XML to save the query as FetchXML.
On the nav bar, choose Microsoft Dynamics CRM > Settings > Unified Service Desk > Window Navigation Rules.
Click New, and on the New Window Navigation Rule window, specify the following values.
Field Value Name
CTITestRoute
Order
50
From
CTITest
Note
This is the name of your CTI Desktop Manager hosted control.
Direction
Both
Save the rule. This enables the rest of the controls on the page.
Now, add the FetchXML query that was saved earlier to this rule. Under the CTI Searches area, choose Add .
In the New CTI Search window, specify the following values.
Field Value Name
CTIContactSearch
Order
1
FetchXML
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="contact"> <attribute name="fullname" /> <attribute name="parentcustomerid" /> <attribute name="telephone1" /> <attribute name="emailaddress1" /> <attribute name="contactid" /> <order attribute="fullname" descending="false" /> <filter type="and"> <condition attribute="statecode" operator="eq" value="0" /> <filter type="or"> <condition attribute="emailaddress1" operator="eq" value="[[cti.Email]]" /> <condition attribute="emailaddress2" operator="eq" value="[[cti.Email]]" /> <condition attribute="emailaddress3" operator="eq" value="[[cti.Email]]" /> </filter> </filter> </entity> </fetch>
Note
The address someone_c@example.com was replaced with
[[cti.Email]]
so that the search is run based on the value specified for the Email key in the Unified Service Desk CTI Simulator application.Save the CTI search rule, and return to the window navigation rule.
Under Single Match, in the Decision field, select Create Session, Load Match then Do Action.
Under Single Match, in the Action field, click the search icon to select a value, and then click New.
On the New Action Call page, create an action call to open the contact record by specifying the following values.
Field Value Name
CTIOpenContact
Hosted Control
CRM Global Manager
Action
Open_CRM_Page
Data
Id=[[$Context.Id]]
LogicalName=[[$Context.LogicalName]]Save the action call, and then close the action call page to return to the window navigation rule definition page.
Under the Result area:
In the Destination field, choose Tab to display the matching contact record in a tab.
In the Target Tab field, choose the Contact hosted control. The Contact hosted control was created when you deployed a sample Unified Service Desk application on your CRM server using the Package Deployer tool. For more information, see TechNet: Deploy sample Unified Service Desk applications to CRM server using Package Deployer.
In the Show Tab field, choose the Contact hosted control
Save the window navigation rule.
Test your CTI adapter
Start Unified Service Desk client, and connect to your CRM instance. After the client is up, choose Settings in the top-right corner to display the debugger control, and then choose Clear Debug Output to clear the desktop.
Start the USD CTI Simulator application, type Email in the Key column and specify a valid email ID for the contact that you want to search. In this case, type someone_d@example.com in the Value column. Click Send To USD.
The matching contact record is displayed in a session in Unified Service Desk.
Check the Debugger hosted control to view the events that got raised as a result of the CTI search. Also check out the Data Parameters tab to view the context information in the $Context variable and CTI information under the CTI variable.
See Also
Concepts
UII computer telephony integration (CTI) framework
Other Resources
Integrate with CTI systems using CTI adapters
Unified Service Desk
Send comments about this topic to Microsoft.
© 2015 Microsoft. All rights reserved.