[svn-commits] trunk - r8157 in /trunk: ./ channels/ pbx/ res/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jan 17 16:45:06 MST 2006


Author: kpfleming
Date: Tue Jan 17 17:45:05 2006
New Revision: 8157

URL: http://svn.digium.com/view/asterisk?rev=8157&view=rev
Log:
remove some more deprecated (pre-1.2) stuff

Modified:
    trunk/channels/chan_sip.c
    trunk/manager.c
    trunk/pbx.c
    trunk/pbx/pbx_dundi.c
    trunk/res/res_features.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=8157&r1=8156&r2=8157&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Jan 17 17:45:05 2006
@@ -12786,27 +12786,6 @@
 static char *descrip_dtmfmode = "SIPDtmfMode(inband|info|rfc2833): Changes the dtmfmode for a SIP call\n";
 static char *app_dtmfmode = "SIPDtmfMode";
 
-static char *app_sipaddheader = "SIPAddHeader";
-static char *synopsis_sipaddheader = "Add a SIP header to the outbound call";
-
-
-static char *descrip_sipaddheader = ""
-"  SIPAddHeader(Header: Content)\n"
-"Adds a header to a SIP call placed with DIAL.\n"
-"Remember to user the X-header if you are adding non-standard SIP\n"
-"headers, like \"X-Asterisk-Accountcode:\". Use this with care.\n"
-"Adding the wrong headers may jeopardize the SIP dialog.\n"
-"Always returns 0\n";
-
-static char *app_sipgetheader = "SIPGetHeader";
-static char *synopsis_sipgetheader = "Get a SIP header from an incoming call";
- 
-static char *descrip_sipgetheader = ""
-"  SIPGetHeader(var=headername): \n"
-"Sets a channel variable to the content of a SIP header\n"
-"Skips to priority+101 if header does not exist\n"
-"Otherwise returns 0\n";
-
 /*! \brief  sip_dtmfmode: change the DTMFmode for a SIP call (application) ---*/
 static int sip_dtmfmode(struct ast_channel *chan, void *data)
 {
@@ -12853,90 +12832,6 @@
 		}
 	}
 	ast_mutex_unlock(&p->lock);
-	ast_mutex_unlock(&chan->lock);
-	return 0;
-}
-
-/*! \brief  sip_addheader: Add a SIP header ---*/
-static int sip_addheader(struct ast_channel *chan, void *data)
-{
-	int arglen;
-	int no = 0;
-	int ok = 0;
-	const char *content = (char *) NULL;
-	char varbuf[128];
-	
-	arglen = strlen(data);
-	if (!arglen) {
-		ast_log(LOG_WARNING, "This application requires the argument: Header\n");
-		return 0;
-	}
-	ast_mutex_lock(&chan->lock);
-
-	/* Check for headers */
-	while (!ok && no <= 50) {
-		no++;
-		snprintf(varbuf, sizeof(varbuf), "_SIPADDHEADER%.2d", no);
-		content = pbx_builtin_getvar_helper(chan, varbuf);
-
-		if (!content)
-			ok = 1;
-	}
-	if (ok) {
-		pbx_builtin_setvar_helper (chan, varbuf, data);
-		if (sipdebug)
-			ast_log(LOG_DEBUG,"SIP Header added \"%s\" as %s\n", (char *) data, varbuf);
-	} else {
-		ast_log(LOG_WARNING, "Too many SIP headers added, max 50\n");
-	}
-	ast_mutex_unlock(&chan->lock);
-	return 0;
-}
-
-/*! \brief  sip_getheader: Get a SIP header (dialplan app) ---*/
-static int sip_getheader(struct ast_channel *chan, void *data)
-{
-	static int dep_warning = 0;
-	struct sip_pvt *p;
-	char *argv, *varname = NULL, *header = NULL, *content;
-	
-	if (!dep_warning) {
-		ast_log(LOG_WARNING, "SIPGetHeader is deprecated, use the SIP_HEADER function instead.\n");
-		dep_warning = 1;
-	}
-
-	argv = ast_strdupa(data);
-	if (!argv) {
-		ast_log(LOG_DEBUG, "Memory allocation failed\n");
-		return 0;
-	}
-
-	if (strchr (argv, '=') ) {	/* Pick out argumenet */
-		varname = strsep (&argv, "=");
-		header = strsep (&argv, "\0");
-	}
-
-	if (!varname || !header) {
-		ast_log(LOG_DEBUG, "SipGetHeader: Ignoring command, Syntax error in argument\n");
-		return 0;
-	}
-
-	ast_mutex_lock(&chan->lock);
-	if (chan->type != channeltype) {
-		ast_log(LOG_WARNING, "Call this application only on incoming SIP calls\n");
-		ast_mutex_unlock(&chan->lock);
-		return 0;
-	}
-
-	p = chan->tech_pvt;
-	content = get_header(&p->initreq, header);	/* Get the header */
-	if (!ast_strlen_zero(content)) {
-		pbx_builtin_setvar_helper(chan, varname, content);
-	} else {
-		ast_log(LOG_WARNING,"SIP Header %s not found for channel variable %s\n", header, varname);
-		ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
-	}
-	
 	ast_mutex_unlock(&chan->lock);
 	return 0;
 }
@@ -13162,10 +13057,6 @@
 	/* Register dialplan applications */
 	ast_register_application(app_dtmfmode, sip_dtmfmode, synopsis_dtmfmode, descrip_dtmfmode);
 
-	/* These will be removed soon */
-	ast_register_application(app_sipaddheader, sip_addheader, synopsis_sipaddheader, descrip_sipaddheader);
-	ast_register_application(app_sipgetheader, sip_getheader, synopsis_sipgetheader, descrip_sipgetheader);
-
 	/* Register dialplan functions */
 	ast_custom_function_register(&sip_header_function);
 	ast_custom_function_register(&sippeer_function);
@@ -13200,8 +13091,6 @@
 	ast_custom_function_unregister(&checksipdomain_function);
 
 	ast_unregister_application(app_dtmfmode);
-	ast_unregister_application(app_sipaddheader);
-	ast_unregister_application(app_sipgetheader);
 
 	ast_cli_unregister_multiple(my_clis, sizeof(my_clis) / sizeof(my_clis[0]));
 

Modified: trunk/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/manager.c?rev=8157&r1=8156&r2=8157&view=diff
==============================================================================
--- trunk/manager.c (original)
+++ trunk/manager.c Tue Jan 17 17:45:05 2006
@@ -1708,12 +1708,6 @@
 			ast_log(LOG_WARNING, "Invalid port number '%s'\n", val);
 			portno = DEFAULT_MANAGER_PORT;
 		}
-	} else if ((val = ast_variable_retrieve(cfg, "general", "portno"))) {
-		if (sscanf(val, "%d", &portno) != 1) {
-			ast_log(LOG_WARNING, "Invalid port number '%s'\n", val);
-			portno = DEFAULT_MANAGER_PORT;
-		}
-		ast_log(LOG_NOTICE, "Use of portno in manager.conf deprecated.  Please use 'port=%s' instead.\n", val);
 	}
 
 	if ((val = ast_variable_retrieve(cfg, "general", "displayconnects")))

Modified: trunk/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx.c?rev=8157&r1=8156&r2=8157&view=diff
==============================================================================
--- trunk/pbx.c (original)
+++ trunk/pbx.c Tue Jan 17 17:45:05 2006
@@ -892,7 +892,7 @@
 void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp)
 {
 	const char not_found = '\0';
-	char tmpvar[80], *deprecated = NULL;
+	char tmpvar[80];
 	const char *s;	/* the result */
 	int offset, length;
 	int i, need_substring;
@@ -918,38 +918,12 @@
 	 * s = workspace if the result has been assembled there;
 	 * s != workspace in case we have a string, that needs to be copied
 	 *	(the ast_copy_string is done once for all at the end).
-	 * Deprecated variables have the replacement indicated in 'deprecated'.
 	 */
 	s = &not_found;	/* default value */
 	if (c) {	/* This group requires a valid channel */
 		/* Names with common parts are looked up a piece at a time using strncmp. */
 		if (!strncmp(var, "CALL", 4)) {
-			if (!strncmp(var + 4, "ER", 2)) {
-				if (!strncmp(var + 6, "ID", 2)) {
-					if (!var[8]) {	 			/* CALLERID */
-						if (c->cid.cid_num) {
-							if (c->cid.cid_name) {
-								snprintf(workspace, workspacelen, "\"%s\" <%s>",
-										c->cid.cid_name, c->cid.cid_num);
-								s = workspace;
-							} else {
-								s = c->cid.cid_num;
-							}
-						} else
-							s = c->cid.cid_name; /* possibly empty */
-						deprecated = "CALLERID(all)";
-					} else if (!strcmp(var + 8, "NUM")) {	/* CALLERIDNUM */
-						s = c->cid.cid_num;
-						deprecated = "CALLERID(num)";
-					} else if (!strcmp(var + 8, "NAME")) {	/* CALLERIDNAME */
-						s = c->cid.cid_name;
-						deprecated = "CALLERID(name)";
-					}
-				} else if (!strcmp(var + 6, "ANI")) {		/* CALLERANI */
-					s = c->cid.cid_ani;
-					deprecated = "CALLERID(ANI)";
-				}
-			} else if (!strncmp(var + 4, "ING", 3)) {
+			if (!strncmp(var + 4, "ING", 3)) {
 				if (!strcmp(var + 7, "PRES")) {			/* CALLINGPRES */
 					snprintf(workspace, workspacelen, "%d", c->cid.cid_pres);
 					s = workspace;
@@ -964,18 +938,12 @@
 					s = workspace;
 				}
 			}
-		} else if (!strcmp(var, "DNID")) {
-			s = c->cid.cid_dnid;
-			deprecated = "CALLERID(DNID)";
 		} else if (!strcmp(var, "HINT")) {
 			s = ast_get_hint(workspace, workspacelen, NULL, 0, c, c->context, c->exten) ? workspace : NULL;
 		} else if (!strcmp(var, "HINTNAME")) {
 			s = ast_get_hint(NULL, 0, workspace, workspacelen, c, c->context, c->exten) ? workspace : NULL;
 		} else if (!strcmp(var, "EXTEN")) {
 			s = c->exten;
-		} else if (!strcmp(var, "RDNIS")) {
-			s = c->cid.cid_rdnis;
-			deprecated = "CALLERID(RDNIS)";
 		} else if (!strcmp(var, "CONTEXT")) {
 			s = c->context;
 		} else if (!strcmp(var, "PRIORITY")) {
@@ -988,48 +956,12 @@
 		} else if (!strcmp(var, "HANGUPCAUSE")) {
 			snprintf(workspace, workspacelen, "%d", c->hangupcause);
 			s = workspace;
-		} else if (!strcmp(var, "ACCOUNTCODE")) {
-			s = c->accountcode;
-			deprecated = "CDR(accountcode)";
-		} else if (!strcmp(var, "LANGUAGE")) {
-			s = c->language;
-			deprecated = "LANGUAGE()";
 		}
 	}
 	if (s == &not_found) { /* look for more */
-		time_t thistime;
-		struct tm brokentime;
-
 		if (!strcmp(var, "EPOCH")) {
 			snprintf(workspace, workspacelen, "%u",(int)time(NULL));
 			s = workspace;
-		} else if (!strcmp(var, "DATETIME")) {
-			thistime=time(NULL);
-			localtime_r(&thistime, &brokentime);
-			snprintf(workspace, workspacelen, "%02d%02d%04d-%02d:%02d:%02d",
-				brokentime.tm_mday,
-				brokentime.tm_mon+1,
-				brokentime.tm_year+1900,
-				brokentime.tm_hour,
-				brokentime.tm_min,
-				brokentime.tm_sec
-			);
-			s = workspace;
-			deprecated = "STRFTIME(${EPOCH},,\%d\%m\%Y-\%H:\%M:\%S)";
-		} else if (!strcmp(var, "TIMESTAMP")) {
-			thistime=time(NULL);
-			localtime_r(&thistime, &brokentime);
-			/* 20031130-150612 */
-			snprintf(workspace, workspacelen, "%04d%02d%02d-%02d%02d%02d",
-				brokentime.tm_year+1900,
-				brokentime.tm_mon+1,
-				brokentime.tm_mday,
-				brokentime.tm_hour,
-				brokentime.tm_min,
-				brokentime.tm_sec
-			);
-			s = workspace;
-			deprecated = "STRFTIME(${EPOCH},,\%Y\%m\%d-\%H\%M\%S)";
 		}
 	}
 	/* if not found, look into chanvars or global vars */
@@ -1053,9 +985,6 @@
 		if (need_substring)
 			*ret = substring(*ret, offset, length, workspace, workspacelen);
 	}
-		
-	if (deprecated)
-		ast_log(LOG_WARNING, "${%s} is deprecated.  Please use ${%s} instead.\n", var, deprecated);
 }
 
 /*! \brief CLI function to show installed custom functions 

Modified: trunk/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_dundi.c?rev=8157&r1=8156&r2=8157&view=diff
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Tue Jan 17 17:45:05 2006
@@ -78,20 +78,6 @@
 extern char ast_config_AST_KEY_DIR[];
 
 static char *tdesc = "Distributed Universal Number Discovery (DUNDi)";
-
-static char *app = "DUNDiLookup";
-static char *synopsis = "Look up a number with DUNDi";
-static char *descrip = 
-"DUNDiLookup(number[|context[|options]])\n"
-"      Looks up a given number in the global context specified or in\n"
-"the reserved 'e164' context if not specified.  Returns -1 if the channel\n"
-"is hungup during the lookup or 0 otherwise.  On completion, the variable\n"
-"${DUNDTECH} and ${DUNDDEST} will contain the technology and destination\n"
-"of the appropriate technology and destination to access the number. If no\n"
-"answer was found, and the priority n + 101 exists, execution will continue\n"
-"at that location. Note that this will only occur if the global priority\n"
-"jumping option is enabled in extensions.conf. If the 'b' option is specified,\n"
-"the internal DUNDi cache will by bypassed.\n";
 
 #define DUNDI_MODEL_INBOUND		(1 << 0)
 #define DUNDI_MODEL_OUTBOUND	(1 << 1)
@@ -3849,75 +3835,6 @@
 	struct dundi_hint_metadata hmd;
 	memset(&hmd, 0, sizeof(hmd));
 	return dundi_query_eid_internal(dei, dcontext, &eid, &hmd, dundi_ttl, 0, avoid);
-}
-
-/*! 
- * \ingroup applications
- */
-static int dundi_lookup_exec(struct ast_channel *chan, void *data)
-{
-	char *num;
-	char *context;
-	char *opts;
-	int results;
-	int x;
-	int bypass = 0;
-	struct localuser *u;
-	struct dundi_result dr[MAX_RESULTS];
-	static int dep_warning = 0;
-
-	LOCAL_USER_ADD(u);
-
-	if (!dep_warning) {
-		ast_log(LOG_WARNING, "This application has been deprecated in favor of the DUNDILOOKUP dialplan function.\n");
-		dep_warning = 1;
-	}
-
-	if (ast_strlen_zero(data)) {
-		ast_log(LOG_WARNING, "DUNDiLookup requires an argument (number)\n");
-		LOCAL_USER_REMOVE(u);
-		return 0;
-	}
-
-	num = ast_strdupa(data);
-	if (!num) {
-		ast_log(LOG_ERROR, "Out of memory!\n");
-		LOCAL_USER_REMOVE(u);
-		return 0;
-	}
-
-	context = strchr(num, '|');
-	if (context) {
-		*context = '\0';
-		context++;
-		opts = strchr(context, '|');
-		if (opts) {
-			*opts = '\0';
-			opts++;
-			if (strchr(opts, 'b'))
-				bypass = 1;
-		}
-	}
-
-	if (ast_strlen_zero(context))
-		context = "e164";
-	
-	results = dundi_lookup(dr, MAX_RESULTS, NULL, context, num, bypass);
-	if (results > 0) {
-		sort_results(dr, results);
-		for (x = 0; x < results; x++) {
-			if (ast_test_flag(dr + x, DUNDI_FLAG_EXISTS)) {
-				pbx_builtin_setvar_helper(chan, "DUNDTECH", dr[x].tech);
-				pbx_builtin_setvar_helper(chan, "DUNDDEST", dr[x].dest);
-				break;
-			}
-		}
-	} else if (ast_opt_priority_jumping)
-		ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
-
-	LOCAL_USER_REMOVE(u);
-
-	return 0;
 }
 
 static char *dundifunc_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
@@ -4706,8 +4623,8 @@
 
 int unload_module(void)
 {
-	int res;
 	STANDARD_HANGUP_LOCALUSERS;
+
 	ast_cli_unregister(&cli_debug);
 	ast_cli_unregister(&cli_store_history);
 	ast_cli_unregister(&cli_flush);
@@ -4725,8 +4642,8 @@
 	ast_cli_unregister(&cli_queryeid);
 	ast_unregister_switch(&dundi_switch);
 	ast_custom_function_unregister(&dundi_function);
-	res = ast_unregister_application(app);
-	return res;
+
+	return 0;
 }
 
 int reload(void)
@@ -4804,7 +4721,6 @@
 	ast_cli_register(&cli_queryeid);
 	if (ast_register_switch(&dundi_switch))
 		ast_log(LOG_ERROR, "Unable to register DUNDi switch\n");
-	ast_register_application(app, dundi_lookup_exec, synopsis, descrip);
 	ast_custom_function_register(&dundi_function); 
 	
 	return res;

Modified: trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_features.c?rev=8157&r1=8156&r2=8157&view=diff
==============================================================================
--- trunk/res/res_features.c (original)
+++ trunk/res/res_features.c Tue Jan 17 17:45:05 2006
@@ -1998,11 +1998,6 @@
 	featuredigittimeout = DEFAULT_FEATURE_DIGIT_TIMEOUT;
 
 	cfg = ast_config_load("features.conf");
-	if (!cfg) {
-		cfg = ast_config_load("parking.conf");
-		if (cfg)
-			ast_log(LOG_NOTICE, "parking.conf is deprecated in favor of 'features.conf'.  Please rename it.\n");
-	}
 	if (cfg) {
 		var = ast_variable_browse(cfg, "general");
 		while(var) {



More information about the svn-commits mailing list