Skip to content

Commit 327ff4b

Browse files
authored
Merge pull request #55 from yeoleobun/main
fix hangup for wait ack
2 parents e3ec5e4 + 49e6d99 commit 327ff4b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/dialog/dialog.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ impl DialogState {
226226
pub fn is_terminated(&self) -> bool {
227227
matches!(self, DialogState::Terminated(_, _))
228228
}
229+
pub fn waiting_ack(&self) -> bool {
230+
matches!(self, DialogState::WaitAck(_, _))
231+
}
229232
}
230233

231234
impl DialogInner {
@@ -297,6 +300,9 @@ impl DialogInner {
297300
pub fn is_terminated(&self) -> bool {
298301
self.state.lock().unwrap().is_terminated()
299302
}
303+
pub fn waiting_ack(&self) -> bool {
304+
self.state.lock().unwrap().waiting_ack()
305+
}
300306
pub fn get_local_seq(&self) -> u32 {
301307
self.local_seq.load(Ordering::Relaxed)
302308
}

src/dialog/server_dialog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ impl ServerInviteDialog {
350350
/// # }
351351
/// ```
352352
pub async fn bye(&self) -> Result<()> {
353-
if !self.inner.is_confirmed() {
353+
if !self.inner.is_confirmed() && !self.inner.waiting_ack() {
354354
return Ok(());
355355
}
356356
info!(id=%self.id(), "sending bye request");

0 commit comments

Comments
 (0)