diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp index afaa83d7fbe46fea46c435b39d2bb8b369be34e2..5cf7132756cfefd7fa3552bbbd8b53ea7159a230 100644 --- a/sflphone-common/src/sip/sipvoiplink.cpp +++ b/sflphone-common/src/sip/sipvoiplink.cpp @@ -730,6 +730,12 @@ SIPVoIPLink::hangup (const CallID& id) return false; } + // Release RTP thread + if (Manager::instance().isCurrentCall (id)) { + _debug ("* SIP Info: Stopping AudioRTP for hangup\n"); + _audiortp->stop(); + } + // User hangup current call. Notify peer status = pjsip_inv_end_session (call->getInvSession(), 404, NULL, &tdata); @@ -750,13 +756,6 @@ SIPVoIPLink::hangup (const CallID& id) call->getInvSession()->mod_data[getModId() ] = NULL; - - // Release RTP thread - if (Manager::instance().isCurrentCall (id)) { - _debug ("* SIP Info: Stopping AudioRTP for hangup\n"); - _audiortp->stop(); - } - terminateOneCall (id); removeCall (id); @@ -778,6 +777,12 @@ SIPVoIPLink::peerHungup (const CallID& id) return false; } + // Release RTP thread + if (Manager::instance().isCurrentCall (id)) { + _debug ("* SIP Info: Stopping AudioRTP for hangup\n"); + _audiortp->stop(); + } + // User hangup current call. Notify peer status = pjsip_inv_end_session (call->getInvSession(), 404, NULL, &tdata); @@ -794,12 +799,6 @@ SIPVoIPLink::peerHungup (const CallID& id) call->getInvSession()->mod_data[getModId() ] = NULL; - // Release RTP thread - if (Manager::instance().isCurrentCall (id)) { - _debug ("* SIP Info: Stopping AudioRTP for hangup\n"); - _audiortp->stop(); - } - terminateOneCall (id); removeCall (id);