diff --git a/src/transaction/endpoint.rs b/src/transaction/endpoint.rs index 4244b271..1a881ea0 100644 --- a/src/transaction/endpoint.rs +++ b/src/transaction/endpoint.rs @@ -270,7 +270,7 @@ impl EndpointInner { match event { TransportEvent::Incoming(msg, connection, from) => { - match self.on_received_message(msg, connection).await { + match self.on_received_message(msg, connection, &from).await { Ok(()) => {} Err(e) => { warn!(addr=%from,"on_received_message error: {}", e); @@ -331,6 +331,7 @@ impl EndpointInner { self: &Arc, msg: SipMessage, connection: SipConnection, + from: &SipAddr, ) -> Result<()> { let mut key = match &msg { SipMessage::Request(req) => { @@ -394,6 +395,11 @@ impl EndpointInner { return Ok(()); } } + rsip::StatusCodeKind::RequestFailure => { + // for ACK to 487, send it where it came from + connection.send(last_message, Some(from)).await?; + return Ok(()); + } _ => {} } if let Ok(Some(tag)) = resp.to_header()?.tag() {