[svn-commits] dvossel: trunk r187673 - /trunk/apps/app_dial.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Apr 10 10:49:19 CDT 2009


Author: dvossel
Date: Fri Apr 10 10:49:16 2009
New Revision: 187673

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=187673
Log:
Even more changes concerning r187426. Revised where locks are placed yet once again.  ast_call() should not be called with a channel locked.  could cause deadlock issues with local channels. 

Modified:
    trunk/apps/app_dial.c

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/apps/app_dial.c?view=diff&rev=187673&r1=187672&r2=187673
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Fri Apr 10 10:49:16 2009
@@ -790,9 +790,10 @@
 
 		ast_clear_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE);
 
+		ast_channel_unlock(in);
+		ast_channel_unlock(c);
+
 		if (ast_call(c, tmpchan, 0)) {
-			ast_channel_unlock(in);
-			ast_channel_unlock(c);
 			ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
 			ast_clear_flag64(o, DIAL_STILLGOING);
 			ast_hangup(original);
@@ -800,6 +801,10 @@
 			c = o->chan = NULL;
 			num->nochan++;
 		} else {
+			ast_channel_lock(c);
+			while (ast_channel_trylock(in)) {
+				CHANNEL_DEADLOCK_AVOIDANCE(c);
+			}
 			senddialevent(in, c, stuff);
 			if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
 				char cidname[AST_MAX_EXTENSION] = "";




More information about the svn-commits mailing list