From: David Vossel Date: Wed, 4 May 2011 14:23:39 +0000 (+0000) Subject: Fixes one-way-audio when chanspy activated with the 'o' option X-Git-Tag: 1.6.2.19-rc1~3^2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ef5452cd80ad49070a708d073bf309eb0c00d9a;p=thirdparty%2Fasterisk.git Fixes one-way-audio when chanspy activated with the 'o' option (closes issue #18382) Reported by: jkister Patches: 0001-Bugfix-18382-one-way-audio-when-chanspy-activated.patch.txt uploaded by malin (license ) Tested by: firstsip, Greenlightcrm, malin, wdoekes, boroda, dvossel git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@316644 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 338c04c742..89338aec05 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -345,6 +345,7 @@ struct chanspy_translation_helper { struct ast_audiohook bridge_whisper_audiohook; int fd; int volfactor; + struct ast_flags flags; }; static void *spy_alloc(struct ast_channel *chan, void *data) @@ -370,7 +371,7 @@ static int spy_generate(struct ast_channel *chan, void *data, int len, int sampl return -1; } - if (ast_test_flag(&csth->spy_audiohook, OPTION_READONLY)) { + if (ast_test_flag(&csth->flags, OPTION_READONLY)) { /* Option 'o' was set, so don't mix channel audio */ f = ast_audiohook_read_frame(&csth->spy_audiohook, samples, AST_AUDIOHOOK_DIRECTION_READ, AST_FORMAT_SLINEAR); } else { @@ -486,7 +487,7 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp spyer_name, name); memset(&csth, 0, sizeof(csth)); - ast_copy_flags(&csth.spy_audiohook, flags, AST_FLAGS_ALL); + ast_copy_flags(&csth.flags, flags, AST_FLAGS_ALL); ast_audiohook_init(&csth.spy_audiohook, AST_AUDIOHOOK_TYPE_SPY, "ChanSpy");