[asterisk-commits] trunk - r7633 in /trunk: UPGRADE.txt pbx.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Dec 26 10:48:14 CST 2005


Author: tilghman
Date: Mon Dec 26 10:48:12 2005
New Revision: 7633

URL: http://svn.digium.com/view/asterisk?rev=7633&view=rev
Log:
Bug 6057 - Deprecate builtins that have been replaced by functions

Modified:
    trunk/UPGRADE.txt
    trunk/pbx.c

Modified: trunk/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/trunk/UPGRADE.txt?rev=7633&r1=7632&r2=7633&view=diff
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Mon Dec 26 10:48:12 2005
@@ -8,3 +8,21 @@
   marked deprecated in Asterisk 1.2.  An option to disable it was provided with
   the default value set to 'on'.  The default value for the global priority
   jumping option is now 'off'.
+
+* The applications Cut, Sort, DBGet, DBPut, SetCIDNum, SetCIDName, SetRDNIS,
+  AbsoluteTimeout, DigitTimeout, ResponseTimeout, SetLanguage, GetGroupCount,
+  and GetGroupMatchCount were all deprecated in version 1.2, and therefore have
+  been removed in this version.  You should use the equivalent dialplan
+  function in places where you have previously used one of these applications.
+
+* The application SetVar has been renamed to Set.  The syntax SetVar was marked
+  deprecated in version 1.2 and is no longer recognized in this version.
+
+Variables:
+
+* The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
+  ${CALLERANI}, ${DNID}, ${RDNIS}, ${DATETIME}, ${TIMESTAMP}, ${ACCOUNTCODE},
+  and ${LANGUAGE} have all been deprecated in favor of their related dialplan
+  functions.  You are encouraged to move towards the associated dialplan
+  function, as these variables will be removed in a future release.
+

Modified: trunk/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx.c?rev=7633&r1=7632&r2=7633&view=diff
==============================================================================
--- trunk/pbx.c (original)
+++ trunk/pbx.c Mon Dec 26 10:48:12 2005
@@ -903,6 +903,7 @@
 	struct tm brokentime;
 	int offset, offset2, isfunc;
 	struct ast_var_t *variables;
+	char *deprecated = NULL;
 
 	if (c) 
 		headp=&c->varshead;
@@ -929,6 +930,7 @@
 						*ret = workspace;
 					} else
 						*ret = NULL;
+					deprecated = "CALLERID(all)";
 				} else if (!strcmp(var + 8, "NUM")) {
 					/* CALLERIDNUM */
 					if (c->cid.cid_num) {
@@ -936,6 +938,7 @@
 						*ret = workspace;
 					} else
 						*ret = NULL;
+					deprecated = "CALLERID(num)";
 				} else if (!strcmp(var + 8, "NAME")) {
 					/* CALLERIDNAME */
 					if (c->cid.cid_name) {
@@ -943,7 +946,9 @@
 						*ret = workspace;
 					} else
 						*ret = NULL;
-				}
+					deprecated = "CALLERID(name)";
+				} else
+					goto icky;
 			} else if (!strcmp(var + 6, "ANI")) {
 				/* CALLERANI */
 				if (c->cid.cid_ani) {
@@ -951,6 +956,7 @@
 					*ret = workspace;
 				} else
 					*ret = NULL;
+				deprecated = "CALLERID(ANI)";
 			} else
 				goto icky;
 		} else if (!strncmp(var + 4, "ING", 3)) {
@@ -980,6 +986,7 @@
 			*ret = workspace;
 		} else
 			*ret = NULL;
+		deprecated = "CALLERID(DNID)";
 	} else if (c && !strcmp(var, "HINT")) {
 		if (!ast_get_hint(workspace, workspacelen, NULL, 0, c, c->context, c->exten))
 			*ret = NULL;
@@ -999,6 +1006,7 @@
 			*ret = workspace;
 		} else
 			*ret = NULL;
+		deprecated = "CALLERID(RDNIS)";
 	} else if (c && !strcmp(var, "CONTEXT")) {
 		ast_copy_string(workspace, c->context, workspacelen);
 		*ret = workspace;
@@ -1023,6 +1031,7 @@
 			brokentime.tm_sec
 		);
 		*ret = workspace;
+		deprecated = "STRFTIME(${EPOCH},,\%m\%d\%Y-\%H:\%M:\%S)";
 	} else if (!strcmp(var, "TIMESTAMP")) {
 		thistime=time(NULL);
 		localtime_r(&thistime, &brokentime);
@@ -1036,6 +1045,7 @@
 			brokentime.tm_sec
 		);
 		*ret = workspace;
+		deprecated = "STRFTIME(${EPOCH},,\%Y\%m\%d-\%H\%M\%S)";
 	} else if (c && !strcmp(var, "UNIQUEID")) {
 		snprintf(workspace, workspacelen, "%s", c->uniqueid);
 		*ret = workspace;
@@ -1045,9 +1055,11 @@
 	} else if (c && !strcmp(var, "ACCOUNTCODE")) {
 		ast_copy_string(workspace, c->accountcode, workspacelen);
 		*ret = workspace;
+		deprecated = "CDR(accountcode)";
 	} else if (c && !strcmp(var, "LANGUAGE")) {
 		ast_copy_string(workspace, c->language, workspacelen);
 		*ret = workspace;
+		deprecated = "LANGUAGE()";
 	} else {
 icky:
 		if (headp) {
@@ -1080,6 +1092,9 @@
 				}
 			}
 		}
+	}
+	if (deprecated) {
+		ast_log(LOG_WARNING, "${%s} is deprecated.  Please use ${%s} instead.\n", var, deprecated);
 	}
 }
 



More information about the asterisk-commits mailing list