summaryrefslogtreecommitdiff
path: root/res/stasis/control.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-12-05 22:09:20 +0000
committerDavid M. Lee <dlee@digium.com>2013-12-05 22:09:20 +0000
commitfc70db3a810dae81e0ba0e09ecf11468bbef4d54 (patch)
tree545605754dfd898f06214dea9cd9c3330a51af64 /res/stasis/control.c
parent8c3b94476449b81dae25871cbc72862883f71e58 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/stasis/control.c')
-rw-r--r--res/stasis/control.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/res/stasis/control.c b/res/stasis/control.c
index 1c4f93862..14c9f57f5 100644
--- a/res/stasis/control.c
+++ b/res/stasis/control.c
@@ -426,7 +426,13 @@ int stasis_app_control_unmute(struct stasis_app_control *control, unsigned int d
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;