aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-28 23:47:05 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-28 23:47:05 +0000
commit701043784e53e0d5143d6a111f456bbee0bc6765 (patch)
tree7d62dde62c39041430a2be944aecfe0794cc8bd6 /apps/app_chanspy.c
parent051ef64e46e2d8e501a6918d5e13daa51805ce7b (diff)
play a beep tone into the spied-on channel if we are about to whisper to them
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38466 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index c4dfb3488..3cd10e3c8 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -291,14 +291,27 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
return 0;
}
+ if (ast_test_flag(flags, OPTION_WHISPER)) {
+ struct ast_filestream *beepstream;
+
+ ast_channel_whisper_start(csth.spy.chan);
+ if ((beepstream = ast_openstream_full(chan, "beep", chan->language, 1))) {
+ struct ast_frame *f;
+
+ while ((f = ast_readframe(beepstream))) {
+ ast_channel_whisper_feed(csth.spy.chan, f);
+ ast_frfree(f);
+ }
+
+ ast_closestream(beepstream);
+ }
+ }
+
if (ast_test_flag(flags, OPTION_PRIVATE))
silgen = ast_channel_start_silence_generator(chan);
else
ast_activate_generator(chan, &spygen, &csth);
- if (ast_test_flag(flags, OPTION_WHISPER))
- ast_channel_whisper_start(csth.spy.chan);
-
/* We can no longer rely on 'spyee' being an actual channel;
it can be hung up and freed out from under us. However, the
channel destructor will put NULL into our csth.spy.chan