[Asterisk-Users] Asterisk behind NAT to SIP provider

Jonathan Hogg jonathan.hogg at seventh-wave-systems.com
Fri Oct 24 07:11:03 MST 2003


Hi all,

OK. I've tried trawling the archives, but I'm not getting very far. I've got
an Asterisk box behind a NAT which I want to register with a SIP provider.

In my sip.conf I have (edited to protect the innocent):

-----
[general]
port = 5060
bindaddr = 0.0.0.0
disallow = all
allow = alaw
allow = ulaw
allow = gsm
context = bogus-calls
tos = lowdelay
nat = yes
register => 8703405315:xxxx at sip-provider.not

[8703405315]
type = friend
reinvite = no
canreinvite = no
nat = yes
username = 8703405315
secret = xxxx
context = from-sip-provider
-----

With 'sip debug' on, I can see it sending the REGISTER requests and getting
back a response with STUN headers like so (also edited):

-----
SIP/2.0 407 Proxy Authorization Required
X-Stun-Server: w.x.y.z:3478
X-Observed-Adr: a.b.c.d
...
-----

However, when Asterisk sends the auth it doesn't sends the REGISTER again to
the same address without seeming to take into account the STUN details, a
la:

-----
REGISTER sip:sip-provider.not SIP/2.0
Via: SIP/2.0/UDP 10.20.15.4:5060;branch=z9hG4bK43e3ead5
...
Contact: <sip:s at 10.20.15.4>
...
-----

This results in me getting a "406 Bad Contact (NAT)" response.

My questions:

 a) Does Asterisk support what I want to do (please don't tell me to use
    IAX instead - I am already talking to the provider about that, but they
    are in the early stages of playing with Asterisk)?

 b) What have I done wrong in my sip.conf? I've been hacking it around for a
    while this afternoon so it's a bit of a mess of mangled attempts to make
    it work.

Any help gratefully appreciated.

Jonathan

-- 
Jonathan Hogg
Director, Technology

Seventh Wave Systems Ltd.
4-14 Tabernacle Street
London EC2A 4LU
Telephone: +44 20 7074 0423

<http://www.seventh-wave-systems.com/>




More information about the asterisk-users mailing list