From kbdfck@gmail.com Thu Apr 16 19:23:42 2015 From: Dmitry Sytchev To: sr-users@lists.kamailio.org Subject: [SR-Users] Kamailio relays ACK of 200 OK to itself Date: Thu, 16 Apr 2015 20:23:36 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1473706591==" --===============1473706591== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all! I can't make my Kamailio to correctly relay stateful ACKs for 200 OK. It takes URI from Route: header and trying relay it to itself instead of sending it to host sent 200 OK. I don't understand why it can't match transaction and relay to correct host. Seems BYEs aren't relayed correctly either... 192.168.4.218 -> NAT 1.2.2.94 -> Kamailo (1.2.3.46, 1.2.2.219) -> 172.19.126.= 105 192.168.4.218 sends INVITE to 1.2.3.45 which relays it to 172.19.126.105. After 172.19.126.105 answers with 200 OK, it never gets ACK for it back. Instead, ACK relayed by proxy to 1.2.3.46 (one of proxy addresses). Example of original ACK: ACK sip:89211234567(a)172.19.126.105:5060 SIP/2.0. Via: SIP/2.0/UDP 192.168.4.218:5062;branch=3Dz9hG4bK1161188624. Route: . From: "0099977" ;tag=3D259196205. To: ;tag=3Das6bfd1fa1. Call-ID: 910089142(a)192.168.4.218. CSeq: 2 ACK. Contact: . Max-Forwards: 70. User-Agent: Yealink SIP-T46G 28.71.14.4. Content-Length: 0. It sees that host is not local: check_self: host !=3D me I think the problem is somewhere in my NAT handling script code, but seems I'm stuck and can't get what am I doing wrong, so I'll greatly appreciate any help. Apr 16 19:21:33 kam-sbc-1-01 /usr/sbin/kamailio[9178]: DEBUG: [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq : <2> Apr 16 19:21:33 kam-sbc-1-01 /usr/sbin/kamailio[9178]: DEBUG: maxfwd [mf_funcs.c:85]: is_maxfwd_present(): value =3D 70 Apr 16 19:21:33 kam-sbc-1-01 /usr/sbin/kamailio[9178]: DEBUG: [parser/msg_parser.c:204]: get_hdr_field(): DEBUG: get_hdr_body : content_length=3D0 Apr 16 19:21:33 kam-sbc-1-01 /usr/sbin/kamailio[9178]: DEBUG: [parser/msg_parser.c:106]: get_hdr_field(): found end of header Apr 16 19:21:33 kam-sbc-1-01 /usr/sbin/kamailio[9178]: DEBUG: sanity [mod_sanity.c:255]: w_sanity_check(): sanity checks result: 1 Apr 16 19:21:33 kam-sbc-1-01 /usr/sbin/kamailio[9178]: INFO: