[svn-commits] file: branch file/bridging-phase2 r193504 - in /team/file/bridging-phase2: ./...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun May 10 12:10:25 CDT 2009


Author: file
Date: Sun May 10 12:10:22 2009
New Revision: 193504

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193504
Log:
Merged revisions 193502 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r193502 | file | 2009-05-10 14:07:46 -0300 (Sun, 10 May 2009) | 2 lines
  
  Fix a bug where receiving a control frame of subclass -1 would cause certain channels to get hung up.
........

Modified:
    team/file/bridging-phase2/   (props changed)
    team/file/bridging-phase2/main/bridging.c

Propchange: team/file/bridging-phase2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun May 10 12:10:22 2009
@@ -1,1 +1,1 @@
-/trunk:1-193471
+/trunk:1-193503

Modified: team/file/bridging-phase2/main/bridging.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/file/bridging-phase2/main/bridging.c?view=diff&rev=193504&r1=193503&r2=193504
==============================================================================
--- team/file/bridging-phase2/main/bridging.c (original)
+++ team/file/bridging-phase2/main/bridging.c Sun May 10 12:10:22 2009
@@ -290,6 +290,18 @@
 	return;
 }
 
+/*! \brief Internal function used to determine whether a control frame should be dropped or not */
+static int bridge_drop_control_frame(int subclass)
+{
+	switch (subclass) {
+	case AST_CONTROL_ANSWER:
+	case -1:
+		return 1;
+	default:
+		return 0;
+	}
+}
+
 void ast_bridge_handle_trip(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_channel *chan, int outfd)
 {
 	/* If no bridge channel has been provided and the actual channel has been provided find it */
@@ -305,8 +317,8 @@
 		if (!frame || (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_HANGUP)) {
 			/* Signal the thread that is handling the bridged channel that it should be ended */
 			ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_END);
-		} else if (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_ANSWER) {
-			ast_debug(1, "Dropping answer frame from bridge channel %p\n", bridge_channel);
+		} else if (frame->frametype == AST_FRAME_CONTROL && bridge_drop_control_frame(frame->subclass)) {
+			ast_debug(1, "Dropping control frame from bridge channel %p\n", bridge_channel);
 		} else {
 			if (frame->frametype == AST_FRAME_DTMF_BEGIN) {
 				frame = bridge_handle_dtmf(bridge, bridge_channel, frame);




More information about the svn-commits mailing list