summaryrefslogtreecommitdiff
path: root/include/asterisk/pbx.h
diff options
context:
space:
mode:
authorJonathan R. Rose <jonathan.rose@motorolasolutions.com>2016-12-19 15:03:52 -0600
committerJonathan R. Rose <jonathan.rose@motorolasolutions.com>2017-01-04 14:06:20 -0600
commitd96e3502564508bf753aa637c5e1a0311924ab3d (patch)
tree41ec9b7747b59a87b846c984ae07b14cda9445bb /include/asterisk/pbx.h
parent31268e0a280110748f33314a2c09563c576243de (diff)
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
Diffstat (limited to 'include/asterisk/pbx.h')
-rw-r--r--include/asterisk/pbx.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index 00ca4acbe..386f3c38b 100644
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -505,11 +505,15 @@ int ast_add_extension(const char *context, int replace, const char *extension,
/*!
* \brief Add an extension to an extension context, this time with an ast_context *.
*
- * \note For details about the arguments, check ast_add_extension()
+ * \param registrar_file optional configuration file that defines this extension
+ * \param registrar_line optional line number of configuration file that defines extension
+ *
+ * \note For details about the other arguments, check ast_add_extension()
*/
int ast_add_extension2(struct ast_context *con, int replace, const char *extension,
int priority, const char *label, const char *callerid,
- const char *application, void *data, void (*datad)(void *), const char *registrar);
+ const char *application, void *data, void (*datad)(void *), const char *registrar,
+ const char *registrar_file, int registrar_line);
/*!
* \brief Same as ast_add_extension2, but assumes you have already locked context
@@ -520,7 +524,8 @@ int ast_add_extension2(struct ast_context *con, int replace, const char *extensi
*/
int ast_add_extension2_nolock(struct ast_context *con, int replace, const char *extension,
int priority, const char *label, const char *callerid,
- const char *application, void *data, void (*datad)(void *), const char *registrar);
+ const char *application, void *data, void (*datad)(void *), const char *registrar,
+ const char *registrar_file, int registrar_line);
/*!
* \brief Map devstate to an extension state.
@@ -1266,6 +1271,23 @@ const char *ast_get_ignorepat_registrar(const struct ast_ignorepat *ip);
const char *ast_get_switch_registrar(const struct ast_sw *sw);
/*! @} */
+/*!
+ * \brief Get name of configuration file used by registrar to register this extension
+ *
+ * \retval NULL if registrar did not indicate config file when registering the extension
+ * \retval name of the file used to register the extension
+ */
+const char *ast_get_extension_registrar_file(struct ast_exten *e);
+
+/*!
+ * \brief Get line number of configuration file used by registrar to register this extension
+ *
+ * \retval 0 if the line wasn't indicated when the extension was registered
+ * \retval positive integer indicating what line in the config file was responsible for
+ * registering the extension.
+ */
+int ast_get_extension_registrar_line(struct ast_exten *e);
+
/*! @name Walking functions ... */
/*! @{ */
struct ast_context *ast_walk_contexts(struct ast_context *con);