[svn-commits] lmadsen: tag 1.8.4-rc2 r308988 - in /tags/1.8.4-rc2: ./ channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Feb 25 14:21:43 CST 2011


Author: lmadsen
Date: Fri Feb 25 14:21:38 2011
New Revision: 308988

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=308988
Log:
Update .version, ChangeLog, and merge patch from r308945

Modified:
    tags/1.8.4-rc2/.version
    tags/1.8.4-rc2/ChangeLog
    tags/1.8.4-rc2/channels/chan_sip.c

Modified: tags/1.8.4-rc2/.version
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4-rc2/.version?view=diff&rev=308988&r1=308987&r2=308988
==============================================================================
--- tags/1.8.4-rc2/.version (original)
+++ tags/1.8.4-rc2/.version Fri Feb 25 14:21:38 2011
@@ -1,1 +1,1 @@
-1.8.4-rc1
+1.8.4-rc2

Modified: tags/1.8.4-rc2/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4-rc2/ChangeLog?view=diff&rev=308988&r1=308987&r2=308988
==============================================================================
--- tags/1.8.4-rc2/ChangeLog (original)
+++ tags/1.8.4-rc2/ChangeLog Fri Feb 25 14:21:38 2011
@@ -1,3 +1,11 @@
+2011-02-25  Leif Madsen <lmadsen at digium.com>
+
+	* Asterisk 1.8.4-rc2 Released.
+
+	* Fix Deadlock with attended transfer of SIP call
+	  (Closes issue #18837. Reported, patched by alecdavis. Tested by
+	  alecdavid, Irontec, ZX81, cmaj)
+
 2011-02-23  Leif Madsen <lmadsen at digium.com>
 
 	* Asterisk 1.8.4-rc1 Released.

Modified: tags/1.8.4-rc2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4-rc2/channels/chan_sip.c?view=diff&rev=308988&r1=308987&r2=308988
==============================================================================
--- tags/1.8.4-rc2/channels/chan_sip.c (original)
+++ tags/1.8.4-rc2/channels/chan_sip.c Fri Feb 25 14:21:38 2011
@@ -27613,7 +27613,20 @@
 	if (!p) {
 		return -1;
 	}
+	/*
+	 * Lock both the pvt and it's owner safely.
+	 */
 	sip_pvt_lock(p);
+	while (p->owner && ast_channel_trylock(p->owner)) {
+		sip_pvt_unlock(p);
+		usleep(1);
+		sip_pvt_lock(p);
+	}
+
+	if (!p->owner) {
+		sip_pvt_unlock(p);
+		return 0;
+	}
 	if (udptl) {
 		ast_udptl_get_peer(udptl, &p->udptlredirip);
 	} else {
@@ -27632,6 +27645,7 @@
 	}
 	/* Reset lastrtprx timer */
 	p->lastrtprx = p->lastrtptx = time(NULL);
+	ast_channel_unlock(p->owner);
 	sip_pvt_unlock(p);
 	return 0;
 }
@@ -27748,12 +27762,25 @@
 	if (!ast_bridged_channel(chan) && !sip_cfg.directrtpsetup) 	/* We are in early state */
 		return 0;
 
-	ast_channel_lock(chan);
+	/*
+	 * Lock both the pvt and it's owner safely.
+	 */
 	sip_pvt_lock(p);
+	while (p->owner && ast_channel_trylock(p->owner)) {
+		sip_pvt_unlock(p);
+		usleep(1);
+		sip_pvt_lock(p);
+	}
+
+	if (!p->owner) {
+		sip_pvt_unlock(p);
+		return 0;
+	}
+
 	if (p->alreadygone) {
 		/* If we're destroyed, don't bother */
+		ast_channel_unlock(p->owner);
 		sip_pvt_unlock(p);
-		ast_channel_unlock(chan);
 		return 0;
 	}
 
@@ -27761,8 +27788,8 @@
 	   that are known to be behind a NAT, then stop the process now
 	*/
 	if (nat_active && !ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA_NAT)) {
+		ast_channel_unlock(p->owner);
 		sip_pvt_unlock(p);
-		ast_channel_unlock(chan);
 		return 0;
 	}
 
@@ -27804,8 +27831,8 @@
 	}
 	/* Reset lastrtprx timer */
 	p->lastrtprx = p->lastrtptx = time(NULL);
+	ast_channel_unlock(p->owner);
 	sip_pvt_unlock(p);
-	ast_channel_unlock(chan);
 	return 0;
 }
 




More information about the svn-commits mailing list