From miconda@gmail.com Mon May 11 13:56:39 2020 From: Daniel-Constantin Mierla To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] How Kamailio processes SIP ACK on local 4XX reply? Date: Mon, 11 May 2020 13:56:31 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1209795826==" --===============1209795826== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, the problem here is that the ACK has Route headers and looks like the ACK inside dialog. The 407 is for a re-INVITE, so the To-tag is present, it is not generated by sl module to be able to filter it out. It gets to config where the requests are routed using loose_route() like a request part of a dialog. I haven't checked the specs right not for a 100% accurate answer, but ACK for a failure code is hop-by-hop, it should have no Route headers, being intended for next hop only, and I expect most UA implementation do it like this, not having similar reports in more or less 20 years. If the ACK will be without Route headers, it should be stopped locally. You can try to play with the order of checks for transaction and use of other tm functions to detect such case (eventually combined with htable) and drop the ACK. Cheers, Daniel On 07.05.20 17:10, Denys Pozniak wrote: > Hello! > > I have some misunderstanding regarding the processing of SIP ACK on > local Kamailio 4xx reply (eg 407 Proxy Authentication Required). > In the picture below you can see that such a message just goes through > the proxy and moreover gets into the *request_route* section. > I expect this SIP ACK to be consumed by the sl module without hitting > script logic. > > > > I put the part below=C2=A0to the very top of the *request_route* section: > > *request_route* { > > if ( is_method("ACK") ) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 t_check_trans(); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 $var(error) =3D $rc; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 xlog("L_ERR", "[CATCH_ACK] m=3D$rm cseq=3D$= cs ru=3D$ru > err=3D$var(error) [$ci]"); > } > .... > > > And as a result, I detected in syslog: > > May =C2=A07 16:15:34 test-edge /usr/sbin/kamailio[11642]: ERROR: >