Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 508
   
4-27
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 8.0(1)
Chapter 4      Building Your Application
Connecting to the CTI OS Server
Note
You should always include the OnCtiOsFailure() event in the message filter, so that the 
application can detect when a system component is online or offline.
Caution
A Monitor Mode application that monitors any Call-related events must also monitor the 
OnCallEnd() event, as described on page 4-43.
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 Unified CC only, OnQueryAgentStateConf() for each team and each agent logged in
OnSnapshotDeviceConf() for each device
OnSnapshotCallConf
()
OnMonitorModeEstablished()
How to Deal with Failover In Monitor Mode
The CTI OS CIL does not support failover for Monitor mode. Agents in monitor mode cannot recover 
their state after a failover. Furthermore, after a failover, the CTI OS CIL may leak Call objects.
To deal with failover in Monitor mode:
Step 1
When the application detects a failover, for example, in a CTIOSFailure() event indicating a connection 
failure or an offline component, wait until the CIL has failed over and everything is back online and the 
CIL is connected to CTI OS.
The Monitor mode application is responsible for determining when all required servers are online. You 
can do this by monitoring OnCtiosFailure() events and keeping track of system status changes as they 
occur.
Step 2
Use the Disconnect() method to disconnect the session from CTI OS.
Step 3
Follow the steps starting at the beginning of the section 
 
to: 
a.
Create a session instance.
b.
Set the event listener.