This document was generated from CDN thread
Created by: Virinchi Garimella on 12-06-2009 10:58:50 AM
Hi,
When I am diconnecting from CTIOS Server with release build I am getting some debug error saying that pure virtual function and damage after client bloack.
This is the code I am using from developer guide.
I am allocating the eventsink with
m_ctiSession.AddAllInOneEventListener((IAllInOne *) m_pEventSink);
std::string filterExpression = "MessageID=*";
m_ctiSession.SetMessageFilter(filterExpression);
//Disconnect from serevr.
if(m_pEventSink)
{
Arguments & argsWaitParams = Arguments::CreateInstance();
CWaitObject *pWaitCall = m_ctiSession.CreateWaitObject(argsWaitParams);
argsWaitParams.AddItem("Event1", eOnConnectionClosed);
pWaitCall->SetMask(argsWaitParams);
// 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))
{
argsWaitParams.Release();
return TRUE;
}
pDisconnectArgs->AddItem(CTIOS_FORCEDDISCONNECT,true);
m_ctiSession.Disconnect(*pDisconnectArgs);
pDisconnectArgs->Release();
}
else
{
// Perform disconnect
m_ctiSession.Disconnect();
}
// Wait for OnConnectionClosed
pWaitCall->WaitOnMultipleEvents(1000);
// free objects
m_ctiSession.DestroyWaitObject(pWaitCall);
argsWaitParams.Release();
}
// Tell session object to remove our event sink
m_ctiSession.RemoveAllInOneEventListener((IAllInOne *) m_pEventSink);
}
Is there any problem in this code. Can you please help me on this.