Cisco Cisco Computer Telephony Integration OS 8.5 开发者指南
Chapter 4 Building Your Application
Logging In and Logging Out an Agent
4-52
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.1(1)
if (nAgentState == eLogout)
{
int nReasonCode = 0;
if ( rArguments.GetValueInt(CTIOS_EVENTREASONCODE,
&nReasonCode) )
{
if (CTIOS_IPCC_FORCED_LOGOUT_REASON_CODE ==
(unsigned short)nReasonCode)
{
return;
}
}
}
}
//Disconnect otherwise
if( IsConnected() ) //if session is connected
{
if(m_ctiSession)
{
m_ctiSession->Disconnect();
}
}
}
3.
If you are not concerned with whether the agent is successfully logged out
prior to disconnect, issue a session Disconnect request without a Logout
request.
prior to disconnect, issue a session Disconnect request without a Logout
request.
4.
Additionally, you must wait for OnConnectionClosed before destroying
Agent and Session objects. This will guarantee that the CIL has completed
cleanup of the Session object prior to your calling Release on these objects.
Agent and Session objects. This will guarantee that the CIL has completed
cleanup of the Session object prior to your calling Release on these objects.
5.
Ensure that the agent object is set to NULL in the session before you Release
the session object. For example, whenever your application is exiting and you
are disconnecting the session object (e.g. when the user closes your
application's window) you should do something similar to the code below:
the session object. For example, whenever your application is exiting and you
are disconnecting the session object (e.g. when the user closes your
application's window) you should do something similar to the code below:
if (m_ctiSession)
{
m_ctiSession->Disconnect();
// stop all events for this session
int nRetVal =
m_pctiSession->RemoveAllInOneEventListener((IAllInOne *)
m_pmyEventSink);