[asterisk-commits] file: branch file/bridging r81649 - in /team/file/bridging: include/asterisk/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 6 09:13:33 CDT 2007


Author: file
Date: Thu Sep  6 09:13:33 2007
New Revision: 81649

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81649
Log:
Add ability to mute a channel in a bridge.

Modified:
    team/file/bridging/include/asterisk/bridging.h
    team/file/bridging/main/bridging.c

Modified: team/file/bridging/include/asterisk/bridging.h
URL: http://svn.digium.com/view/asterisk/team/file/bridging/include/asterisk/bridging.h?view=diff&rev=81649&r1=81648&r2=81649
==============================================================================
--- team/file/bridging/include/asterisk/bridging.h (original)
+++ team/file/bridging/include/asterisk/bridging.h Thu Sep  6 09:13:33 2007
@@ -95,6 +95,7 @@
 	pthread_t thread;                        /*! Thread handling the bridged channel */
 	int fds[4];                              /*! Additional file descriptors to look at */
 	int suspended:1;                         /*! Is this bridged channel suspended from the bridge or not? */
+	int muted:1;                             /*! Is this bridged channel muted or not? */
 	AST_LIST_ENTRY(ast_bridge_channel) list; /*! Linked list information */
 };
 

Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=81649&r1=81648&r2=81649
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Thu Sep  6 09:13:33 2007
@@ -159,7 +159,7 @@
 		}
 
 		/* Try to read a frame in, if this fails it means they hungup */
-		if (!(frame = ast_read(winner)) || (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_HANGUP)) {
+		if (!(frame = (bridge_channel->muted ? ast_read_noaudio(winner) : ast_read(winner))) || (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_HANGUP)) {
 			/* Switch the bridged channel state to end and signal it's thread */
 			ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_END);
 			/* If the bridge is set to dissolve upon anyone hanging up, do so */
@@ -383,7 +383,7 @@
 		if (chan) {
 			struct ast_frame *frame = NULL;
 			/* Try to read in a frame, if this fails it means they hungup */
-                        if (!(frame = ast_read(chan)) || (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_HANGUP)) {
+                        if (!(frame = (bridge_channel->muted ? ast_read_noaudio(chan) : ast_read(chan))) || (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_HANGUP)) {
                                 /* Switch the bridged channel state to end, no need to signal it's thread... we are it! */
 				bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_END;
                         } else {




More information about the asterisk-commits mailing list