[Serdev] nathelper.c version 1.81 fix_nated_register()
Norman Brandinger
norm at goes.com
Thu Mar 31 04:24:47 UTC 2005
There appears to be a problem when using the fix_nated_register()
function. It may be that nathelper.c is operating correctly, but that the
source ip within the sip_msg being passed to it hasn't been built
properly.
Summary:
I have a device with a private address that is connected to the 24.x.x.x
network. Below is some information that was produced when the device
REGISTERs. Needless to say, no calls work to this device.
1) SER debugging output showing the public 24.x.x.x address as well as the
private address of the device:
...
check_via_address(24.115.57.202, 192.168.1.101, 0)
...
2) SER debugging output that was added to nathelper.c. Note that both
source and destination IP addresses appear to be the same. I don't know if
this is correct, but I don't think so. Notice that the source ip length
of 13 is correct for the 24.x.x.x address, but isn't for the 209.x.x.x
address. It appears that the port numbers are correct.
create_rcv_uri: src_ip.s 209.102.227.246 src_ip.len 13
create_rcv_uri: src_port.s 15060
create_rcv_uri: dst_ip.s 209.102.227.246 dst_ip.len 15
create_rcv_uri: dst_port.s 5060
3) The important columns of the location table. Notice that the Received
sip: IP address (if we assume that 209.x.x.x is correct -- I don't think
that it is) appeares to have been truncated to a length of 13.
Contact: sip:8126 at 192.168.1.101:5060
Received: sip:209.102.227.2:15060;dstip=209.102.227.246;dstport=5060
4) Source of nathelper.c that shows added debugging code
src_ip.s = ip_addr2a(&m->rcv.src_ip);
src_ip.len = strlen(src_ip.s);
src_port.s = int2str(m->rcv.src_port, &src_port.len);
dst_ip.s = ip_addr2a(&m->rcv.dst_ip);
dst_ip.len = strlen(dst_ip.s);
dst_port.s = int2str(m->rcv.dst_port, &dst_port.len);
LOG(L_DBG, "create_rcv_uri: src_ip.s %s src_ip.len %d\n",
src_ip.s,src_ip.len);
LOG(L_DBG, "create_rcv_uri: src_port.s %s\n", src_port.s);
LOG(L_DBG, "create_rcv_uri: dst_ip.s %s dst_ip.len %d\n",
dst_ip.s,dst_ip.len);
LOG(L_DBG, "create_rcv_uri: dst_port.s %s\n", dst_port.s);
5) The Contact column in the location table after changing
fix_nated_register() to fix_nated_contact().
Contact: sip:8126 at 24.115.57.202:15060
Regards,
Norman Brandinger
GOES Telecom
norm at goes dot com
More information about the Serdev
mailing list