Skip to content

Commit

Permalink
SipDialogController: Protect against glare during reINVITE (#402)
Browse files Browse the repository at this point in the history
Scenario:
Session-Expires with refresher=uas

When client receives re-INVITE, it immediately sends BYE, and only then
it responds with 481 to the INVITE.

This results in drachtio crash.

Fixes #401
  • Loading branch information
orgads authored Jan 17, 2025
1 parent bc294d4 commit e00f255
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sip-dialog-controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,11 @@ namespace drachtio {
std::shared_ptr<RIP> rip ;

nta_leg_t* leg = nta_leg_by_call_id(m_pController->getAgent(), sip->sip_call_id->i_id);
assert(leg) ;
if (!leg) {
DR_LOG(log_warning) << "SipDialogController::processResponseToRefreshingReinvite: unable to find leg for call-id "
<< sip->sip_call_id->i_id << ", probably glare condition with BYE and re-INVITE";
return 0;
}
std::shared_ptr<SipDialog> dlg ;
if( !findDialogByLeg( leg, dlg ) ) {
assert(0) ;
Expand Down

0 comments on commit e00f255

Please sign in to comment.