[asterisk-commits] app chanspy: fix audiohook options in non read-only mode (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 4 04:49:30 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: app_chanspy: fix audiohook options in non read-only mode
......................................................................


app_chanspy: fix audiohook options in non read-only mode

When option 'o' was not set, ChanSpy created its audiohook with the flag
AST_AUDIOHOOK_MUTE_WRITE, which caused ChanSpy to listen audio from one
direction only.

ASTERISK-25866 #close

Change-Id: I5c745855eea29a3fbc4e4aed0b0c0f53580535e0
---
M apps/app_chanspy.c
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 400eed1..df2deae 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -509,8 +509,10 @@
 static int start_spying(struct ast_autochan *autochan, const char *spychan_name, struct ast_audiohook *audiohook, struct ast_flags *flags)
 {
 	ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, ast_channel_name(autochan->chan));
-	if(!ast_test_flag(flags, OPTION_READONLY)) {
-		ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC | AST_AUDIOHOOK_MUTE_WRITE);
+	if(ast_test_flag(flags, OPTION_READONLY)) {
+		ast_set_flag(audiohook, AST_AUDIOHOOK_MUTE_WRITE);
+	} else {
+		ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC);
 	}
 	if(ast_test_flag(flags, OPTION_LONG_QUEUE)) {
 		ast_debug(9, "Using a long queue to store audio frames in spy audiohook\n");

-- 
To view, visit https://gerrit.asterisk.org/2740
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5c745855eea29a3fbc4e4aed0b0c0f53580535e0
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Jean Aunis - Prescom <jean.aunis at prescom.fr>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list