[asterisk-commits] file: branch 1.6.1 r163640 - in /branches/1.6.1: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 12 12:19:34 CST 2008


Author: file
Date: Fri Dec 12 12:19:33 2008
New Revision: 163640

URL: http://svn.digium.com/view/asterisk?view=rev&rev=163640
Log:
Merged revisions 163629 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r163629 | file | 2008-12-12 14:17:12 -0400 (Fri, 12 Dec 2008) | 4 lines
  
  When a device registers we need to unlink them (if linked) from the peers_by_ip container and link them back in since their IP address has changed. This would have manifested itself if you configured a new device (as type=peer), registered, and then tried to place a call from the device. Since the peer was not linked into the peers_by_ip container it would have never been found.
  (closes issue #13811)
  Reported by: pj
........

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.digium.com/view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=163640&r1=163639&r2=163640
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Fri Dec 12 12:19:33 2008
@@ -10492,6 +10492,11 @@
 
 	oldsin = peer->addr;
 
+	/* If we were already linked into the peers_by_ip container unlink ourselves so nobody can find us */
+	if (peer->addr.sin_addr.s_addr) {
+		ao2_t_unlink(peers_by_ip, peer, "ao2_unlink of peer from peers_by_ip table");
+	}
+
 	/* Check that they're allowed to register at this IP */
 	/* XXX This could block for a long time XXX */
 	hp = ast_gethostbyname(host, &ahp);
@@ -10519,6 +10524,9 @@
 		   with */
 		peer->addr = pvt->recv;
 	}
+
+	/* Now that our address has been updated put ourselves back into the container for lookups */
+	ao2_t_link(peers_by_ip, peer, "ao2_link into peers_by_ip table");
 
 	/* Save SIP options profile */
 	peer->sipoptions = pvt->sipoptions;




More information about the asterisk-commits mailing list