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

Kevin P. Fleming kpfleming at digium.com
Wed Feb 8 08:42:55 CST 2012


On 01/27/2012 03:28 PM, Saúl Ibarra Corretgé wrote:
> Hi Kevin,
>
>>>
>>> +1, I think nat=auto is a really good thing and it should be the default.
>>
>>
>> Can you explain *why* you think it is valuable? (and before doing so, please
>> the comment I just made on reviewboard)
>>
>
> I might be missing something, but this is my reasoning:
>
> Currently the default setting for nat is force_rport, which means that
> SIP will work, but RTP will not, since comedia mode is no enabled.
> Personally, I would set nat=yes by default, but I guess there are
> devices that don't like this too much. I've been lucky not to run into
> them yet :-)
>
> This new setting (if I got it correctly) would toggle the same
> machinery as nat=yes if the source is behind nat, which I believe it's
> a good idea, an SIP account should work on any condition.
>
> Also, FWIW, a free SIP service we offer at work forces rport always
> (if source is behind NAT) and we use MediaProxy for media relaying, so
> comedia is always used.
>
> I'm all in for flexible settings, but I believe configuration defaults
> should try to cover most use cases.

Well, I meant to talk to Saul about this on Sunday, but forgot...

After thinking about it some more, I am in agreement that having an 
automatic mode to enable 'comedia' is warranted.

I'm still not in favor of having an 'aggregated' setting like 'auto' 
though; over the years we've run into plenty of cases where having 
aggregated settings ended up causing problems, and we had to split them 
apart. So, my proposal for this feature is to add an 'auto_comedia' 
option for the 'nat' setting, and change the default to 
'force_rport,auto_comedia'.

Comments?

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



More information about the asterisk-dev mailing list