[asterisk-dev] dvossel: trunk r222398 - in /trunk: channels/chan_sip.c configs/sip.conf.sample
Russell Bryant
russell at digium.com
Tue Oct 6 18:47:31 CDT 2009
SVN commits to the Digium repositories wrote:
> Author: dvossel
> Date: Tue Oct 6 17:39:56 2009
> New Revision: 222398
>
> URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=222398
> Log:
> contact header port ignored transport when using externip
>
> This patch adds support for TCP/TLS in the Contact header when using
> NAT, specifically externip or externhost. The original issue was that
> Asterisk sent 5060 as the port in the contact header whether TLS was
> used or not. Additionally, this patch adds 2 config options to sip.conf,
> specifically externtcpport and externtlsport. This allows a user to
> specify different external ports for TCP and TLS other than those used
> internally, this is especially useful in in a PAT/port redirection setup.
> Thanks to ebroad for reporting the issue and providing the patch!
>
> (closes issue #15880)
> Reported by: ebroad
> Patches:
> portmap.patch uploaded by ebroad (license 878)
> externtXXport_v2.patch uploaded by ebroad (license 878)
> Tested by: ebroad
>
> Review: https://reviewboard.asterisk.org/r/392/
>
>
> Modified:
> trunk/channels/chan_sip.c
> trunk/configs/sip.conf.sample
>
> Modified: trunk/channels/chan_sip.c
> URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=222398&r1=222397&r2=222398
> ==============================================================================
> --- trunk/channels/chan_sip.c (original)
> +++ trunk/channels/chan_sip.c Tue Oct 6 17:39:56 2009
> @@ -2329,6 +2329,8 @@
> static time_t externexpire; /*!< Expiration counter for re-resolving external host name in dynamic DNS */
> static int externrefresh = 10; /*!< Refresh timer for DNS-based external address (dyndns) */
> static struct sockaddr_in stunaddr; /*!< stun server address */
> +uint16_t externtcpport = STANDARD_SIP_PORT; /*!< external tcp port */
> +uint16_t externtlsport = STANDARD_TLS_PORT; /*!< external tls port */
These variables should be marked as static. Also, since the config
parser sets the defaults on every run, the values do not need to be
specified here. By doing so, you can save 4 bytes in the resulting
binary. :-)
--
Russell Bryant
Digium, Inc. | Engineering Manager, Open Source Software
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