Skip to content

ServerInviteDialog::bye is a silent no-op outside Confirmed/WaitAck #136

Description

@autopeasant

Summary

ServerInviteDialog::bye_with_headers returns Ok(()) without sending BYE when the dialog is not in Confirmed or WaitAck:

if !self.inner.is_confirmed() && !self.inner.waiting_ack() {
    return Ok(());
}

Callers (e.g. a B2BUA hangup path) cannot distinguish “BYE sent” from “nothing happened”. If dialog state has diverged from the media path (media flowing while dialog still Early, or already past the expected state), the remote UA never receives BYE and stays off-hook.

Affected version

rsipstack 0.5.24 (crates.io)

Environment

  • Used under restsend/rustpbx as B2BUA
  • Observed hangup completing in ~10–20ms with Ok while no BYE appears on the wire toward a UDP ATA

Expected options (either would help)

  1. Return a distinct error / Ok(false) when BYE was not sent, or
  2. Document clearly and have higher layers check state() before assuming hangup succeeded, or
  3. For INVITE server dialogs that have sent a non-100 response, still attempt BYE/CANCEL as appropriate rather than silent success

Minimal reproduction

  1. Create a ServerInviteDialog, leave it in Calling/Early (or any non-Confirmed/non-WaitAck state).
  2. Call bye().await.
  3. Observe Ok(()) and no SIP message sent.

Not claiming every Early dialog must send BYE — the footgun is the silent Ok(()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions