summaryrefslogtreecommitdiff
path: root/res/ari/resource_bridges.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-08-05 16:59:13 +0000
committerJonathan Rose <jrose@digium.com>2013-08-05 16:59:13 +0000
commite47794ead1fb35527728a0c655585af35679e258 (patch)
treec3e08fcd907c1b0a2390a388d69905394b5c307e /res/ari/resource_bridges.c
parent98b02d98f389d922da568882cd3f350fe28b473d (diff)
ARI: bridges/{bridgeID}/addChannel: add roles parameter
Roles are now cleared with each entry into a bridge with addChannel. If the roles parameter is present, the role specified will be applied to all channels being added with the addChannel command. (closes issue ASTERISK-21973) Reported by: Matt Jordan https://reviewboard.asterisk.org/r/2691/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/ari/resource_bridges.c')
-rw-r--r--res/ari/resource_bridges.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/res/ari/resource_bridges.c b/res/ari/resource_bridges.c
index e4c7194ff..65fe8d79f 100644
--- a/res/ari/resource_bridges.c
+++ b/res/ari/resource_bridges.c
@@ -176,6 +176,16 @@ void ast_ari_add_channel_to_bridge(struct ast_variable *headers, struct ast_add_
}
for (i = 0; i < list->count; ++i) {
+ stasis_app_control_clear_roles(list->controls[i]);
+ if (!ast_strlen_zero(args->role)) {
+ if (stasis_app_control_add_role(list->controls[i], args->role)) {
+ ast_ari_response_alloc_failed(response);
+ return;
+ }
+ }
+ }
+
+ for (i = 0; i < list->count; ++i) {
stasis_app_control_add_channel_to_bridge(list->controls[i], bridge);
}