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@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@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/>
Olle E. Johansson
2003-Oct-24 08:05 UTC
[Asterisk-Users] Asterisk behind NAT to SIP provider
Jonathan Hogg wrote:> 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.If you've travelled around the archives, you should now that this is a FAQ. At this moment, Asterisk behind a NAT can't connect to an outside SIP provider. If you put asterisk outside your NAT, your inside clients can connect to Asterisk and Asterisk will be able to connect to your providers. There are bug reports, web pages and mail in the archive that document this. Start at http://www.voip-info.org - click on Asterisk. /O