core/pbx: dialplan show - display filename/line#

Adds the ability for extensions to be registered to include filename and
line number so that dialplan show output can show the filename and line
number of a config file responsible for generating a given extension.

This only affects config modules that are written to use the new extension
registering functions. In this patch, that only includes pbx_config, so
extensions registered in extensions.conf and any included extension will
be shown in this manner. Extensions registered in this manner will show
the filename and line number *instead* of the registrar.

ASTERISK-26658 #close
Reported by: Jonathan R. Rose

Change-Id: Ieccc6abccdff34ed5c7da3511fd24972b8f2dd30
This commit is contained in:
Jonathan R. Rose
2016-12-19 15:03:52 -06:00
parent 31268e0a28
commit d96e350256
10 changed files with 106 additions and 30 deletions

View File

@@ -4234,7 +4234,7 @@ void add_extensions(struct ael_extension *exten)
pbx_substitute_variables_helper(NULL, exten->name, realext, sizeof(realext) - 1);
if (exten->hints) {
if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, PRIORITY_HINT, NULL, exten->cidmatch,
exten->hints, NULL, ast_free_ptr, registrar)) {
exten->hints, NULL, ast_free_ptr, registrar, NULL, 0)) {
ast_log(LOG_WARNING, "Unable to add step at priority 'hint' of extension '%s'\n",
exten->name);
}
@@ -4314,7 +4314,7 @@ void add_extensions(struct ael_extension *exten)
label = 0;
if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, pr->priority_num, (label?label:NULL), exten->cidmatch,
app, strdup(appargs), ast_free_ptr, registrar)) {
app, strdup(appargs), ast_free_ptr, registrar, NULL, 0)) {
ast_log(LOG_WARNING, "Unable to add step at priority '%d' of extension '%s'\n", pr->priority_num,
exten->name);
}