Repository navigation
fix: CANCEL a dropped INVITE after its first provisional response (rebase of #168) - #171
Merged
shenjinti merged 1 commit intoOct 6, 2026
Conversation
When the do_invite future is dropped before any provisional response, the guard drops the INVITE transaction and sends nothing. The INVITE may still have reached the callee: its 180 gets no CANCEL, and a 2xx is neither ACKed nor ended, so the callee keeps ringing or answers into dead air. A CANCEL must not be sent before a provisional response; the UAC has to wait for one and CANCEL then (RFC 3261 §9.1). Keep the INVITE transaction, without retransmissions, until its first response (up to 64*T1): on a provisional, cancel it as a call dropped while ringing; on a 2xx, ACK it and send a BYE; any other final response is ACKed by the transaction. Terminated(UacCancel) is still reported at once, and nothing is sent when no response arrives.
This was referenced Oct 6, 2026
shenjinti
added a commit
that referenced
this pull request
Oct 6, 2026
Ships this round on top of 0.7.0: proxy-mode auto_ack_2xx (#146/#172), ACK CSeq routing (#155/#170/#172), digest auth_username (#153), dead stream retirement (#161), remote-ack getter (#157), UAS ACK timeout → BYE (#149/#169), RFC 6026 Accepted state + Timer L/M with documented deviations (#164/#169), CANCEL/2xx race handling (#162/#171), in-dialog Via transport (#163), flow-reuse and ACK hardening tests.
This was referenced Oct 7, 2026
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.
Rebase of #168 by @tgeorge06, closes #166.
DialogGuardForUnconfirmed::dropno longer discards the INVITE transaction while the dialog is stillCalling: the transaction is kept for one response window (64*T1). A provisional response triggers the existing CANCEL flow (RFC 3261 §9.1 — no CANCEL before a provisional); a 2xx that arrives with no provisional gets the end-to-end ACK and a BYE (RFC 3261 §13.2.2.4, §15, RFC 5407 §3.1.2 — same treatment as the #162 CANCEL/2xx race); a non-2xx final gets its ACK. Nothing is sent while no response has arrived.Applied cleanly on the merged RFC 6026 state machine (#164/#169). Local verification: 380 lib + 65 doc tests green across repeated runs, fmt clean. The PR's #166 reproduction tests (180 → CANCEL; 200 → ACK+BYE; 486 → ACK) pass.