mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
issue #2720
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
20
pbx.c
20
pbx.c
@@ -5897,6 +5897,26 @@ char *pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void pbx_builtin_pushvar_helper(struct ast_channel *chan, const char *name, const char *value)
|
||||
{
|
||||
struct ast_var_t *newvariable;
|
||||
struct varshead *headp;
|
||||
|
||||
if (name[strlen(name)-1] == ')') {
|
||||
ast_log(LOG_WARNING, "Cannot push a value onto a function\n");
|
||||
return ast_func_write(chan, name, value);
|
||||
}
|
||||
|
||||
headp = (chan) ? &chan->varshead : &globals;
|
||||
|
||||
if (value) {
|
||||
if ((option_verbose > 1) && (headp == &globals))
|
||||
ast_verbose(VERBOSE_PREFIX_2 "Setting global variable '%s' to '%s'\n", name, value);
|
||||
newvariable = ast_var_assign(name, value);
|
||||
AST_LIST_INSERT_HEAD(headp, newvariable, entries);
|
||||
}
|
||||
}
|
||||
|
||||
void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
|
||||
{
|
||||
struct ast_var_t *newvariable;
|
||||
|
||||
Reference in New Issue
Block a user