Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 640
 
4-49
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
How to Handle Duplicate Log In Attempts in the Desktop Application
If you detect from the OnQueryAgentStateConf() event that the agent is already 
logged in as described in the previous section, do the following:
  •
If your custom_WarnIfAgentLoggedIn = 1 and 
custom_RejectIfAgentLoggedIn = 0, notify the user that the agent is already 
logged in and proceed with Login() depending on the user’s response.
  •
If your custom_RejectIfAgentLoggedIn = 1, notify the user that the agent is 
already logged in and Disconnect.
How to Log Out an Agent
To log out an agent:
Step 1
Create an instance of the Arguments class.
Step 2
Set log out values for the agent in the Arguments instance.
Note
IPCC requires a reason code to log out. Other switches may have 
different requirements.
Step 3
Log out the agent.
The following example demonstrates this task in Java:
/* 1. Create Arguments object*/
Arguments rArgs = new Arguments();
/* 2. Set log out values.*/
rArgs.SetValue(CTIOS_EVENTREASONCODE, 1);
/* 3. Log out the agent.*/
int returnValue = agent.Logout(rArgs);