Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 546
 
4-33
Cisco ICM Software CTI OS Developer’s Guide Release 6.0(0)
 
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
You use Monitor mode to receive all events that CTI OS Server publishes, or a 
specified subset of those events. You may receive events for calls, multiple agents, 
or statistics. The session receives specific events based on the event filter used 
when setting the session to Monitor mode.
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 CTIOS server at the same time, such as in a 
fail-over scenario, may cause significant performance degradation on CTI OS 
Server. You should therefore minimize the number of Monitor mode 
applications connecting to CTI OS Server.