bridge_channel: Support the lonely flag and make ARI use it.

The lonely flag is an optional flag for bridge channels that will
make them leave a bridge when a channel leaves if only lonely
channels are in the bridge at that point. This is useful for things
like ending recording and playback channels when they cease to be
interacting with other channels in the bridge.

(closes issue ASTERISK-22117)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2721/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jonathan Rose
2013-08-09 17:22:28 +00:00
parent 6eec8a44e7
commit 6fe21ef48e
5 changed files with 23 additions and 6 deletions

View File

@@ -300,7 +300,8 @@ void ast_ari_play_on_bridge(struct ast_variable *headers, struct ast_play_on_bri
}
ast_debug(1, "Created announcer channel '%s'\n", ast_channel_name(play_channel));
if (ast_unreal_channel_push_to_bridge(play_channel, bridge)) {
if (ast_unreal_channel_push_to_bridge(play_channel, bridge,
AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE | AST_BRIDGE_CHANNEL_FLAG_LONELY)) {
ast_ari_response_error(
response, 500, "Internal Error", "Failed to put playback channel into the bridge");
return;
@@ -394,7 +395,8 @@ void ast_ari_record_bridge(struct ast_variable *headers, struct ast_record_bridg
return;
}
if (ast_unreal_channel_push_to_bridge(record_channel, bridge)) {
if (ast_unreal_channel_push_to_bridge(record_channel, bridge,
AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE | AST_BRIDGE_CHANNEL_FLAG_LONELY)) {
ast_ari_response_error(
response, 500, "Internal Error", "Failed to put recording channel into the bridge");
return;