[asterisk-commits] dlee: trunk r403403 - in /trunk: ./ res/stasis/control.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 5 16:09:22 CST 2013


Author: dlee
Date: Thu Dec  5 16:09:20 2013
New Revision: 403403

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403403
Log:
ari: Fix deadlock problem with functions that use autoservice.

The code for getting channel variables from ARI assumed that you needed
to lock the channel in order to properly execute functions and read
channel variables. Apparently, this is not the case, since any dialplan
function that puts the channel into autoservice deadlocks when
attempting to remove the channel from autoservice.
........

Merged revisions 403342 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/res/stasis/control.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Thu Dec  5 16:09:20 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403290,403292-403312,403324,403329,403349,403364,403377
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403290,403292-403342,403349,403364,403377

Modified: trunk/res/stasis/control.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/stasis/control.c?view=diff&rev=403403&r1=403402&r2=403403
==============================================================================
--- trunk/res/stasis/control.c (original)
+++ trunk/res/stasis/control.c Thu Dec  5 16:09:20 2013
@@ -426,7 +426,13 @@
 char *stasis_app_control_get_channel_var(struct stasis_app_control *control, const char *variable)
 {
 	RAII_VAR(struct ast_str *, tmp, ast_str_create(32), ast_free);
-	SCOPED_CHANNELLOCK(lockvar, control->channel);
+
+	/* You may be tempted to lock the channel you're about to read from. You
+	 * would be wrong. Some dialplan functions put the channel into
+	 * autoservice, which deadlocks if the channel is already locked.
+	 * ast_str_retrieve_variable() does its own locking, and the dialplan
+	 * functions need to as well. We should be fine without the lock.
+	 */
 
 	if (!tmp) {
 		return NULL;




More information about the asterisk-commits mailing list