diff --git a/src/audio/audiortp.cpp b/src/audio/audiortp.cpp index de36176f475538d9b1572ba896f0bde68d4b569e..3e82c75f50d572b9f51c56aeb15cc0857411b7fd 100644 --- a/src/audio/audiortp.cpp +++ b/src/audio/audiortp.cpp @@ -126,7 +126,6 @@ AudioRtpRTX::~AudioRtpRTX () { _debugException("! ARTP: Thread destructor didn't terminate correctly"); throw; } - //_debug("terminate audiortprtx ended...\n"); _ca = 0; if (!_sym) { delete _sessionRecv; _sessionRecv = NULL; @@ -145,6 +144,7 @@ AudioRtpRTX::~AudioRtpRTX () { delete time; time = NULL; delete converter; converter = NULL; + } void diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 2650b48edad521407c70c2c22ba697397b81d23f..bce46a013079067039097a379e4b9dfc79ea6a4a 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -249,6 +249,7 @@ ManagerImpl::answerCall(const CallID& id) bool ManagerImpl::hangupCall(const CallID& id) { + _debug("ManagerImpl::hangupCall(): This function is called when user hangup \n"); PulseLayer *pulselayer; AccountID accountid; bool returnValue; @@ -370,6 +371,7 @@ ManagerImpl::transferCall(const CallID& id, const std::string& to) bool ManagerImpl::refuseCall (const CallID& id) { + _debug("ManagerImpl::refuseCall(): method called"); stopTone(true); AccountID accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { @@ -632,8 +634,10 @@ ManagerImpl::peerRingingCall(const CallID& id) void ManagerImpl::peerHungupCall(const CallID& id) { + _debug("ManagerImpl::peerHungupCall():this function is called when peer hangup \n"); PulseLayer *pulselayer; AccountID accountid; + bool returnValue; accountid = getAccountFromCall( id ); if (accountid == AccountNULL) { @@ -649,6 +653,8 @@ ManagerImpl::peerHungupCall(const CallID& id) switchCall(""); } + returnValue = getAccountLink(accountid)->hangup(id); + removeWaitingCall(id); removeCallAccount(id); diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index 912af6a423394d203dc2d7b23cab70936d91f269..bb25efcbefd2fc7ecb06925dffbdd760083aed95 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -149,6 +149,8 @@ SIPVoIPLink* SIPVoIPLink::_instance = NULL; , _useStun(false) , _clients(0) { + _debug("SIPVoIPLink::~SIPVoIPLink(): sipvoiplink constructor called \n"); + // to get random number for RANDOM_PORT srand (time(NULL)); @@ -158,6 +160,7 @@ SIPVoIPLink* SIPVoIPLink::_instance = NULL; SIPVoIPLink::~SIPVoIPLink() { + _debug("SIPVoIPLink::~SIPVoIPLink(): sipvoiplink destructor called \n"); terminate(); } @@ -213,7 +216,6 @@ SIPVoIPLink::terminate() void SIPVoIPLink::terminateSIPCall() { - ost::MutexLock m(_callMapMutex); CallMap::iterator iter = _callMap.begin(); SIPCall *call; @@ -488,6 +490,8 @@ SIPVoIPLink::hangup(const CallID& id) _debug("* SIP Info: Stopping AudioRTP for hangup\n"); _audiortp->closeRtpSession(); } + + terminateSIPCall(); removeCall(id); @@ -689,7 +693,7 @@ SIPVoIPLink::refuse (const CallID& id) pj_status_t status; pjsip_tx_data *tdata; - + _debug("SIPVoIPLink::refuse() : teh call is refused \n"); call = getSIPCall(id); if (call==0) { @@ -713,6 +717,8 @@ SIPVoIPLink::refuse (const CallID& id) return false; call->getInvSession()->mod_data[getModId()] = NULL; + + terminateSIPCall(); return true; }