Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 546
 
Chapter 4      Building Your Application
Connecting to the CTI OS Server
4-36
Cisco ICM Software CTI OS Developer’s Guide Release 6.0(0)
How to Select Monitor Mode
To select Monitor mode for the connection:
Step 1
Specify the filter String. See the previous section for filter details.
Step 2
Create an Arguments instance and add an item with 
CtiOs_IKeywordIDs.CTIOS_FILTER as the keyword and the filter String as the 
value.
Step 3
Use the CtiOsSession.SetMessageFilterArgs(args) method to select Monitor 
mode and to set the event filter.
Note
You should always include the OnCtiOsFaliure() event in the message 
filter, so that the application can detect when a system component is 
comes on- or offline.
Caution
A Monitor Mode application that monitors any Call-related events must also 
monitor the OnCallEnd() event, as described on page 4-51.
The following example, which assumes the Session object has been created, 
demonstrates this task in Java:
/* 1. Constructing message filter string /
String filter = "messageid=" + eAgentStateEvent + "," + 
eAgentInfoEvent + “,” + eCTIOSFailureEvent;
/* 2. Create the Arguments object*/
Arguments rArgs = new Arguments();
/* 3. Add the filter to the Arguments instance.*/
rArgs.SetValue(CtiOs_IKeywordIDs.CTIOS_FILTER, filter);
/* 3. Set the message filter.*/
int returnValue = session.SetMessageFilter(rArgs);
When successful, the SetMessageFilter() method generates the following events:
With IPCC only, OnQueryAgentStateConf() for each team and each agent 
logged in