aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-08 23:37:53 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-08 23:37:53 +0000
commit007af44e56368029883cf398505c765f6a42562c (patch)
tree1d4a2b808b95af11486bb3b08254afbeaf72d2be /pbx.c
parent9c77ba7054469eeb54b9b572795b6b90f8f17adf (diff)
issue #2720
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7034 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index 40285bb31..e9bbb5f67 100755
--- a/pbx.c
+++ b/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;