summaryrefslogtreecommitdiff
path: root/apps/app_mixmonitor.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2014-08-22 16:56:18 +0000
committerMark Michelson <mmichelson@digium.com>2014-08-22 16:56:18 +0000
commit16c96760e71eb4feac55dba60b601ecf41268ea0 (patch)
tree915135879c3bb446e896e06db221becf4f38eee1 /apps/app_mixmonitor.c
parent712907eec683f6c2e1bd8e51ae8f29a31c19a205 (diff)
Fix a locking inversion in MixMonitor.
We need to unlock the audiohook before trying to lock the channel, since the correct locking order is channel then audiohook. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@421882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_mixmonitor.c')
-rw-r--r--apps/app_mixmonitor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c
index cf7b93518..4b3da07c0 100644
--- a/apps/app_mixmonitor.c
+++ b/apps/app_mixmonitor.c
@@ -743,14 +743,15 @@ static void *mixmonitor_thread(void *obj)
"File: %s\r\n",
ast_channel_name(mixmonitor->autochan->chan),
mixmonitor->filename);
+
+ ast_audiohook_unlock(&mixmonitor->audiohook);
+
ast_channel_lock(mixmonitor->autochan->chan);
if (ast_test_flag(mixmonitor, MUXFLAG_BEEP_STOP)) {
ast_stream_and_wait(mixmonitor->autochan->chan, "beep", "");
}
ast_channel_unlock(mixmonitor->autochan->chan);
- ast_audiohook_unlock(&mixmonitor->audiohook);
-
ast_autochan_destroy(mixmonitor->autochan);
/* Datastore cleanup. close the filestream and wait for ds destruction */