From 12e6f5ac01cac88f1f2ddd60b6dbe3f8755c5ef8 Mon Sep 17 00:00:00 2001 From: Scott Emidy Date: Fri, 7 Aug 2015 14:20:29 -0500 Subject: ARI: Retrieve existing log channels An http request can be sent to get the existing Asterisk logs. The command "curl -v -u user:pass -X GET 'http://localhost:8088 /ari/asterisk/logging'" can be run in the terminal to access the newly implemented functionality. * Retrieve all existing log channels ASTERISK-25252 Change-Id: I7bb08b93e3b938c991f3f56cc5d188654768a808 --- include/asterisk/logger.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/asterisk/logger.h') diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h index 60b68082e..bf8ce6acf 100644 --- a/include/asterisk/logger.h +++ b/include/asterisk/logger.h @@ -98,6 +98,21 @@ typedef unsigned int ast_callid; void ast_log_callid(int level, const char *file, int line, const char *function, ast_callid callid, const char *fmt, ...) __attribute__((format(printf, 6, 7))); +/*! + * \brief Retrieve the existing log channels + * \param logentry A callback to an updater function + * \param data Data passed into the callback for manipulation + * + * For each of the logging channels, logentry will be executed with the + * channel file name, log type, status of the log, and configuration levels. + * + * \retval 0 on success + * \retval 1 on failure + * \retval -2 on allocation error + */ +int ast_logger_get_channels(int (*logentry)(const char *channel, const char *type, + const char *status, const char *configuration, void *data), void *data); + /*! * \brief Create a log channel * -- cgit v1.2.3