mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
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
This commit is contained in:
13
main/json.c
13
main/json.c
@@ -1048,3 +1048,16 @@ enum ast_json_to_ast_vars_code ast_json_to_ast_variables(struct ast_json *json_v
|
||||
|
||||
return AST_JSON_TO_AST_VARS_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
struct ast_json *ast_json_channel_vars(struct varshead *channelvars)
|
||||
{
|
||||
struct ast_json *ret;
|
||||
struct ast_var_t *var;
|
||||
|
||||
ret = ast_json_object_create();
|
||||
AST_LIST_TRAVERSE(channelvars, var, entries) {
|
||||
ast_json_object_set(ret, var->name, ast_json_string_create(var->value));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user