[svn-commits] eliel: branch 1.6.1 r197696 - in /branches/1.6.1: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu May 28 13:26:55 CDT 2009


Author: eliel
Date: Thu May 28 13:26:50 2009
New Revision: 197696

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=197696
Log:
Merged revisions 197621 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r197621 | eliel | 2009-05-28 12:01:48 -0400 (Thu, 28 May 2009) | 19 lines
  
  Merged revisions 197562 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r197562 | eliel | 2009-05-28 11:21:32 -0400 (Thu, 28 May 2009) | 13 lines
    
    Use the address we already know when reloading a peer with nat=yes.
    
    If we already have an address for a peer, and we are reloading the sip
    configuration, try to use that address to contact the peer, instead of
    getting it from the Contact.
    
    (closes issue #15194)
    Reported by: ibc
    Patches:
          sip.patch uploaded by eliel (license 64)
          Tested by: manwe
  ........
................

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

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=197696&r1=197695&r2=197696
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Thu May 28 13:26:50 2009
@@ -22168,10 +22168,13 @@
 		 * address listed on the entry (or if it's 'dynamic'), then we need to
 		 * parse the entry to obtain the IP address, so a dynamic host can be
 		 * contacted immediately after reload (as opposed to waiting for it to
-		 * register once again). */
+		 * register once again). But if we have an address for this peer and NAT was
+		 * specified, use that address instead. */
 		/* XXX May need to revisit the final argument; does the realtime DB store whether
 		 * the original contact was over TLS or not? XXX */
-		__set_address_from_contact(fullcontact->str, &peer->addr, 0);
+		if (!ast_test_flag(&peer->flags[0], SIP_NAT_ROUTE) || !peer->addr.sin_addr.s_addr) {
+			__set_address_from_contact(fullcontact->str, &peer->addr, 0);
+		}
 	}
 
 	if (srvlookup && peer->dnsmgr == NULL) {




More information about the svn-commits mailing list