]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 224178 via svnmerge from
authorJeff Peeler <jpeeler@digium.com>
Thu, 15 Oct 2009 15:58:10 +0000 (15:58 +0000)
committerJeff Peeler <jpeeler@digium.com>
Thu, 15 Oct 2009 15:58:10 +0000 (15:58 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r224178 | jpeeler | 2009-10-15 10:57:14 -0500 (Thu, 15 Oct 2009) | 11 lines

  Readd removed ability to allow listening to one side of the call in app_chanspy

  (Option o)

  (closes issue #15675)
  Reported by: john8675309
  Patches:
        issue15675patchtrunk.txt uploaded by dbrooks (license 790)
  Tested by: jgutierrez on users list:
   http://lists.digium.com/pipermail/asterisk-users/2009-October/239155.html
........

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

apps/app_chanspy.c

index 0932a842d15577379c1f2cdad2fd00bc2f771637..93e433ce973ca4fcc6ba46aadba1e4e73441ad34 100644 (file)
@@ -253,7 +253,12 @@ static int spy_generate(struct ast_channel *chan, void *data, int len, int sampl
                return -1;
        }
 
-       f = ast_audiohook_read_frame(&csth->spy_audiohook, samples, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR);
+       if (ast_test_flag(chan, 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 {
+               f = ast_audiohook_read_frame(&csth->spy_audiohook, samples, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR);
+       }
 
        ast_audiohook_unlock(&csth->spy_audiohook);