[asterisk-commits] mmichelson: trunk r187770 - /trunk/apps/app_dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 10 12:32:28 CDT 2009


Author: mmichelson
Date: Fri Apr 10 12:32:25 2009
New Revision: 187770

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=187770
Log:
Make sure tc is unlocked before calling ast_call since calling a Local
channel could result in a deadlock.


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=187770&r1=187769&r2=187770
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Fri Apr 10 12:32:25 2009
@@ -1916,6 +1916,7 @@
 		else
 			ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten));
 
+		ast_channel_unlock(tc);
 		res = ast_call(tc, numsubst, 0); /* Place the call, but don't wait on the answer */
 
 		/* Save the info in cdr's that we called them */
@@ -1931,7 +1932,6 @@
 				chan->hangupcause = tc->hangupcause;
 			}
 			ast_channel_unlock(chan);
-			ast_channel_unlock(tc);
 			ast_hangup(tc);
 			tc = NULL;
 			ast_free(tmp);
@@ -1941,7 +1941,6 @@
 			senddialevent(chan, tc, numsubst);
 			ast_verb(3, "Called %s\n", numsubst);
 			ast_channel_unlock(chan);
-			ast_channel_unlock(tc);
 			if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
 				ast_set_callerid(tc, tmpexten, get_cid_name(cidname, sizeof(cidname), chan), NULL);
 			}




More information about the asterisk-commits mailing list