aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-26 20:09:41 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-26 20:09:41 +0000
commitae969b1ff0c6df8b8ee29b363d0c994150d6d506 (patch)
tree32c011fca5beb85f10a8bba5805eaff383a024c7 /apps/app_chanspy.c
parent601476c594d2784e432f9350ec5c01e73b3c3f95 (diff)
Slight overhaul of the whisper support. 1. We need to duplicate the frame from ast_translate 2. We need to ensure we always have signed linear coming in for signed linear combining. 3. We need to ensure we are always feeding signed linear out. 4. Properly store and restore write format when beeping on the channel we are whispering on. 5. Properly discontinue the stream on the channel for the beep. (issue #8019 reported by timkelly1980)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43695 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 01adbacbe..e001b4b33 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -277,8 +277,10 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
if (ast_test_flag(flags, OPTION_WHISPER)) {
struct ast_filestream *beepstream;
+ int old_write_format = 0;
ast_channel_whisper_start(csth.spy.chan);
+ old_write_format = chan->writeformat;
if ((beepstream = ast_openstream_full(chan, "beep", chan->language, 1))) {
struct ast_frame *f;
@@ -288,7 +290,10 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
}
ast_closestream(beepstream);
+ chan->stream = NULL;
}
+ if (old_write_format)
+ ast_set_write_format(chan, old_write_format);
}
if (ast_test_flag(flags, OPTION_PRIVATE))