[asterisk-commits] mmichelson: branch 11 r375437 - in /branches/11: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 29 16:23:32 CDT 2012


Author: mmichelson
Date: Mon Oct 29 16:23:25 2012
New Revision: 375437

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=375437
Log:
Prevent resetting of NATted realtime peer address on reload.

If a "sip reload" is issued for a SIP peer, then his
IP address will be cleared, thus resulting in forgetting the
public IP address. Asterisk will then attempt to route SIP
traffic to the private IP address.

The fix here is to make "sip reload" ignore realtime peers
when "host = dynamic" is spotted. Realtime peers can now only
have their IP address reset if they have gone from being not
dynamic to being dynamic.

(closes issue ASTERISK-18203)
reported by daren ferreira

(closes issue ASTERISK-20572)
reported by JoshE
Patches:
	fix_nat_realtime.diff uploaded by JoshE (license #6075)
........

Merged revisions 375415 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375417 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    branches/11/   (props changed)
    branches/11/channels/chan_sip.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: branches/11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_sip.c?view=diff&rev=375437&r1=375436&r2=375437
==============================================================================
--- branches/11/channels/chan_sip.c (original)
+++ branches/11/channels/chan_sip.c Mon Oct 29 16:23:25 2012
@@ -30277,7 +30277,7 @@
 			} else if (!strcasecmp(v->name, "host")) {
 				if (!strcasecmp(v->value, "dynamic")) {
 					/* They'll register with us */
-					if (!found || !peer->host_dynamic) {
+					if ((!found && !realtime) || !peer->host_dynamic) {
 						/* Initialize stuff if this is a new peer, or if it used to
 						 * not be dynamic before the reload. */
 						ast_sockaddr_setnull(&peer->addr);




More information about the asterisk-commits mailing list