Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 490
   
4-30
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Chapter 4      Building Your Application
Logging In and Logging Out an Agent
   if ((false==bAllocOk) || (pDisconnectArgs == NULL))
   {
   CDialog::OnClose();
   argsWaitParams.Release();
   return;
   }
   pDisconnectArgs->AddItem(CTIOS_FORCEDDISCONNECT,true);
   m_ctiSession->Disconnect(*pDisconnectArgs);
   pDisconnectArgs->Release();
}
else
{
  m_ctiSession->Disconnect();
}
Logging In and Logging Out an Agent
How to Log In an Agent
When the connection to the CTI OS Server is established and the mode set, you log in the agent. 
Note
Before attempting to log in an agent, you typically request global configuration data to correctly 
handle a duplicate log in attempt. For more information, see section 
To log in the agent, in the SetAgentModeEvent() event:
Step 1
Create an instance of the Arguments class.
Step 2
Set log in values for the agent in the Arguments instance.
Note
The properties required for the agent depend on the type of ACD you are using. The following 
example demonstrates the required properties for Unified CC.
Step 3
Log in the 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);
}