Skip to content

Commit eb98326

Browse files
committed
fix: clear expire params of Contact
1 parent d2b81d1 commit eb98326

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/dialog/registration.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515
};
1616
use rsip::{
1717
prelude::{HeadersExt, ToTypedHeader},
18-
Response, SipMessage, StatusCode,
18+
Param, Response, SipMessage, StatusCode,
1919
};
2020
use tracing::debug;
2121

@@ -378,7 +378,7 @@ impl Registration {
378378
// 3. Local non-loopback address (lowest priority)
379379
// - Only used for initial registration attempt
380380
// - Will be replaced by server-discovered address after first response
381-
let contact = self.contact.clone().unwrap_or_else(|| {
381+
let mut contact = self.contact.clone().unwrap_or_else(|| {
382382
let contact_host_with_port = self
383383
.public_address
384384
.clone()
@@ -395,6 +395,11 @@ impl Registration {
395395
params: vec![],
396396
}
397397
});
398+
399+
if expires.is_some() {
400+
contact.params.retain(|p| !matches!(p, Param::Expires(_)));
401+
}
402+
398403
let mut request = self.endpoint.make_request(
399404
rsip::Method::Register,
400405
server,

0 commit comments

Comments
 (0)