I assume your ACK is for a 2xx final response to INVITE (same Call-ID, same
CSeq=2, To has a tag).  t_check_trans() only matches ACKs for non-2xx
replies (class 3 to 6 error codes). Hence it returns false

If it’s an ACK for non-2xx then stateful forward using the existing
transaction (t_check_trans() will return true then call t_relay()).
If it’s an ACK for 2xx then loose-route it and relay statelessly (RR/dialog
routing), not via t_check_trans().

This is what my code looks like. Hope this helps!

route[WITHINDLG] {
    if (is_method("ACK")) {
        if (t_check_trans()) {
            # ACK to non-2xx (3xx–6xx) -> stateful
            t_relay();
        } else {
            # ACK to 2xx -> separate transaction -> route via RR set
            if (loose_route()) {
                route(RELAY);
            } else {
                # fallback: if you have dialog module
                # route via dialog or dst_uri as appropriate
                route(RELAY);
            }
        }
        exit;
    }

   [... Do some more voodoo mambo jambo here ...]

    if (loose_route()) {
        route(RELAY);
        exit;
    }

    sl_send_reply("404", "Not here");
    exit;
}




Atenciosamente / Kind Regards / Cordialement / Un saludo,


*Sérgio Charrua*






On Tue, Aug 26, 2025 at 11:55 PM Fernando Lopes via sr-users <
sr-users@lists.kamailio.org> wrote:

> Hello everyone,
>
> Quick question: I have a t_check_trans that is returning false even though
> the ACK should match a SIP message.
>
> Here are my logs:
>
> INVITE sip:7@172.31.217.74 SIP/2.0
> Via: SIP/2.0/WSS hruuc8uql46h.invalid;branch=z9hG4bK9771396
> To: <sip:7@172.31.217.74>
> From: "916c67e8-652f-49ea-b288-2bbbee8dbf21" <sip:User1@172.31.217.74
> >;tag=cv63sqfvns
> CSeq: 2 INVITE
> Call-ID: pr0ndrr8fd14vekv6k15
> Max-Forwards: 70
> Authorization: Digest algorithm=MD5, username="User1", realm="XXXXXX",
> nonce="1756247832/9dfac95b19496304d744138c5789346f", uri="
> sip:7@172.31.217.74", response="8abe90b7e0971cc52ce0a2c6988e0656",
> opaque="370804d3544dc2aa", qop=auth, cnonce="im9losvhkh93", nc=00000001
> Contact: <sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@hruuc8uql46h.invalid
> ;transport=ws;ob>
> Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
> Supported: outbound
> User-Agent: SIP.js/0.21.1
> Content-Type: application/sdp
> Content-Length: 2545
>
> ACK sip:10.5.0.2:5060 SIP/2.0
> Via: SIP/2.0/WSS hruuc8uql46h.invalid;branch=z9hG4bK6675132
> To: <sip:7@172.31.217.74>;tag=b51c9e70-e71d-4a52-a8a3-07673119e625
> From: "916c67e8-652f-49ea-b288-2bbbee8dbf21" <sip:User1@172.31.217.74
> >;tag=cv63sqfvns
> CSeq: 2 ACK
> Call-ID: pr0ndrr8fd14vekv6k15
> Max-Forwards: 70
> Supported: outbound
> User-Agent: SIP.js/0.21.1
> Content-Length: 0
>
> Thank you.
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions --
> sr-users@lists.kamailio.org
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
>
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- 
sr-users@lists.kamailio.org
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to