mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +00:00
Merged revisions 262419 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r262419 | pabelanger | 2010-05-11 15:40:37 -0400 (Tue, 11 May 2010) | 8 lines Improve logging by displaying line number (closes issue #16303) Reported by: dant Patches: issue16303.patch.v2 uploaded by pabelanger (license 224) Tested by: dant, lmadsen, pabelanger ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@262427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1415,12 +1415,12 @@ static int pbx_load_config(const char *config_file)
|
|||||||
if (lastpri > -2)
|
if (lastpri > -2)
|
||||||
ipri = lastpri + 1;
|
ipri = lastpri + 1;
|
||||||
else
|
else
|
||||||
ast_log(LOG_WARNING, "Can't use 'next' priority on the first entry!\n");
|
ast_log(LOG_WARNING, "Can't use 'next' priority on the first entry at line %d!\n", v->lineno);
|
||||||
} else if (!strcmp(pri, "same") || !strcmp(pri, "s")) {
|
} else if (!strcmp(pri, "same") || !strcmp(pri, "s")) {
|
||||||
if (lastpri > -2)
|
if (lastpri > -2)
|
||||||
ipri = lastpri;
|
ipri = lastpri;
|
||||||
else
|
else
|
||||||
ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
|
ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry at line %d!\n", v->lineno);
|
||||||
} else if (sscanf(pri, "%30d", &ipri) != 1 &&
|
} else if (sscanf(pri, "%30d", &ipri) != 1 &&
|
||||||
(ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) {
|
(ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) {
|
||||||
ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno);
|
ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno);
|
||||||
@@ -1452,7 +1452,7 @@ static int pbx_load_config(const char *config_file)
|
|||||||
if ((end = strrchr(data, ')'))) {
|
if ((end = strrchr(data, ')'))) {
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s'\n", appl, data);
|
ast_log(LOG_WARNING, "No closing parenthesis found? '%s(%s' %d\n", appl, data, v->lineno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast_free(orig_appl);
|
ast_free(orig_appl);
|
||||||
@@ -1476,11 +1476,11 @@ static int pbx_load_config(const char *config_file)
|
|||||||
} else if (!strcasecmp(v->name, "include")) {
|
} else if (!strcasecmp(v->name, "include")) {
|
||||||
pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
|
pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
|
||||||
if (ast_context_add_include2(con, realvalue, registrar))
|
if (ast_context_add_include2(con, realvalue, registrar))
|
||||||
ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
|
ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s' at line %d\n", v->value, cxt, v->lineno);
|
||||||
} else if (!strcasecmp(v->name, "ignorepat")) {
|
} else if (!strcasecmp(v->name, "ignorepat")) {
|
||||||
pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
|
pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
|
||||||
if (ast_context_add_ignorepat2(con, realvalue, registrar))
|
if (ast_context_add_ignorepat2(con, realvalue, registrar))
|
||||||
ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s'\n", v->value, cxt);
|
ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s' at line %d\n", v->value, cxt, v->lineno);
|
||||||
} else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
|
} else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
|
||||||
char *stringp = realvalue;
|
char *stringp = realvalue;
|
||||||
char *appl, *data;
|
char *appl, *data;
|
||||||
@@ -1492,7 +1492,7 @@ static int pbx_load_config(const char *config_file)
|
|||||||
appl = strsep(&stringp, "/");
|
appl = strsep(&stringp, "/");
|
||||||
data = S_OR(stringp, "");
|
data = S_OR(stringp, "");
|
||||||
if (ast_context_add_switch2(con, appl, data, !strcasecmp(v->name, "eswitch"), registrar))
|
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);
|
ast_log(LOG_WARNING, "Unable to include switch '%s' in context '%s' at line %d\n", v->value, cxt, v->lineno);
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING, "==!!== Unknown directive: %s at line %d -- IGNORING!!!\n", v->name, v->lineno);
|
ast_log(LOG_WARNING, "==!!== Unknown directive: %s at line %d -- IGNORING!!!\n", v->name, v->lineno);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user