@@ -462,7 +462,9 @@ impl Transaction {
462462 TransactionEvent :: Received ( msg, connection) => {
463463 if let Some ( msg) = match msg {
464464 SipMessage :: Request ( req) => self . on_received_request ( req, connection) . await ,
465- SipMessage :: Response ( resp) => self . on_received_response ( resp) . await ,
465+ SipMessage :: Response ( resp) => {
466+ self . on_received_response ( resp, connection) . await
467+ }
466468 } {
467469 if let Some ( ref inspector) = self . endpoint_inner . inspector {
468470 return Some ( inspector. after_received ( msg) ) ;
@@ -578,7 +580,11 @@ impl Transaction {
578580 None
579581 }
580582
581- async fn on_received_response ( & mut self , resp : Response ) -> Option < SipMessage > {
583+ async fn on_received_response (
584+ & mut self ,
585+ resp : Response ,
586+ connection : Option < SipConnection > ,
587+ ) -> Option < SipMessage > {
582588 match self . transaction_type {
583589 TransactionType :: ServerInvite | TransactionType :: ServerNonInvite => return None ,
584590 _ => { }
@@ -594,7 +600,9 @@ impl Transaction {
594600 }
595601 _ => {
596602 if self . transaction_type == TransactionType :: ClientInvite {
597- need_ack = true ;
603+ if connection. is_some ( ) {
604+ need_ack = true ;
605+ }
598606 TransactionState :: Completed
599607 } else {
600608 TransactionState :: Terminated
@@ -725,10 +733,6 @@ impl Transaction {
725733 . take ( )
726734 . map ( |id| self . endpoint_inner . timers . cancel ( id) ) ;
727735 }
728- self . timer_a . replace ( self . endpoint_inner . timers . timeout (
729- self . endpoint_inner . option . t1 ,
730- TransactionTimer :: TimerA ( self . key . clone ( ) , self . endpoint_inner . option . t1 ) ,
731- ) ) ;
732736 }
733737
734738 self . timer_b
0 commit comments