summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-08-24 08:21:37 -0300
committerJoshua Colp <jcolp@digium.com>2015-08-24 08:21:37 -0300
commit6c2dab1e888e59cb429ed61219815bd00eee66c0 (patch)
tree001b66b0d2db433265fdbd2bf09d52676058b63e
parente0cf42f61e870eb17853efd82b2652b7dbc2ac0a (diff)
bridge: Kick channel from bridge if hung up during action.
When executing an action in a bridge it is possible for the channel to be hung up without the bridge becoming aware of it. This is most easily reproducible by hanging up when the bridge is streaming DTMF due to a feature timeout. This change makes it so after action execution the channel is checked to determine if it has been hung up and if it has it is kicked from the bridge. ASTERISK-25341 #close Change-Id: I6dd8b0c3f5888da1c57afed9e8a802ae0a053062
-rw-r--r--main/bridge_channel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 3ee04db55..8ce022005 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -1914,6 +1914,13 @@ static void bridge_channel_handle_action(struct ast_bridge_channel *bridge_chann
default:
break;
}
+
+ /* While invoking an action it is possible for the channel to be hung up. So
+ * that the bridge respects this we check here and if hung up kick it out.
+ */
+ if (bridge_channel->chan && ast_check_hangup_locked(bridge_channel->chan)) {
+ ast_bridge_channel_kick(bridge_channel, 0);
+ }
}
/*!