Skip to content

Commit 1f24be2

Browse files
committed
refactor: improve dialog confirmation handling in DialogLayer
1 parent 91a8551 commit 1f24be2

2 files changed

Lines changed: 22 additions & 16 deletions

File tree

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rsipstack"
3-
version = "0.2.88"
3+
version = "0.2.89"
44
edition = "2021"
55
description = "SIP Stack Rust library for building SIP applications"
66
license = "MIT"
@@ -25,7 +25,7 @@ log = "0.4.28"
2525
rsip = { version = "0.4.0" }
2626
thiserror = "2.0.17"
2727
tracing = "0.1.41"
28-
tokio-util = { version = "0.7.16", features = ["full"] }
28+
tokio-util = { version = "0.7.17", features = ["full"] }
2929
tracing-subscriber = { version = "0.3.20", features = ["local-time"] }
3030
rand = { version = "0.9.2" }
3131
get_if_addrs = "0.5.3"
@@ -35,8 +35,8 @@ futures-util = "0.3.31"
3535
tokio-tungstenite = { version = "0.28.0", optional = true }
3636
tokio-rustls = { version = "0.26.4", optional = true }
3737
rustls-pemfile = { version = "2.2.0", optional = true }
38-
webpki-roots = { version = "1.0.3", optional = true }
39-
rustls = "0.23.32"
38+
webpki-roots = { version = "1.0.4", optional = true }
39+
rustls = "0.23.35"
4040
clap = { version = "4.5.47", features = ["derive"] }
4141
http = "1.3.1"
4242
nom = "8.0.0"
@@ -56,12 +56,11 @@ getrandom = { version = "0.3.4" }
5656
tokio = { version = "1.48.0", features = ["full"] }
5757

5858
[dev-dependencies]
59-
wasm-bindgen-test = "0.3.54"
6059
dotenv = "0.15"
6160
sdp-rs = "0.2.1"
6261
rtp-rs = "0.6.0"
6362
stun-rs = "0.1.11"
64-
openai-api-rs = "7.0.0"
63+
openai-api-rs = "8.0.1"
6564
base64 = "0.22.1"
6665
serde = "1.0.228"
6766
serde_json = "1.0.145"

src/dialog/invitation.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,23 @@ impl DialogLayer {
421421

422422
match r {
423423
Ok((new_dialog_id, resp)) => {
424-
debug!(
425-
"client invite dialog confirmed: {} => {}",
426-
id, new_dialog_id
427-
);
428-
self.inner
429-
.dialogs
430-
.write()
431-
.as_mut()
432-
.map(|ds| ds.insert(new_dialog_id, Dialog::ClientInvite(dialog.clone())))
433-
.ok();
424+
match resp {
425+
Some(ref r) if r.status_code.kind() == rsip::StatusCodeKind::Successful => {
426+
debug!(
427+
"client invite dialog confirmed: {} => {}",
428+
id, new_dialog_id
429+
);
430+
self.inner
431+
.dialogs
432+
.write()
433+
.as_mut()
434+
.map(|ds| {
435+
ds.insert(new_dialog_id, Dialog::ClientInvite(dialog.clone()))
436+
})
437+
.ok();
438+
}
439+
_ => {}
440+
}
434441
return Ok((dialog, resp));
435442
}
436443
Err(e) => {

0 commit comments

Comments
 (0)