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
6 changes: 6 additions & 0 deletions src/dialog/dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ impl DialogState {
pub fn is_terminated(&self) -> bool {
matches!(self, DialogState::Terminated(_, _))
}
pub fn waiting_ack(&self) -> bool {
matches!(self, DialogState::WaitAck(_, _))
}
}

impl DialogInner {
Expand Down Expand Up @@ -297,6 +300,9 @@ impl DialogInner {
pub fn is_terminated(&self) -> bool {
self.state.lock().unwrap().is_terminated()
}
pub fn waiting_ack(&self) -> bool {
self.state.lock().unwrap().waiting_ack()
}
pub fn get_local_seq(&self) -> u32 {
self.local_seq.load(Ordering::Relaxed)
}
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/server_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl ServerInviteDialog {
/// # }
/// ```
pub async fn bye(&self) -> Result<()> {
if !self.inner.is_confirmed() {
if !self.inner.is_confirmed() && !self.inner.waiting_ack() {
return Ok(());
}
info!(id=%self.id(), "sending bye request");
Expand Down