[asterisk-commits] file: trunk r173902 - in /trunk: apps/app_chanspy.c main/audiohook.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 6 09:59:17 CST 2009


Author: file
Date: Fri Feb  6 09:59:17 2009
New Revision: 173902

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=173902
Log:
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

Modified:
    trunk/apps/app_chanspy.c
    trunk/main/audiohook.c

Modified: trunk/apps/app_chanspy.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=173902&r1=173901&r2=173902
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Fri Feb  6 09:59:17 2009
@@ -611,19 +611,15 @@
 	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);

Modified: trunk/main/audiohook.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/main/audiohook.c?view=diff&rev=173902&r1=173901&r2=173902
==============================================================================
--- trunk/main/audiohook.c (original)
+++ trunk/main/audiohook.c Fri Feb  6 09:59:17 2009
@@ -354,7 +354,7 @@
  */
 int ast_audiohook_detach(struct ast_audiohook *audiohook)
 {
-	if (audiohook->status == AST_AUDIOHOOK_STATUS_DONE)
+	if (audiohook->status == AST_AUDIOHOOK_STATUS_NEW || audiohook->status == AST_AUDIOHOOK_STATUS_DONE)
 		return 0;
 
 	audiohook->status = AST_AUDIOHOOK_STATUS_SHUTDOWN;




More information about the asterisk-commits mailing list