diff options
author | matteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-02-13 06:00:14 +0000 |
---|---|---|
committer | matteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-02-13 06:00:14 +0000 |
commit | 54b168a25414b0994fa47dc2d79408ce9586000a (patch) | |
tree | 6de335942589dc50bacb98f3c1119222c6cb97d5 /pbx.c | |
parent | 6f8508e0dc91d74f9c126759b28d711eeffca2ac (diff) |
Thu Feb 13 07:00:00 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@613 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-x | pbx.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -145,6 +145,7 @@ static int pbx_builtin_ringing(struct ast_channel *, void *); static int pbx_builtin_congestion(struct ast_channel *, void *); static int pbx_builtin_busy(struct ast_channel *, void *); static int pbx_builtin_setvar(struct ast_channel *, void *); +static int pbx_builtin_setglobalvar(struct ast_channel *, void *); static int pbx_builtin_noop(struct ast_channel *, void *); static int pbx_builtin_gotoif(struct ast_channel *, void *); void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value); @@ -259,10 +260,14 @@ static struct pbx_builtin { " Busy(): Requests that the channel indicate busy condition and then waits\n" "for the user to hang up. Always returns -1." }, - { "Setvar", pbx_builtin_setvar, + { "SetVar", pbx_builtin_setvar, "Set variable to value", " Setvar(#n=value): Sets variable n to value" }, + { "SetGlobalVar", pbx_builtin_setglobalvar, +"Set variable to value", +" Setvar(#n=value): Sets global variable n to value" }, + { "NoOp", pbx_builtin_noop, "No operation", " NoOp(): No-operation; Does nothing." }, @@ -3580,6 +3585,27 @@ static int pbx_builtin_setvar(struct ast_channel *chan, void *data) return(0); } +static int pbx_builtin_setglobalvar(struct ast_channel *chan, void *data) +{ + char *name; + char *value; + char *stringp=NULL; + + if (!data || !strlen(data)) { + ast_log(LOG_WARNING, "Ignoring, since there is no variable to set\n"); + return 0; + } + + stringp=data; + name=strsep(&stringp,"="); + value=strsep(&stringp,"\0"); + + pbx_builtin_setvar_helper(NULL,name,value); + + return(0); +} + + static int pbx_builtin_noop(struct ast_channel *chan, void *data) { return 0; |