Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 668
 
4-43
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.1(1)
 
Chapter 4      Building Your Application
Logging In and Logging Out an Agent
// Perform disconnect
if(m_ctiSession->GetValueInt(CTIOS_CONNECTIONMODE) == 
eSessionModeNotSet )
{  // If the session mode has not yet been set by SetAgent or
                           // SetSessionMode at the time of the 
disconnect.
   // we need to indicate the session that a disconnect needs 
to
   
   // be forced
   bool    bAllocOk = true;
   Arguments * pDisconnectArgs = NULL;
   bAllocOk = Arguments::CreateInstance(&pDisconnectArgs);
   
   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 CTIOS Server is established and the mode set, you 
log in the agent. 
Note
Before attempting to log in an agent, you would typically request global 
configuration data, in order to correctly handle a duplicate log in attempt. For 
more information, see the section