aboutsummaryrefslogtreecommitdiffstats
path: root/main/bridging.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-10 17:08:53 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-10 17:08:53 +0000
commit49a13592f26743535817a7caa85f211202896c17 (patch)
tree1e6bb16fdb2b2c36f0e13d3383c33d42acb3220d /main/bridging.c
parentbdf863a7619eb2566e934427f5b31bc1e5f795dd (diff)
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. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@193503 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/bridging.c')
-rw-r--r--main/bridging.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/main/bridging.c b/main/bridging.c
index 815623e59..2f5afa2cb 100644
--- a/main/bridging.c
+++ b/main/bridging.c
@@ -261,6 +261,18 @@ static struct ast_frame *bridge_handle_dtmf(struct ast_bridge *bridge, struct as
return frame;
}
+/*! \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 */
@@ -276,8 +288,8 @@ void ast_bridge_handle_trip(struct ast_bridge *bridge, struct ast_bridge_channel
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);