[Asterisk-cvs] asterisk UPGRADE.txt,1.10,1.11 pbx.c,1.243,1.244
kpfleming at lists.digium.com
kpfleming at lists.digium.com
Sun May 15 19:27:14 CDT 2005
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv19151
Modified Files:
UPGRADE.txt pbx.c
Log Message:
rename SetVar application to Set, deprecate SetVar
Index: UPGRADE.txt
===================================================================
RCS file: /usr/cvsroot/asterisk/UPGRADE.txt,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- UPGRADE.txt 15 May 2005 17:45:29 -0000 1.10
+++ UPGRADE.txt 15 May 2005 23:32:38 -0000 1.11
@@ -35,6 +35,9 @@
Applications:
+* With the addition of dialplan functions (which operate similarly
+ to variables), the SetVar application has been renamed to Set.
+
* The CallerPres application has been removed. Use SetCallerPres
instead. It accepts both numeric and symbolic names.
@@ -42,9 +45,9 @@
CheckGroup have been deprecated in favor of functions. Here is a
table of their replacements:
- GetGroupCount([groupname][@category] GROUP_COUNT([groupname][@category]) SetVar(GROUPCOUNT=${GROUP_COUNT()})
- GroupMatchCount(groupmatch[@category]) GROUP_MATCH_COUNT(groupmatch[@category]) SetVar(GROUPCOUNT=${GROUP_MATCH_COUNT(SIP/.*)})
- SetGroup(groupname[@category]) GROUP([category])=groupname SetVar(GROUP()=test)
+ GetGroupCount([groupname][@category] GROUP_COUNT([groupname][@category]) Set(GROUPCOUNT=${GROUP_COUNT()})
+ GroupMatchCount(groupmatch[@category]) GROUP_MATCH_COUNT(groupmatch[@category]) Set(GROUPCOUNT=${GROUP_MATCH_COUNT(SIP/.*)})
+ SetGroup(groupname[@category]) GROUP([category])=groupname Set(GROUP()=test)
CheckGroup(max[@category]) N/A GotoIf($[ ${GROUP_COUNT()} > 5 ]?103)
Note that CheckGroup does not have a direct replacement. There is
@@ -56,35 +59,35 @@
* The applications DBGet and DBPut have been deprecated in favor of
functions. Here is a table of their replacements:
- DBGet(foo=family/key) SetVar(foo=${DB(family/key)})
- DBPut(family/key=${foo}) SetVar(${DB(family/key)}=${foo})
+ DBGet(foo=family/key) Set(foo=${DB(family/key)})
+ DBPut(family/key=${foo}) Set(${DB(family/key)}=${foo})
* The application SetLanguage has been deprecated in favor of the
function LANGUAGE().
- SetLanguage(fr) SetVar(LANGUAGE()=fr)
+ SetLanguage(fr) Set(LANGUAGE()=fr)
The LANGUAGE function can also return the currently set language:
- SetVar(MYLANG=${LANGUAGE()})
+ Set(MYLANG=${LANGUAGE()})
* The applications AbsoluteTimeout, DigitTimeout, and ResponseTimeout
have been deprecated in favor of the function TIMEOUT(timeouttype):
- AbsoluteTimeout(300) SetVar(TIMEOUT(absolute)=300)
- DigitTimeout(15) SetVar(TIMEOUT(digit)=15)
- ResponseTimeout(15) SetVar(TIMEOUT(response)=15)
+ AbsoluteTimeout(300) Set(TIMEOUT(absolute)=300)
+ DigitTimeout(15) Set(TIMEOUT(digit)=15)
+ ResponseTimeout(15) Set(TIMEOUT(response)=15)
The TIMEOUT() function can also return the currently set timeouts:
- SetVar(DTIMEOUT=${TIMEOUT(digit)})
+ Set(DTIMEOUT=${TIMEOUT(digit)})
* The applications SetCIDName, SetCIDNum, and SetRDNIS have been
deprecated in favor of the CALLERID(datatype) function:
- SetCIDName(Joe Cool) SetVar(CALLERID(name)=Joe Cool)
- SetCIDNum(2025551212) SetVar(CALLERID(number)=2025551212)
- SetRDNIS(2024561414) SetVar(CALLERID(RDNIS)=2024561414)
+ SetCIDName(Joe Cool) Set(CALLERID(name)=Joe Cool)
+ SetCIDNum(2025551212) Set(CALLERID(number)=2025551212)
+ SetRDNIS(2024561414) Set(CALLERID(RDNIS)=2024561414)
Queues:
Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -d -r1.243 -r1.244
--- pbx.c 15 May 2005 17:45:29 -0000 1.243
+++ pbx.c 15 May 2005 23:32:38 -0000 1.244
@@ -205,6 +205,7 @@
static int pbx_builtin_saydigits(struct ast_channel *, void *);
static int pbx_builtin_saycharacters(struct ast_channel *, void *);
static int pbx_builtin_sayphonetic(struct ast_channel *, void *);
+static int pbx_builtin_setvar_old(struct ast_channel *, void *);
int pbx_builtin_setvar(struct ast_channel *, void *);
static int pbx_builtin_importvar(struct ast_channel *, void *);
@@ -231,7 +232,7 @@
"Set absolute maximum time of call",
" AbsoluteTimeout(seconds): Set the absolute maximum amount of time permitted\n"
"for a call. A setting of 0 disables the timeout. Always returns 0.\n"
- "AbsoluteTimeout has been deprecated in favor of SetVar(TIMEOUT(absolute)=timeout)\n"
+ "AbsoluteTimeout has been deprecated in favor of Set(TIMEOUT(absolute)=timeout)\n"
},
{ "Answer", pbx_builtin_answer,
@@ -284,7 +285,7 @@
"(and thus control would be passed to the 'i' extension, or if it doesn't\n"
"exist the call would be terminated). The default timeout is 5 seconds.\n"
"Always returns 0.\n"
- "DigitTimeout has been deprecated in favor of SetVar(TIMEOUT(digit)=timeout)\n"
+ "DigitTimeout has been deprecated in favor of Set(TIMEOUT(digit)=timeout)\n"
},
{ "Goto", pbx_builtin_goto,
@@ -368,7 +369,7 @@
"amount of time, control will pass to the 't' extension if it exists, and\n"
"if not the call would be terminated. The default timeout is 10 seconds.\n"
"Always returns 0.\n"
- "ResponseTimeout has been deprecated in favor of SetVar(TIMEOUT(response)=timeout)\n"
+ "ResponseTimeout has been deprecated in favor of Set(TIMEOUT(response)=timeout)\n"
},
{ "Ringing", pbx_builtin_ringing,
@@ -428,19 +429,29 @@
"For some language codes, SetLanguage also changes the syntax of some\n"
"Asterisk functions, like SayNumber.\n"
"Always returns 0.\n"
- "SetLanguage has been deprecated in favor of SetVar(LANGUAGE()=language)\n"
+ "SetLanguage has been deprecated in favor of Set(LANGUAGE()=language)\n"
},
- { "SetVar", pbx_builtin_setvar,
- "Set channel variable(s)",
- " SetVar(name1=value1|name2=value2|..[|options])\n"
- "You can specify up to 24 name / value pairs to be set as channel variables.\n"
- "If a variable name is prefixed with _, it will be inherited into channels\n"
- "created from this one. If a variable name is prefixed with __, it will be\n"
- "inherited into channels created from this one and all child channels.\n"
- "The last arg (if it doesn't contain '=') is interpreted as a string of\n"
- "options. Valid options are:\n"
- " g - Set variable globally instead of on the channel\n"
+ { "Set", pbx_builtin_setvar,
+ "Set channel variable(s) or function value(s)",
+ " Set(name1=value1|name2=value2|..[|options])\n"
+ "This function can be used to set the value of channel variables\n"
+ "or dialplan functions. It will accept up to 24 name/value pairs.\n"
+ "When setting variables, if the variable name is prefixed with _,\n"
+ "the variable will be inherited into channels created from the\n"
+ "current channel. If the variable name is prefixed with __,\n"
+ "the variable will be inherited into channels created from the\n"
+ "current channel and all child channels.\n"
+ "The last argument, if it does not contain '=', is interpreted\n"
+ "as a string of options. The valid options are:\n"
+ " g - Set variable globally instead of on the channel\n"
+ " (applies only to variables, not functions)\n"
+ },
+
+ { "SetVar", pbx_builtin_setvar_old,
+ "Set channel variable(s)",
+ " SetVar(name1=value1|name2=value2|..[|options])\n"
+ "SetVar has been deprecated in favor of Set.\n"
},
{ "ImportVar", pbx_builtin_importvar,
@@ -5260,7 +5271,7 @@
static int deprecation_warning = 0;
if (!deprecation_warning) {
- ast_log(LOG_WARNING, "SetLanguage is deprecated, please use SetVar(LANGUAGE()=language) instead.\n");
+ ast_log(LOG_WARNING, "SetLanguage is deprecated, please use Set(LANGUAGE()=language) instead.\n");
deprecation_warning = 1;
}
@@ -5580,7 +5591,7 @@
int x = atoi((char *) data);
if (!deprecation_warning) {
- ast_log(LOG_WARNING, "AbsoluteTimeout is deprecated, please use SetVar(TIMEOUT(absolute)=timeout) instead.\n");
+ ast_log(LOG_WARNING, "AbsoluteTimeout is deprecated, please use Set(TIMEOUT(absolute)=timeout) instead.\n");
deprecation_warning = 1;
}
@@ -5596,7 +5607,7 @@
static int deprecation_warning = 0;
if (!deprecation_warning) {
- ast_log(LOG_WARNING, "ResponseTimeout is deprecated, please use SetVar(TIMEOUT(response)=timeout) instead.\n");
+ ast_log(LOG_WARNING, "ResponseTimeout is deprecated, please use Set(TIMEOUT(response)=timeout) instead.\n");
deprecation_warning = 1;
}
@@ -5616,7 +5627,7 @@
static int deprecation_warning = 0;
if (!deprecation_warning) {
- ast_log(LOG_WARNING, "DigitTimeout is deprecated, please use SetVar(TIMEOUT(digit)=timeout) instead.\n");
+ ast_log(LOG_WARNING, "DigitTimeout is deprecated, please use Set(TIMEOUT(digit)=timeout) instead.\n");
deprecation_warning = 1;
}
@@ -5722,6 +5733,18 @@
}
}
+int pbx_builtin_setvar_old(struct ast_channel *chan, void *data)
+{
+ static int deprecation_warning = 0;
+
+ if (!deprecation_warning) {
+ ast_log(LOG_WARNING, "SetVar is deprecated, please use Set instead.\n");
+ deprecation_warning = 1;
+ }
+
+ return pbx_builtin_setvar(chan, data);
+}
+
int pbx_builtin_setvar(struct ast_channel *chan, void *data)
{
char *name, *value, *mydata;
@@ -5731,7 +5754,7 @@
int x;
if (!data || ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "SetVar requires at least one variable name/value pair.\n");
+ ast_log(LOG_WARNING, "Set requires at least one variable name/value pair.\n");
return 0;
}
More information about the svn-commits
mailing list