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.
According to transaction description at https://datatracker.ietf.org/doc/html/rfc3261#section-6 ACK is a separate transaction in case of successful reply to invite.
It isn't clear from your messages what kind of response your ACK acknowledges.
On Wed, Aug 27, 2025, 00:59 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-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
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-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
Sounds Great!
SIP reply messages and errors are divided into classes, where: - Class 1 or 1XX or range from 100 to 199, is information reply (ex.: 180 Ringing) - Class 2 or 2XX or range from 200 to 299, is a success reply (ex.: 200 OK - call answered) - Class 3 or 3XX or range from 300 to 399, is a redirection reply (ex.: 303 Redirect ... i think) - Class 4 or 4XX or range from 400 to 499, is request failure reply (ex.: 404 Not Found) - Class 5 or 5XX or range from 500 to 599, is server failure (ex.: 500 Server Failure) - Class 6 or 6XX or range from 600 to 699, is global failure (ex. 603 Decline)
a good article to read more about the subject: https://en.wikipedia.org/wiki/List_of_SIP_response_codes
Atenciosamente / Kind Regards / Cordialement / Un saludo,
*Sérgio Charrua*
On Wed, Aug 27, 2025 at 3:57 PM Fernando Lopes via sr-users < sr-users@lists.kamailio.org> wrote:
Thank you, it worked.
What are 2xx (3xx-6xx) replies? __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
Hi
I spotted this in one reply.
assume your ACK is for a 2xx final response to INVITE (same Call-ID, same CSeq=2, To has a tag).
I think you're right that this is an ACK for a SIP-200 response, but those three things would be true even for a negative ACK. What tells me that this is an answered call is that the RURI and Via branch in the ACK are different from those in the INVITE (with a different Via branch, transaction matching can never work anyway).
I reply because I see that there's no Route header field in the ACK request, which shows that RR is not being used. This may not be a problem in the direction from WSS client to server (10.5.0.2:5060) through the proxy, but you might find that BYEs or other requests in the other direction won't work. If you test and they don't work, then have a look at the documentation for the rr.so module.
James
On Wed, 27 Aug 2025 at 14:13, Sergio Charrua via sr-users sr-users@lists.kamailio.org wrote:
Sounds Great!
SIP reply messages and errors are divided into classes, where:
- Class 1 or 1XX or range from 100 to 199, is information reply (ex.: 180 Ringing)
- Class 2 or 2XX or range from 200 to 299, is a success reply (ex.: 200 OK - call answered)
- Class 3 or 3XX or range from 300 to 399, is a redirection reply (ex.: 303 Redirect ... i think)
- Class 4 or 4XX or range from 400 to 499, is request failure reply (ex.: 404 Not Found)
- Class 5 or 5XX or range from 500 to 599, is server failure (ex.: 500 Server Failure)
- Class 6 or 6XX or range from 600 to 699, is global failure (ex. 603 Decline)
a good article to read more about the subject: https://en.wikipedia.org/wiki/List_of_SIP_response_codes
Atenciosamente / Kind Regards / Cordialement / Un saludo,
Sérgio Charrua
On Wed, Aug 27, 2025 at 3:57 PM Fernando Lopes via sr-users sr-users@lists.kamailio.org wrote:
Thank you, it worked.
What are 2xx (3xx-6xx) replies? __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@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-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!