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
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 to the very top of the request_route section:
request_route {
if ( is_method("ACK") ) {t_check_trans();$var(error) = $rc;xlog("L_ERR", "[CATCH_ACK] m=$rm cseq=$cs ru=$ru err=$var(error) [$ci]");}....
And as a result, I detected in syslog:
May 7 16:15:34 test-edge /usr/sbin/kamailio[11642]: ERROR: <script>: [CATCH_ACK] m=ACK cseq=153 ru=sip:mod_sofia@10.0.7.3:5060 err=-1 [051e7c50-0b10-1239-2996-001dd8b71cb2]
SIP re-INVITE (hold) from Phone:
2020/05/07 16:15:34.629973 176.6.4.6:1024 -> 185.9.7.7:5060INVITE sip:mod_sofia@10.0.7.3:5060 SIP/2.0Via: SIP/2.0/UDP 192.168.11.111:5060;branch=z9hG4bK00475de2da8eea118ec67caaaddc98fb;rportFrom: <sip:312222222222@10.0.7.6>;tag=00dfd3d8da8eea118ec67caaaddc98fbTo: "Denys VOIP" <sip:5008@185.9.7.7>;tag=54Q0XNHgXBUvpCall-ID: 051e7c50-0b10-1239-2996-001dd8b71cb2CSeq: 153 INVITEContent-Type: application/sdpAllow: INVITE, ACK, BYE, CANCEL, INFO, MESSAGE, NOTIFY, OPTIONS, REFER, UPDATE, PRACKMax-Forwards: 70Supported: 100rel, replaces, from-change, gruuUser-Agent: SIPPER for PhonerLiteContent-Length: 313
v=0o=- 3858283927 2 IN IP4 192.168.11.111s=SIPPER for PhonerLitec=IN IP4 192.168.11.111t=0 0m=audio 5062 RTP/AVP 8 0 9 107 101a=rtpmap:8 PCMA/8000a=rtpmap:0 PCMU/8000a=rtpmap:9 G722/8000a=rtpmap:107 opus/48000/2a=rtpmap:101 telephone-event/8000a=fmtp:101 0-16a=ssrc:782125221a=sendonly
SIP 407 from Kamailio:
2020/05/07 16:15:34.632298 185.9.7.7:5060 -> 176.6.4.6:1024SIP/2.0 407 Proxy Authentication RequiredVia: SIP/2.0/UDP 192.168.11.111:5060;branch=z9hG4bK00475de2da8eea118ec67caaaddc98fb;rport=1024;received=176.6.4.6From: <sip:312222222222@10.0.7.6>;tag=00dfd3d8da8eea118ec67caaaddc98fbTo: "Denys VOIP" <sip:5008@185.9.7.7>;tag=54Q0XNHgXBUvpCall-ID: 051e7c50-0b10-1239-2996-001dd8b71cb2CSeq: 153 INVITEProxy-Authenticate: Digest realm="185.9.7.7", nonce="XrQaXjfjyrftyrtiyrft7uO"Server: kamailio (5.2.2 (x86_64/linux))Content-Length: 0
SIP ACK from Phone:
2020/05/07 16:15:34.672872 176.6.4.6:1024 -> 185.9.7.7:5060ACK sip:mod_sofia@10.0.7.3:5060 SIP/2.0Via: SIP/2.0/UDP 192.168.11.111:5060;branch=z9hG4bK00475de2da8eea118ec67caaaddc98fb;rportFrom: <sip:312222222222@10.0.7.6>;tag=00dfd3d8da8eea118ec67caaaddc98fbTo: "Denys VOIP" <sip:5008@185.9.7.7>;tag=54Q0XNHgXBUvpCall-ID: 051e7c50-0b10-1239-2996-001dd8b71cb2CSeq: 153 ACKContent-Length: 0
SIP ACK (unwanted) from Kamailio to Core:
2020/05/07 16:15:34.675546 10.0.7.5:5060 -> 10.0.7.6:5060ACK sip:mod_sofia@10.0.7.3:5060 SIP/2.0Max-Forwards: 10Via: SIP/2.0/UDP 10.0.7.5;branch=z9hG4bK0d46.c33c3556c3cffbac49e717352b3575f6.0Via: SIP/2.0/UDP 192.168.11.111:5060;received=176.6.4.6;branch=z9hG4bK00475de2da8eea118ec67caaaddc98fb;rport=1024From: <sip:312222222222@10.0.7.6>;tag=00dfd3d8da8eea118ec67caaaddc98fbTo: "Denys VOIP" <sip:5008@185.9.7.7>;tag=54Q0XNHgXBUvpCall-ID: 051e7c50-0b10-1239-2996-001dd8b71cb2CSeq: 153 ACKContent-Length: 0loose-route: done
IP addresses and call-flow:
Core (10.0.7.6) --> [ Kamailio (10.0.7.5) -> Kamailio (185.9.7.7) ] --> Phone (176.6.4.6)
[root@test-edge kamailio]$ kamailio -v
version: kamailio 5.2.2 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 19:29:40 Jun 20 2019 with gcc 4.8.5
--
BR,Denys Pozniak
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla