Summary:ASTERISK-16386: [patch] Regression: Externip has port set to 0
Reporter:Mark Michelson (mmichelson)Labels:
Date Opened:2010-07-16 14:28:10Date Closed:2010-07-19 12:16:24
Versions:Frequency of
Environment:Attachments:( 0) 17665.diff#2
( 1) asterisk-trunk-bugid17665.patch
Description:It appears that the IPv6 merge has introduced an error in ast_sip_ouraddrfor() such that the externip does not properly have its port set.
Comments:By: Mark Michelson (mmichelson) 2010-07-16 14:56:31

I have uploaded 17665.diff to the issue. It has two main changes.

1. Since externip can have a port specified, the name of the option is a misnomer. All documentation has been adjusted to call it "externaddr" instead. This also extends to the "matchexterniplocally" option. The old names will still be accepted by the configuration parser, but they are no longer documented.

2. ast_sip_ouraddrfor() has been updated so that if using UDP and the externaddr has no port set, we use the port from bindaddr instead.

By: Philip Prindeville (pprindeville) 2010-07-16 19:45:15

Your patch is missing r276909.  Please update your checkout, and then repost.

By: Philip Prindeville (pprindeville) 2010-07-16 19:51:59

Tested (as amended with r276909).  Confirmed to work.

By: Digium Subversion (svnbot) 2010-07-19 12:16:23

Repository: asterisk
Revision: 277873

U   trunk/channels/chan_sip.c
U   trunk/channels/sip/include/sip.h
U   trunk/configs/sip.conf.sample

r277873 | mmichelson | 2010-07-19 12:16:22 -0500 (Mon, 19 Jul 2010) | 24 lines

Fix port setting of external address in SIP.

There are two changes here:

1. Since the externip setting can now have a port attached
to it, calling it "externip" is misleading. The option is now
documented and parsed as "externaddr." This also extends to the
"matchexterniplocally" setting. It is now documented and parsed
as "matchexternaddrlocally." The old names for the options may
still be used, but they are no longer used in the sip.conf.sample

2. If no port is set for the externaddr, and UDP is the transport
to be used, then we will set the port of the externaddr to that of
the udpbindaddr. This was how things worked prior to the IPv6 merge,
so this is a regression fix.

(closes issue ASTERISK-16386)
Reported by: mmichelson
     17665.diff#2 uploaded by pprindeville (license 347)
Tested by: pprindeville