From 8723f63be109a9068888228ffa773090deca7473 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Tue, 17 Jan 2006 23:45:05 +0000 Subject: remove some more deprecated (pre-1.2) stuff git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8157 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_sip.c | 111 ---------------------------------------------------- manager.c | 6 --- pbx.c | 75 +---------------------------------- pbx/pbx_dundi.c | 90 ++---------------------------------------- res/res_features.c | 5 --- 5 files changed, 5 insertions(+), 282 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 29bdfb947..ffc867061 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12786,27 +12786,6 @@ static char *synopsis_dtmfmode = "Change the dtmfmode for a SIP call"; 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) { @@ -12857,90 +12836,6 @@ static int sip_dtmfmode(struct ast_channel *chan, void *data) 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; -} - /*! \brief sip_sipredirect: Transfer call before connect with a 302 redirect ---*/ /* Called by the transfer() dialplan application through the sip_transfer() */ /* pbx interface function if the call is in ringing state */ @@ -13162,10 +13057,6 @@ int load_module() /* 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 @@ int unload_module() 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])); diff --git a/manager.c b/manager.c index da3fc82c3..69140bc00 100644 --- a/manager.c +++ b/manager.c @@ -1708,12 +1708,6 @@ int init_manager(void) 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"))) diff --git a/pbx.c b/pbx.c index 7759e141b..692b520fe 100644 --- a/pbx.c +++ b/pbx.c @@ -892,7 +892,7 @@ static char *substring(char *value, int offset, int length, char *workspace, siz 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 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c * 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 = ¬_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 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c 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 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c } 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 == ¬_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 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c 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 diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 86e35a7f7..554ff2f4e 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -79,20 +79,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) #define DUNDI_MODEL_SYMMETRIC (DUNDI_MODEL_INBOUND | DUNDI_MODEL_OUTBOUND) @@ -3851,75 +3837,6 @@ int dundi_query_eid(struct dundi_entity_info *dei, const char *dcontext, dundi_e 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) { char *num; @@ -4706,8 +4623,8 @@ static int set_config(char *config_file, struct sockaddr_in* sin) 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 @@ int unload_module(void) 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 @@ int load_module(void) 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; diff --git a/res/res_features.c b/res/res_features.c index 0f8f5d57c..4aa252011 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -1998,11 +1998,6 @@ static int load_config(void) 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) { -- cgit v1.2.3