fix: handle BYE in WaitAck state for server dialogs#108
Merged
yeoleobun merged 1 commit intorestsend:mainfrom Mar 30, 2026
Merged
fix: handle BYE in WaitAck state for server dialogs#108yeoleobun merged 1 commit intorestsend:mainfrom
yeoleobun merged 1 commit intorestsend:mainfrom
Conversation
SIP proxies may forward BYE before the ACK for the 200 OK reaches the UAS, leaving the server dialog in WaitAck state. Previously BYE was silently ignored, causing the call to stay open until media timeout. Now processes BYE in WaitAck state (same as Confirmed), transitioning the dialog to Terminated and responding with 200 OK. This matches RFC 3261 Section 15.1.2 behavior for early BYE processing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SIP proxies may forward BYE to the UAS before the ACK for the 200 OK arrives, leaving the server dialog in
WaitAckstate. Previously BYE was silently ignored in this state, causing the application to not detect call termination until media timeout (typically 30s).Now processes BYE in
WaitAckstate (same asConfirmed), transitioning the dialog toTerminatedand responding with 200 OK.Problem
CallTerminatedevent — application only detects hangup after 30s media timeoutThis is common with B2BUA-style SIP proxies that handle ACK/BYE ordering independently on each leg.
Fix
Added
rsip::Method::Byehandling in the non-confirmed state match arm ofserver_dialog.rs, callinghandle_bye()which sends 200 OK and transitions to Terminated.Per RFC 3261 Section 15.1.2, a UAS should process BYE even if the dialog is not yet confirmed.
Test plan