[asterisk-dev] [Code Review]: Add a SIP nat=auto setting

Terry Wilson reviewboard at asterisk.org
Fri Jan 27 10:55:32 CST 2012



> On Jan. 27, 2012, 9:53 a.m., Kevin Fleming wrote:
> > /trunk/channels/chan_sip.c, lines 16218-16219
> > <https://reviewboard.asterisk.org/r/1698/diff/2/?file=23678#file23678line16218>
> >
> >     If 'we' are behind a NAT? I don't this feature is related to *Asterisk* being behind a NAT at all. Instead of using personal pronouns, it would be best to refer to the entities involved by their proper designations, since that avoids confusion.
> 
> Terry Wilson wrote:
>     nat=auto would be settable via general or via peers, but setting it in general and overriding via peers could open up the possibility of peer discovery.

Oops, replied to the wrong one. Yeah, I put that comment in when I was trying to figure everything out, so I was kind of talking to myself. I should clean that up. :-)


- Terry


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1698/#review5330
-----------------------------------------------------------


On Jan. 26, 2012, 8:28 p.m., Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1698/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2012, 8:28 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> First, this patch as originally posted is from JIRA user pedro-garcia. It has been in JIRA for a long while, and has finally come up to be considered. There were some changes that I wanted to made to the original patch, so I tried contacting the author to get them to put the patch on reviewboard, but after a week I got no response. So, I'm putting the original patch up, then will immediately add a review with my changes. Many thanks to pedro-garcia for his contribution.
> 
> From the JIRA issue:
> 
> I have some devices in the following scenario:
> 
> Asterisk server with public IP address
> Mobile devices (clients):
> 
> When in internal network, no NAT between the client and the server
> When in "roaming" (i.e. a Hotel with WiFi), the client is behing a NAT
> When in 3G, operator transparent sip proxy so it looks as no NAT, but does not support symmetric RTP.
> Sometime, the device gets a public IP with no NAT at all.
> No NAT setting available in asterisk works for all these scenarios at the same time, and I can not request the user to activate different accounts depending on its location.
> 
> I have added a new NAT setting (nat=auto) to the current ones. When set, chan_sip auto detects from the Via header, the recv sockaddr, and the rport setting if the client is behind a NAT.
> 
> It also adds to cli interface results (sip show peer/s) info on this (so now you could see "N" for NAT and nothing for no NAT as before, "a" for auto detect no NAT, and "A" for autodetect NAT.
> 
> 
> This addresses bug ASTERISK-17860.
>     https://issues.asterisk.org/jira/browse/ASTERISK-17860
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_sip.c 352610 
>   /trunk/channels/sip/include/sip.h 352610 
>   /trunk/configs/sip.conf.sample 352610 
> 
> Diff: https://reviewboard.asterisk.org/r/1698/diff
> 
> 
> Testing
> -------
> 
> Lots of reloads with changing values, and registry natted and un-natted phones. I also set the nat_supertest in testsuite to run with nat=auto to make sure that it responded the same with existing and non-existing peers.
> 
> 
> Thanks,
> 
> Terry
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120127/bb7cd860/attachment.htm>


More information about the asterisk-dev mailing list