mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-21 09:10:36 +00:00
Fix a bug where receiving a control frame of subclass -1 would cause certain channels to get hung up.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193502 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -261,6 +261,18 @@ static struct ast_frame *bridge_handle_dtmf(struct ast_bridge *bridge, struct as
|
|||||||
return frame;
|
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)
|
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 */
|
/* 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)) {
|
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 */
|
/* 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);
|
ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_END);
|
||||||
} else if (frame->frametype == AST_FRAME_CONTROL && frame->subclass == AST_CONTROL_ANSWER) {
|
} else if (frame->frametype == AST_FRAME_CONTROL && bridge_drop_control_frame(frame->subclass)) {
|
||||||
ast_debug(1, "Dropping answer frame from bridge channel %p\n", bridge_channel);
|
ast_debug(1, "Dropping control frame from bridge channel %p\n", bridge_channel);
|
||||||
} else {
|
} else {
|
||||||
if (frame->frametype == AST_FRAME_DTMF_BEGIN) {
|
if (frame->frametype == AST_FRAME_DTMF_BEGIN) {
|
||||||
frame = bridge_handle_dtmf(bridge, bridge_channel, frame);
|
frame = bridge_handle_dtmf(bridge, bridge_channel, frame);
|
||||||
|
|||||||
Reference in New Issue
Block a user