diff --git a/sip/transaction_client_tx.go b/sip/transaction_client_tx.go index 1d89ca7..b5a61d3 100644 --- a/sip/transaction_client_tx.go +++ b/sip/transaction_client_tx.go @@ -155,6 +155,11 @@ func (tx *ClientTx) ack() { ack := newAckRequestNon2xx(tx.origin, resp, nil) tx.fsmAck = ack // NOTE: this could be incorect property to use but it helps preventing loops in some cases + // https://github.com/emiago/sipgo/issues/168 + // Destination can be FQDN and we do not want to resolve this. + // Still in case reliable connection, this ack will reuse same INVITE connection + ack.SetDestination(tx.origin.Destination()) + err := tx.conn.WriteMsg(ack) if err != nil { tx.log.Error(). diff --git a/sip/transport_layer.go b/sip/transport_layer.go index 96d5d78..5b2e851 100644 --- a/sip/transport_layer.go +++ b/sip/transport_layer.go @@ -313,6 +313,8 @@ func (l *TransportLayer) ClientRequestConnection(ctx context.Context, req *Reque } // Save destination in request to avoid repeated resolving + // This also solves problem where subsequent request like NON 2xx ACK can + // send on same destination without resolving again. req.SetDestination(raddr.String()) }