OsStatus CpPhoneMediaInterface::deleteConnection(int connectionId) { OsStatus returnCode = OS_NOT_FOUND; CpPhoneMediaConnection* mediaConnection = getMediaConnection(connectionId); returnCode = doDeleteConnection(mediaConnection); return(returnCode); }
OsStatus CpPhoneMediaInterface::deleteConnection(int connectionId) { OsStatus returnCode = OS_NOT_FOUND; CpPhoneMediaConnection* mediaConnection = getMediaConnection(connectionId); UtlInt matchConnectionId(connectionId); mMediaConnections.remove(&matchConnectionId) ; returnCode = doDeleteConnection(mediaConnection); delete mediaConnection ; return(returnCode); }
// Destructor CpPhoneMediaInterface::~CpPhoneMediaInterface() { OsSysLog::add(FAC_CP, PRI_DEBUG, "CpPhoneMediaInterface::~CpPhoneMediaInterface deleting the CpMediaInterface %p", this); CpPhoneMediaConnection* mediaConnection = NULL; while ((mediaConnection = (CpPhoneMediaConnection*) mMediaConnections.get())) { doDeleteConnection(mediaConnection); delete mediaConnection; mediaConnection = NULL; } if(mpFlowGraph) { // Free up the resources used by tone generation ASAP stopTone(); // Stop the net in/out stuff before the sockets are deleted //mpMediaFlowGraph->stopReceiveRtp(); //mpMediaFlowGraph->stopSendRtp(); MpMediaTask* mediaTask = MpMediaTask::getMediaTask(0); // take focus away from the flow graph if it is focus if(mpFlowGraph == (MpCallFlowGraph*) mediaTask->getFocus()) { mediaTask->setFocus(NULL); } OsSysLog::add(FAC_CP, PRI_DEBUG, "CpPhoneMediaInterface::~CpPhoneMediaInterface deleting the MpCallFlowGraph %p", mpFlowGraph); delete mpFlowGraph; mpFlowGraph = NULL; } }