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

Saúl Ibarra Corretgé saghul at gmail.com
Fri Jan 27 11:29:12 CST 2012


> > it turns on *both* force_rport and comedia when NAT is detected, and there could definitely be situations where that results in broken calls.
>
> Yes. This is a feature for nat=auto, so whether to set nat=yes or nat=no automatically--it isn't a way to magically figure out what crazy set of circumstances might possibly be in play between the endpoint and Asterisk (something that is pretty much impossible to determine without some more help from the client). In my opinion, this is a documentation issue. It should be thoroughly documented that this will just pick between those two options.
>
> The nat settings aren't bitfields/combinable, so we would end up with auto_force_rport, auto_comedia, and auto_everystuff for, what I would imagine to be a vanishingly small percentage of users who would use them. Searching with google, I get the impression that the vast majority of people use nat=yes and the greatest minority uses nat=no. If the idea is to create a type that just "tries to do the right thing" for clients that move between many different networks, I don't see how adding the more specialized options help. You still aren't going to be able to support networks that look natted and require comedia and ones that look natted and don't support comedia at the same time. The only way I can think of it being used is if a client moves *only* between some very specific networks (always stays at the same hotel?), with very specific requirements for each.
>
> We've made it a decade without anyone submitting this patch. I bet that if we accepted it, it would be another decade before anyone said "What I really need is the ability to move between only these two very specific networks."
>
> As far as users being confused that automatic doesn't work, well, users are confused when the default (whatever it may be) doesn't work. This patch makes things work for situations that wouldn't have worked without it. If it doesn't work for a situation, users still have to learn how things work just like they do now--this is no change from how things currently are. But, things also might "just work" for a larger number of cases. And that is a win for everybody, IMHO.


+1, I think nat=auto is a really good thing and it should be the default.

--
/Saúl
http://saghul.net | http://sipdoc.net



More information about the asterisk-dev mailing list