aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-13 01:01:25 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-13 01:01:25 +0000
commit8c283eb1b9032d44c222d41b8dbc42438a0ca19b (patch)
tree55aa37bbf76e232eadef73db9f231471ccaf585f /apps/app_chanspy.c
parent9a208fa4defbfa7ce0bd3c3d583de21fafbf44cb (diff)
Merged revisions 163912 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r163912 | file | 2008-12-12 20:59:24 -0400 (Fri, 12 Dec 2008) | 2 lines Only detach and destroy the whisper audiohooks if they are actually in use. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@163914 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 86deb0534..b9b7e5b58 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -495,14 +495,19 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
ast_clear_flag(chan, AST_FLAG_END_DTMF_ONLY);
ast_channel_unlock(chan);
- ast_audiohook_lock(&csth.whisper_audiohook);
- ast_audiohook_detach(&csth.whisper_audiohook);
- ast_audiohook_unlock(&csth.whisper_audiohook);
- ast_audiohook_destroy(&csth.whisper_audiohook);
- ast_audiohook_lock(&csth.bridge_whisper_audiohook);
- ast_audiohook_detach(&csth.bridge_whisper_audiohook);
- ast_audiohook_unlock(&csth.bridge_whisper_audiohook);
- ast_audiohook_destroy(&csth.bridge_whisper_audiohook);
+ if (ast_test_flag(flags, OPTION_WHISPER)) {
+ ast_audiohook_lock(&csth.whisper_audiohook);
+ ast_audiohook_detach(&csth.whisper_audiohook);
+ ast_audiohook_unlock(&csth.whisper_audiohook);
+ ast_audiohook_destroy(&csth.whisper_audiohook);
+ }
+
+ if (ast_test_flag(flags, OPTION_BARGE)) {
+ ast_audiohook_lock(&csth.bridge_whisper_audiohook);
+ ast_audiohook_detach(&csth.bridge_whisper_audiohook);
+ ast_audiohook_unlock(&csth.bridge_whisper_audiohook);
+ ast_audiohook_destroy(&csth.bridge_whisper_audiohook);
+ }
ast_audiohook_lock(&csth.spy_audiohook);
ast_audiohook_detach(&csth.spy_audiohook);