summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2009-02-06 15:59:17 +0000
committerJoshua Colp <jcolp@digium.com>2009-02-06 15:59:17 +0000
commitb2484d7db9680d902a557b473790b2a4bac8c888 (patch)
treee99ed2cd84ef8a79129f88abccc945e339cda34c /apps
parent5da26420e93fc4c0404d8ea9afca0257c2387263 (diff)
Always detach and destroy the whisper and barge audiohooks. Additionally also allow an audiohook to be detached if it has not been attached.
(closes issue #14414) Reported by: bluecrow76 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanspy.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index f537875bc..43c95c49a 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -611,19 +611,15 @@ 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);
- 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.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);
ast_audiohook_lock(&csth.spy_audiohook);
ast_audiohook_detach(&csth.spy_audiohook);