mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 20:08:17 +00:00
Deprecate SetGlobalVar, replacing it with a dialplan function
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@30677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
7
pbx.c
7
pbx.c
@@ -5473,6 +5473,7 @@ static int pbx_builtin_setglobalvar(struct ast_channel *chan, void *data)
|
||||
{
|
||||
char *name;
|
||||
char *stringp = data;
|
||||
static int dep_warning = 0;
|
||||
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "Ignoring, since there is no variable to set\n");
|
||||
@@ -5480,6 +5481,12 @@ static int pbx_builtin_setglobalvar(struct ast_channel *chan, void *data)
|
||||
}
|
||||
|
||||
name = strsep(&stringp, "=");
|
||||
|
||||
if (!dep_warning) {
|
||||
dep_warning = 1;
|
||||
ast_log(LOG_WARNING, "SetGlobalVar is deprecated. Please use Set(GLOBAL(%s)=%s) instead.\n", name, stringp);
|
||||
}
|
||||
|
||||
/*! \todo XXX watch out, leading whitespace ? */
|
||||
pbx_builtin_setvar_helper(NULL, name, stringp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user