summaryrefslogtreecommitdiff
path: root/res/ari/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/ari/config.c')
-rw-r--r--res/ari/config.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/res/ari/config.c b/res/ari/config.c
index deaa78073..a080bb713 100644
--- a/res/ari/config.c
+++ b/res/ari/config.c
@@ -26,6 +26,8 @@
#include "asterisk/config_options.h"
#include "asterisk/http_websocket.h"
+#include "asterisk/app.h"
+#include "asterisk/channel.h"
#include "internal.h"
/*! \brief Locking container for safe configuration access. */
@@ -316,6 +318,22 @@ static int process_config(int reload)
return 0;
}
+#define MAX_VARS 128
+
+static int channelvars_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
+{
+ char *parse = NULL;
+ AST_DECLARE_APP_ARGS(args,
+ AST_APP_ARG(vars)[MAX_VARS];
+ );
+
+ parse = ast_strdupa(var->value);
+ AST_STANDARD_APP_ARGS(args, parse);
+
+ ast_channel_set_ari_vars(args.argc, args.vars);
+ return 0;
+}
+
int ast_ari_config_init(void)
{
if (aco_info_init(&cfg_info)) {
@@ -339,6 +357,8 @@ int ast_ari_config_init(void)
aco_option_register(&cfg_info, "websocket_write_timeout", ACO_EXACT, general_options,
AST_DEFAULT_WEBSOCKET_WRITE_TIMEOUT_STR, OPT_INT_T, PARSE_IN_RANGE,
FLDSET(struct ast_ari_conf_general, write_timeout), 1, INT_MAX);
+ aco_option_register_custom(&cfg_info, "channelvars", ACO_EXACT, general_options,
+ "", channelvars_handler, 0);
/* ARI type=user category options */
aco_option_register(&cfg_info, "type", ACO_EXACT, user, NULL,