Cisco Cisco Computer Telephony Integration Option 8.5 Guía Del Desarrollador

Descargar
Página de 640
 
4-43
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.0(0)
 
Chapter 4      Building Your Application
Logging In and Logging Out an Agent
The following example, which assumes the Agent object has been created, 
demonstrates this task in Java:
public void SetAgentMode(Arguments rArgs) {
 /* 1. Create Arguments object*/
 Arguments rArgs = new Arguments();
 /* 2. Set log in values.*/
 rArgs.SetValue(CtiOs_IKeywordIDs.CTIOS_AGENTID, “275”);
 rArgs.SetValue(CtiOs_IKeywordIDs.CTIOS_PERIPHERALID, “5002”);
 rArgs.SetValue(CtiOs_IKeywordIDs.CTIOS_AGENTINSTRUMENT, “5002”)
 rArgs.SetValue(CtiOs_IKeywordIDs.CTIOS_AGENTPASSWORD, “********”);
 rArgs.SetValue(CtiOs_IKeywordIDs.CTIOS_AUTOLOGIN, “1”);
 /* 3. Log in the agent.*/
 int returnValue = agent.Login(rArgs);
}
Note
It is the client application’s responsibility to keep track of whether the log in 
attempt is the first attempt, or during failover, and branch accordingly in the 
SetAgentMode() event to avoid calling the Login() method during failover.
The Login() method generates the following events:
  •
QueryAgentStateConf()
  •
AgentStateEvent(), if the agent is unknown or is logged out.
Note
The client application receiving the these events must check both the 
ENABLE_LOGOUT and ENABLE_LOGOUT_WITH_REASON bitmasks. 
For more information, see 
When not successful, the Login() method generates the eControlFailureConf() 
event.