File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[package ]
22name = " rsipstack"
3- version = " 0.2.86 "
3+ version = " 0.2.87 "
44edition = " 2021"
55description = " SIP Stack Rust library for building SIP applications"
66license = " MIT"
Original file line number Diff line number Diff line change @@ -297,6 +297,19 @@ impl DialogInner {
297297 Ok ( ( ) )
298298 }
299299
300+ /// Update the dialog's remote target URI and optional Contact header.
301+ ///
302+ /// When a 2xx/UPDATE response carries a new Contact, call this to ensure
303+ /// subsequent in-dialog requests route to the latest remote target.
304+ pub fn set_remote_target (
305+ & self ,
306+ uri : rsip:: Uri ,
307+ contact : Option < rsip:: headers:: untyped:: Contact > ,
308+ ) {
309+ * self . remote_uri . lock ( ) . unwrap ( ) = uri;
310+ * self . remote_contact . lock ( ) . unwrap ( ) = contact;
311+ }
312+
300313 pub ( super ) fn build_vias_from_request ( & self ) -> Result < Vec < Via > > {
301314 let mut vias = vec ! [ ] ;
302315 for header in self . initial_request . headers . iter ( ) {
@@ -692,4 +705,17 @@ impl Dialog {
692705 Dialog :: ClientInvite ( d) => d. inner . can_cancel ( ) ,
693706 }
694707 }
708+
709+ /// Expose a safe hook to refresh the remote target URI/Contact after
710+ /// receiving responses such as 200 OK.
711+ pub fn set_remote_target (
712+ & self ,
713+ uri : rsip:: Uri ,
714+ contact : Option < rsip:: headers:: untyped:: Contact > ,
715+ ) {
716+ match self {
717+ Dialog :: ServerInvite ( d) => d. inner . set_remote_target ( uri, contact) ,
718+ Dialog :: ClientInvite ( d) => d. inner . set_remote_target ( uri, contact) ,
719+ }
720+ }
695721}
You can’t perform that action at this time.
0 commit comments