From: Jonathan Rose Date: Mon, 12 May 2014 22:02:34 +0000 (+0000) Subject: app_chanspy: Fix a test that was failing on account of r413551 X-Git-Tag: 11.10.0-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4e0f4361f4d7797bc617f774dde13ad7378a52d;p=thirdparty%2Fasterisk.git app_chanspy: Fix a test that was failing on account of r413551 ASTERISK-23381 #close ASTERISK-23381 #comment Reported by: Robert Moss Review: https://reviewboard.asterisk.org/r/3505/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@413710 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 657848aa97..37dd148f8d 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -661,16 +661,16 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto bridge_connected = 1; } - if (!bridge_connected) { - continue; - } - ast_audiohook_lock(&csth.whisper_audiohook); - ast_audiohook_lock(&csth.bridge_whisper_audiohook); ast_audiohook_write_frame(&csth.whisper_audiohook, AST_AUDIOHOOK_DIRECTION_WRITE, f); - ast_audiohook_write_frame(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_DIRECTION_WRITE, f); ast_audiohook_unlock(&csth.whisper_audiohook); - ast_audiohook_unlock(&csth.bridge_whisper_audiohook); + + if (bridge_connected) { + ast_audiohook_lock(&csth.bridge_whisper_audiohook); + ast_audiohook_write_frame(&csth.bridge_whisper_audiohook, AST_AUDIOHOOK_DIRECTION_WRITE, f); + ast_audiohook_unlock(&csth.bridge_whisper_audiohook); + } + ast_frfree(f); continue; } else if (ast_test_flag(flags, OPTION_WHISPER) && f->frametype == AST_FRAME_VOICE) {