Fix a locking inversion in MixMonitor.
authorMark Michelson <mmichelson@digium.com>
Fri, 22 Aug 2014 16:56:57 +0000 (16:56 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 22 Aug 2014 16:56:57 +0000 (16:56 +0000)
We need to unlock the audiohook before trying to lock
the channel, since the correct locking order is channel
then audiohook.
........

Merged revisions 421882 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421883 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_mixmonitor.c

index cf7b935..4b3da07 100644 (file)
@@ -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 */