diff options
author | zuul <zuul@gerrit.asterisk.org> | 2017-01-27 17:49:43 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-01-27 17:49:43 -0600 |
commit | 484e8ed5e36675972cff329d522ab7c1503a19de (patch) | |
tree | f7a6a67e389eff4fb618e493c6b05b20e87a4828 /channels | |
parent | bcb2c1f62ff9e427313dbb54e1a56fc31976fedb (diff) | |
parent | 456bc3c704ffce7807caa6f5f4bc92ed1720c871 (diff) |
Merge "debug_utilities: Add ast_logescalator" into 13
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 51c17c538..83f72b9ad 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -609,6 +609,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") </managerEvent> ***/ +static int log_level = -1; + static int min_expiry = DEFAULT_MIN_EXPIRY; /*!< Minimum accepted registration time */ static int max_expiry = DEFAULT_MAX_EXPIRY; /*!< Maximum accepted registration time */ static int default_expiry = DEFAULT_DEFAULT_EXPIRY; @@ -3934,6 +3936,9 @@ static __attribute__((format(printf, 2, 0))) void append_history_va(struct sip_p } AST_LIST_INSERT_TAIL(p->history, hist, list); p->history_entries++; + if (log_level != -1) { + ast_log_dynamic_level(log_level, "%s\n", buf); + } } /*! \brief Append to SIP dialog history with arg list */ @@ -35080,6 +35085,10 @@ static int load_module(void) struct sip_peer *bogus_peer; ast_verbose("SIP channel loading...\n"); + log_level = ast_logger_register_level("SIP_HISTORY"); + if (log_level < 0) { + ast_log(LOG_WARNING, "Unable to register history log level\n"); + } if (STASIS_MESSAGE_TYPE_INIT(session_timeout_type)) { unload_module(); @@ -35478,6 +35487,9 @@ static int unload_module(void) sip_cfg.caps = NULL; STASIS_MESSAGE_TYPE_CLEANUP(session_timeout_type); + if (log_level != -1) { + ast_logger_unregister_level("SIP_HISTORY"); + } return 0; } |