From 07c893700936be58ad5aa0156ebf34c355e0f0fc Mon Sep 17 00:00:00 2001 From: Venky Date: Sun, 29 Mar 2026 16:20:48 +0400 Subject: [PATCH] fix: handle BYE in WaitAck state for server dialogs 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. --- src/dialog/server_dialog.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dialog/server_dialog.rs b/src/dialog/server_dialog.rs index 09c71817..e3747d90 100644 --- a/src/dialog/server_dialog.rs +++ b/src/dialog/server_dialog.rs @@ -715,6 +715,9 @@ impl ServerInviteDialog { ))?; return Ok(()); } + // Accept BYE even in WaitAck state — remote may tear down call + // before ACK arrives (common with SIP proxies) + rsip::Method::Bye => return self.handle_bye(tx).await, _ => { // ignore other requests in non-confirmed state return Ok(());