[asterisk-users] SPA-2102 sending local IP instead of WAN IP in SIP packets

Kevin P. Fleming kpfleming at digium.com
Mon Oct 11 07:21:37 CDT 2010


On 10/09/2010 01:34 PM, bruce bruce wrote:
> And that is exactly what is done on the device: Nat=yes but Asterisk
> still sees the SIP packet coming in to register with a local IP an so it
> responds to a local IP which doesn't even exist on the Asterisk network.
> This is what frustrates me that it's not so straight forward to Asterisk
> to obtain the proper public IP of the device from the IP packet headers
> rather than the SIP packets.

'nat=yes on the device' doesn't really make any sense; does that mean
you set some sort of NAT setting on the *device* itself, or does it mean
you set 'nat=yes' in the device's peer entry in the Asterisk sip.conf file?

If 'nat=yes' is set in the relevant sip.conf peer entry for that device,
and Asterisk is properly selecting that entry when the device registers,
then Asterisk *will* respond the device's "apparent" IP address and port
number, regardless of the address the device includes in the Contact
header of the REGISTER request. Setting 'nat=yes' is exactly how you
tell Asterisk to use the IP address from the IP header of the packet
instead of the address in the SIP message.

As I said before, there are likely hundreds of thousands (if not
millions) of endpoints registering to Asterisk systems all over the
world every day using this mechanism and it works just fine. If it's not
working for you, there is some sort of configuration problem.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list