@@ -61,7 +61,7 @@ use tracing::{debug, info, warn};
6161/// # from_tag: "from-tag".to_string(),
6262/// # to_tag: "to-tag".to_string(),
6363/// # };
64- /// let state = DialogState::Confirmed(dialog_id);
64+ /// let state = DialogState::Confirmed(dialog_id, rsip::Response::default() );
6565/// if state.is_confirmed() {
6666/// println!("Dialog is established");
6767/// }
@@ -73,7 +73,7 @@ pub enum DialogState {
7373 Trying ( DialogId ) ,
7474 Early ( DialogId , rsip:: Response ) ,
7575 WaitAck ( DialogId , rsip:: Response ) ,
76- Confirmed ( DialogId ) ,
76+ Confirmed ( DialogId , rsip :: Response ) ,
7777 Updated ( DialogId , rsip:: Request ) ,
7878 Notify ( DialogId , rsip:: Request ) ,
7979 Info ( DialogId , rsip:: Request ) ,
@@ -198,7 +198,7 @@ impl DialogState {
198198 )
199199 }
200200 pub fn is_confirmed ( & self ) -> bool {
201- matches ! ( self , DialogState :: Confirmed ( _) )
201+ matches ! ( self , DialogState :: Confirmed ( _, _ ) )
202202 }
203203 pub fn is_terminated ( & self ) -> bool {
204204 matches ! ( self , DialogState :: Terminated ( _, _) )
@@ -401,12 +401,12 @@ impl DialogInner {
401401 }
402402 } ;
403403
404- if status != StatusCode :: Trying {
405- if !to. params . iter ( ) . any ( |p| matches ! ( p, Param :: Tag ( _) ) ) {
406- to . params . push ( rsip :: Param :: Tag (
407- self . id . lock ( ) . unwrap ( ) . to_tag . clone ( ) . into ( ) ,
408- ) ) ;
409- }
404+ if status != StatusCode :: Trying
405+ && !to. params . iter ( ) . any ( |p| matches ! ( p, Param :: Tag ( _) ) )
406+ {
407+ to . params . push ( rsip :: Param :: Tag (
408+ self . id . lock ( ) . unwrap ( ) . to_tag . clone ( ) . into ( ) ,
409+ ) ) ;
410410 }
411411 resp_headers. push ( Header :: To ( to. into ( ) ) ) ;
412412 }
@@ -636,7 +636,7 @@ impl std::fmt::Display for DialogState {
636636 DialogState :: Trying ( id) => write ! ( f, "{}(Trying)" , id) ,
637637 DialogState :: Early ( id, _) => write ! ( f, "{}(Early)" , id) ,
638638 DialogState :: WaitAck ( id, _) => write ! ( f, "{}(WaitAck)" , id) ,
639- DialogState :: Confirmed ( id) => write ! ( f, "{}(Confirmed)" , id) ,
639+ DialogState :: Confirmed ( id, _ ) => write ! ( f, "{}(Confirmed)" , id) ,
640640 DialogState :: Updated ( id, _) => write ! ( f, "{}(Updated)" , id) ,
641641 DialogState :: Notify ( id, _) => write ! ( f, "{}(Notify)" , id) ,
642642 DialogState :: Info ( id, _) => write ! ( f, "{}(Info)" , id) ,
0 commit comments