mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
Merge the dialplan_aesthetics branch. Most of this patch simply converts applications
using old methods of parsing arguments to using the standard macros. However, the big change is that the really old way of specifying application and arguments separated by a comma will no longer work (e.g. NoOp,foo|bar). Instead, the way that has been recommended since long before 1.0 will become the only method available (e.g. NoOp(foo,bar). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1386,7 +1386,7 @@ static int pbx_load_config(const char *config_file)
|
||||
if (tc) {
|
||||
int ipri = -2;
|
||||
char realext[256]="";
|
||||
char *plus, *firstp, *firstc;
|
||||
char *plus, *firstp;
|
||||
char *pri, *appl, *data, *cidmatch;
|
||||
char *stringp = tc;
|
||||
char *ext = strsep(&stringp, ",");
|
||||
@@ -1433,19 +1433,12 @@ static int pbx_load_config(const char *config_file)
|
||||
ipri = 0;
|
||||
}
|
||||
appl = S_OR(stringp, "");
|
||||
/* Find the first occurrence of either '(' or ',' */
|
||||
firstc = strchr(appl, ',');
|
||||
/* Find the first occurrence of '(' */
|
||||
firstp = strchr(appl, '(');
|
||||
if (firstc && (!firstp || firstc < firstp)) {
|
||||
/* comma found, no parenthesis */
|
||||
/* or both found, but comma found first */
|
||||
appl = strsep(&stringp, ",");
|
||||
data = stringp;
|
||||
} else if (!firstc && !firstp) {
|
||||
/* Neither found */
|
||||
if (!firstp) {
|
||||
/* No arguments */
|
||||
data = "";
|
||||
} else {
|
||||
/* Final remaining case is parenthesis found first */
|
||||
appl = strsep(&stringp, "(");
|
||||
data = stringp;
|
||||
end = strrchr(data, ')');
|
||||
@@ -1454,11 +1447,10 @@ static int pbx_load_config(const char *config_file)
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
|
||||
}
|
||||
ast_process_quotes_and_slashes(data, ',', '|');
|
||||
}
|
||||
|
||||
if (!data)
|
||||
data="";
|
||||
data = "";
|
||||
appl = ast_skip_blanks(appl);
|
||||
if (ipri) {
|
||||
if (plus)
|
||||
@@ -1483,7 +1475,7 @@ static int pbx_load_config(const char *config_file)
|
||||
if (ast_context_add_ignorepat2(con, realvalue, registrar))
|
||||
ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s'\n", v->value, cxt);
|
||||
} else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
|
||||
char *stringp= realvalue;
|
||||
char *stringp = realvalue;
|
||||
char *appl, *data;
|
||||
|
||||
memset(realvalue, 0, sizeof(realvalue));
|
||||
@@ -1492,9 +1484,7 @@ static int pbx_load_config(const char *config_file)
|
||||
else
|
||||
ast_copy_string(realvalue, v->value, sizeof(realvalue));
|
||||
appl = strsep(&stringp, "/");
|
||||
data = strsep(&stringp, ""); /* XXX what for ? */
|
||||
if (!data)
|
||||
data = "";
|
||||
data = S_OR(stringp, "");
|
||||
if (ast_context_add_switch2(con, appl, data, !strcasecmp(v->name, "eswitch"), registrar))
|
||||
ast_log(LOG_WARNING, "Unable to include switch '%s' in context '%s'\n", v->value, cxt);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user