[asterisk-dev] [Code Review] Add a SIP nat=auto setting
Terry Wilson
reviewboard at asterisk.org
Wed Feb 8 23:34:35 CST 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1698/
-----------------------------------------------------------
(Updated Feb. 8, 2012, 11:34 p.m.)
Review request for Asterisk Developers.
Changes
-------
Implement changes proposed by Kevin Fleming here: http://lists.digium.com/pipermail/asterisk-dev/2012-February/053586.html
The nat= setting is now a comma separated list of combinable options. nat=yes, while handled, is now an undocumented option replaced by nat=force_rport,comedia. That nat=auto option has been split into nat=auto_force_rport,auto_comedia. When parsing that nat= line, the first 'yes' or 'no' will cause parsing to stop and override any previous options. If an auto_ option is set at the same time its non-auto_ counterpart is set, the auto setting is honored.
I added some helper functions for displaying the textual output of the force_rport and comedia options for CLI use. They are declared in the existing channels/sip/include/sip_utils.h file, but implemented in a new file channels/sip/utils.c. There are several other functions in that header that should probably be moved over from chan_sip.c later.
The parser function for the nat= setting was added to channels/sip/config_parser.c. I added a unit test for it as well.
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.
More information about the asterisk-dev
mailing list