Hello,
I think I have found two bugs in nathelper in Kamailio 3.1.3.
Has anyone else encountered these?
Bug one -------
nat_uac_test() doesn't seem to work for requests that arrive over UDP. I tried with the latest versions of X-Lite and Jitsi for Windows and observed the same behaviour with both. As far as I could tell the UDP and TCP REGISTER methods were identical except for transport, Call-ID, tags (and so on).
At the moment I have worked around this by treating all UDP requests as if they have come from behind a NAT - but this is not ideal.
Bug Two -------
nat_uac_test() with flag bit 8 (SDP checks) set fails with an error if the request does not contain SDP. I don't think this is correct behaviour as it seems quite sensible to me to push all requests through the same NAT detection route. In this case it is quite likely that only some of the methods will contain SDP.
Surely in this case the correct thing would be for the SDP checks to fail, but not be treated as an error?
Thanks for you help,
Peter
I tried 63 (all), 55 (all but SDP), and 19 (from the sample configuration file).
I will try it again today.
Peter
On Sat, 2011-04-09 at 08:10 +0300, Juha Heinanen wrote:
Peter Dunkley writes:
nat_uac_test() doesn't seem to work for requests that arrive over UDP.
i don't know which param you tried, but nat_uac_test("2") and nat_uac_test("1") works for me.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
I have done some more detailed testing today and am still seeing the problem. I am using Kamailio 3.1.3.
I added the following to the beginning of my route{ } section:
if (nat_uac_test(flags)) xlog("NAT'd\n");
I then tested the following scenarios using X-Lite 4:
* Flags = 1, TCP: NAT detected, UDP: NAT not detected * Flags = 2, TCP: NAT detected, UDP: NAT not detected * Flags = 4, TCP: NAT detected, UDP: NAT not detected * Flags = 8, TCP: NAT not detected, UDP: NAT not detected * Flags = 16, TCP: NAT detected, UDP: NAT not detected * Flags = 32, TCP: NAT not detected, UDP: NAT not detected
The REGISTERs (for TCP and UDP) sent by X-Lite were (with domain and user name obscured here):
REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/TCP 192.168.0.187:15854;branch=z9hG4bK-d8754z-1c8ee3e957b12a9b-1---d8754z-;rport Max-Forwards: 70 Contact: sip:user@192.168.0.187:15854;rinstance=80c5894ae6e2ce6f;transport=TCP To: "User"sip:user@example.com From: "User"sip:user@example.com;tag=da2c294e Call-ID: NjA3YjNiNDdjZTgwNWVkYzZlOGRkZTU0NTkxNDlkZWQ. CSeq: 1 REGISTER Expires: 25 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO User-Agent: X-Lite 4 release 4.0 stamp 58832 Content-Length: 0
REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP 192.168.0.187:53264;branch=z9hG4bK-d8754z-a959b8f7e5f1e349-1---d8754z-;rport Max-Forwards: 70 Contact: sip:user@192.168.0.187:53264;rinstance=d601b2ea0398567c;transport=udp To: "Peter Dunkley"sip:user@example.com From: "Peter Dunkley"sip:user@example.com;tag=753afc8a Call-ID: NjBmZmFhNjEzNTFkZGZlMWQwNzdlZjlkYTE1OTc4ZGU. CSeq: 1 REGISTER Expires: 25 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO User-Agent: X-Lite 4 release 4.0 stamp 58832 Content-Length: 0
Regards,
Peter
On Mon, 2011-04-11 at 10:32 +0100, Peter Dunkley wrote:
I tried 63 (all), 55 (all but SDP), and 19 (from the sample configuration file).
I will try it again today.
Peter
On Sat, 2011-04-09 at 08:10 +0300, Juha Heinanen wrote:
Peter Dunkley writes:
nat_uac_test() doesn't seem to work for requests that arrive over UDP.
i don't know which param you tried, but nat_uac_test("2") and nat_uac_test("1") works for me.
-- juha
I found the problem. My LAN router had the very helpful SIP application gateway setting turned on. This was changing the IP addresses in some, but not all, SIP messages that passed through it - and only from UDP.
From Kamailio's point-of-view I was not behind a NAT. However, the
application gateway setting itself still wasn't doing enough to make calls work.
Thanks for you help,
Peter
On Mon, 2011-04-11 at 17:36 +0300, Juha Heinanen wrote:
Peter Dunkley writes:
if (nat_uac_test(flags)) xlog("NAT'd\n");
put xlog call printing contact header before the if, replace flags with "1", and add also else part. then make the udp test and send result to the list.
-- juha
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev