summaryrefslogtreecommitdiff
path: root/res/ari/ari_model_validators.c
diff options
context:
space:
mode:
authorSebastien Duthil <sduthil@proformatique.com>2016-11-11 11:45:37 -0500
committerSebastien Duthil <sduthil@proformatique.com>2016-11-14 13:51:56 -0500
commitc6d755de11e98c1f6f33b1b35db9725f64f72053 (patch)
tree2299d268ffdce70a50dafacc20cc56509a79f4c4 /res/ari/ari_model_validators.c
parent7540036427f87bfe3c87357ac33c08561f191e98 (diff)
res_ari: Add support for channel variables in ARI events.
This works the same as for AMI manager variables. Set "channelvars=foo,bar" in your ari.conf general section, and then the channel variables "foo" and "bar" (along with their values), will appear in every Stasis websocket channel event. ASTERISK-26492 #close patches: ari_vars.diff submitted by Mark Michelson Change-Id: I5609ba239259577c0948645df776d7f3bc864229
Diffstat (limited to 'res/ari/ari_model_validators.c')
-rw-r--r--res/ari/ari_model_validators.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/res/ari/ari_model_validators.c b/res/ari/ari_model_validators.c
index 03cd3a238..9fd844c4d 100644
--- a/res/ari/ari_model_validators.c
+++ b/res/ari/ari_model_validators.c
@@ -1051,6 +1051,15 @@ int ast_ari_validate_channel(struct ast_json *json)
res = 0;
}
} else
+ if (strcmp("channelvars", ast_json_object_iter_key(iter)) == 0) {
+ int prop_is_valid;
+ prop_is_valid = ast_ari_validate_object(
+ ast_json_object_iter_value(iter));
+ if (!prop_is_valid) {
+ ast_log(LOG_ERROR, "ARI Channel field channelvars failed validation\n");
+ res = 0;
+ }
+ } else
if (strcmp("connected", ast_json_object_iter_key(iter)) == 0) {
int prop_is_valid;
has_connected = 1;