Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/dialog/invite_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ impl InviteDialog {
.last_response
.as_ref()
.is_some_and(|resp| resp.status_code.kind() == StatusCodeKind::Successful);
let mut acked = false;

while let Some(msg) = tx.receive().await {
if let SipMessage::Request(req) = msg {
Expand All @@ -851,11 +852,17 @@ impl InviteDialog {
self.id(),
tx.last_response.clone().unwrap_or_default(),
))?;
acked = true;
break;
}
}
}
self.inner.end_session_without_ack(tx, answered_2xx).await;
// A matching ACK ends the Accepted transaction; `acked` keeps the
// timeout path (no ACK within 64*T1) from firing on a confirmed
// re-INVITE.
self.inner
.end_session_without_ack(tx, answered_2xx && !acked)
.await;
Ok(())
}

Expand Down
9 changes: 8 additions & 1 deletion src/dialog/server_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ impl ServerInviteDialog {
.last_response
.as_ref()
.is_some_and(|resp| resp.status_code.kind() == crate::sip::StatusCodeKind::Successful);
let mut acked = false;

while let Some(msg) = tx.receive().await {
if let SipMessage::Request(req) = msg {
Expand All @@ -863,11 +864,17 @@ impl ServerInviteDialog {
self.id(),
tx.last_response.clone().unwrap_or_default(),
))?;
acked = true;
break;
}
}
}
self.inner.end_session_without_ack(tx, answered_2xx).await;
// A matching ACK ends the Accepted transaction; `acked` keeps the
// timeout path (no ACK within 64*T1) from firing on a confirmed
// re-INVITE.
self.inner
.end_session_without_ack(tx, answered_2xx && !acked)
.await;
Ok(())
}

Expand Down
1 change: 1 addition & 0 deletions src/transaction/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{
};
use tokio_util::sync::CancellationToken;

mod test_accepted_lifecycle;
mod test_ack_flow_reuse;
mod test_auto_ack_2xx;
mod test_before_send;
Expand Down
Loading
Loading