Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/invite bye leak #283

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
clear IIP in scenario where we send a BYE during a UAC reinvite
  • Loading branch information
davehorton committed May 19, 2023
commit 06aeb684b462c1f0e016f28808b6246f669bc5a8
10 changes: 9 additions & 1 deletion src/sip-dialog-controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ namespace drachtio {
Cdr::postCdr( std::make_shared<CdrStop>( msg, "network", Cdr::normal_release ) );

// in case we have an invite in progress we sent, and received a BYE instead of final response
DR_LOG(log_debug) << "SipDialogController::processRequestInsideDialog: " ;
DR_LOG(log_debug) << "SipDialogController::processRequestInsideDialog: received BYE, if we have an IIP clear it now" ;
IIP_Clear(m_invitesInProgress, leg); }
}
}
Expand Down Expand Up @@ -1569,6 +1569,14 @@ namespace drachtio {
else if( dialogId.length() > 0 ) {
DR_LOG(log_debug) << "SipDialogController::processResponseInsideDialog: clearing dialog after receiving response to BYE or notify w/ subscription-state terminated" ;
SD_Clear(m_dialogs, dialogId ) ;

if (sip->sip_cseq->cs_method == sip_method_bye) {
nta_leg_t* leg = nta_leg_by_call_id(m_pController->getAgent(), sip->sip_call_id->i_id);
if (leg) {
DR_LOG(log_debug) << "SipDialogController::processResponseInsideDialog: received 200 OK to BYE, if we have an IIP clear it now, leg " << std::hex << (void*) leg ;
IIP_Clear(m_invitesInProgress, leg);
}
}
}
else {
DR_LOG(log_debug) << "SipDialogController::processResponseInsideDialog: got 200 OK to BYE but don't have dialog id" ;
Expand Down