Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 500
   
4-24
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 4      Building Your Application
Connecting to the CTI OS Server
The following example, which assumes the Session object has been created and connected to the CTI 
OS Server, demonstrates this task in 
Java:
void OnConnection(Arguments rArgs) {
   /* 1. Create and agent and set the required properties. */
   Agent agent = new Agent();
   agent.SetValue(CtiOs_IKeywordIDs.CTIOS_AGENTID, "275");
   agent.SetValue(CtiOs_IKeywordIDs.CTIOS_PERIPHERALID, "5002");
   /* 2. Set the session's agent */
   int returnValue = session.SetAgent(agent);
}
When successful, the SetAgent() method generates the following events:
  •
OnQueryAgentStateConf()
  •
OnSetAgentModeConf()
  •
OnSnapshotDeviceConf(), if the agent is already logged in
  •
OnSnapshotCallConf(), if there is a call and the agent is already logged in
  •
OnCTIOSFailureEvent() 
When to Use Monitor Mode
Applications that need to receive all events that CTI OS Server publishes, or a specified subset of those 
events should use Monitor Mode. Monitor mode applications may receive events for calls, multiple 
agents, or statistics. The session receives specific events based on the event filter specified when setting 
the session to Monitor mode.
Caution
Monitor mode, as the name implies, is intended for use in applications that passively listen to CTIOS 
server events. Monitor mode is not intended for use in applications that actively control the state of calls 
or agents. Such applications include but are not limited to the following:
 
- Applications that log in agents and change their state
 
- Applications that make or receive calls and change their state
 
- Applications that silent monitor agents
Caution
When a Monitor mode session is initialized, the CTI OS Server performs a CPU intensive sequence 
of operations to provide the application with a snapshot of the state of the system. A large number of 
monitor-mode applications connecting to CTI OS server at the same time, such as in a fail-over 
scenario, may cause significant performance degradation on CTI OS Server. Therefore, minimize the 
number of Monitor mode applications connecting to CTI OS Server to two (2).
Warning
Note that the button enablement feature can only be used in agent mode sessions and are not intended 
for monitor mode applications.