Skip to content

fix(dialog): send CANCEL to the INVITE's destination - #261

Merged
yeoleobun merged 3 commits into
restsend:mainfrom
jsmey7:fix/cancel-follows-invite-destination
Nov 18, 2026
Merged

yeoleobun merged 3 commits into
restsend:mainfrom
jsmey7:fix/cancel-follows-invite-destination

Conversation

@jsmey7

@jsmey7 jsmey7 commented Nov 18, 2026

Copy link
Copy Markdown

Fixes #260.

A UAC INVITE sent to an explicit InviteOption::destination was cancelled to wherever the Request-URI resolved. RFC 3261 §9.1 requires the CANCEL's destination address, port and transport to be identical to the INVITE's.

DialogInner now keeps the INVITE's destination (invite_destination, set in create_client_invite_dialog), and send_dialog_request uses it for CANCEL. Other in-dialog requests are unchanged.

Tests

src/dialog/tests/test_cancel_destination.rs sends an INVITE whose Request-URI host does not resolve, with a raw UDP peer as its destination. The peer answers 180, then:

  • test_explicit_cancel_goes_to_the_invite_destination calls InviteDialog::cancel();
  • test_dropped_invite_cancel_goes_to_the_invite_destination drops the do_invite future.

Both fail on main (no CANCEL reaches the peer) and pass with the fix. cargo test passes in full (685 lib tests), and clippy reports no new warnings.

Joshua Smotritsky and others added 3 commits November 17, 2026 19:13
A UAC INVITE sent to an explicit InviteOption::destination was cancelled to wherever the Request-URI resolved. RFC 3261 §9.1 requires the CANCEL to use the INVITE's destination address, port and transport. The dialog now keeps that destination and uses it for CANCEL.

Fixes restsend#260
@yeoleobun
yeoleobun merged commit 4ff2bd2 into restsend:main Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CANCEL ignores InviteOption::destination and follows the Request-URI (RFC 3261 §9.1)

2 participants