summaryrefslogtreecommitdiff
path: root/main/logger.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2012-06-26 21:45:22 +0000
committerJonathan Rose <jrose@digium.com>2012-06-26 21:45:22 +0000
commit5eb94d7ebbc2c29d4de8201103bcb62ae8afcd31 (patch)
tree454a727e077efa3f74ea80469d0f863066f59c13 /main/logger.c
parentee1111869585af74ea79a0bf45edcee49c00508b (diff)
Unique Call ID logging Phases III and IV
Adds call ID logging changes to specific channel drivers that weren't handled handled in phase II of Call ID Logging. Also covers logging for threads for threads created by systems that may be involved with many different calls. Extra special thanks to Richard for rigorous review of chan_dahdi and its various signalling modules. review: https://reviewboard.asterisk.org/r/1927/ review: https://reviewboard.asterisk.org/r/1950/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/logger.c')
-rw-r--r--main/logger.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/main/logger.c b/main/logger.c
index 6bfafe97d..ca2648190 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -1691,7 +1691,7 @@ void ast_backtrace(void)
#endif /* defined(HAVE_BKTR) */
}
-void __ast_verbose_ap(const char *file, int line, const char *func, int level, const char *fmt, va_list ap)
+void __ast_verbose_ap(const char *file, int line, const char *func, int level, struct ast_callid *callid, const char *fmt, va_list ap)
{
struct ast_str *buf = NULL;
int res = 0;
@@ -1743,15 +1743,30 @@ void __ast_verbose_ap(const char *file, int line, const char *func, int level, c
return;
}
- ast_log(__LOG_VERBOSE, file, line, func, "%s", ast_str_buffer(buf));
+ ast_log_callid(__LOG_VERBOSE, file, line, func, callid, "%s", ast_str_buffer(buf));
}
void __ast_verbose(const char *file, int line, const char *func, int level, const char *fmt, ...)
{
+ struct ast_callid *callid;
va_list ap;
+ callid = ast_read_threadstorage_callid();
+
+ va_start(ap, fmt);
+ __ast_verbose_ap(file, line, func, level, callid, fmt, ap);
+ va_end(ap);
+
+ if (callid) {
+ ast_callid_unref(callid);
+ }
+}
+
+void __ast_verbose_callid(const char *file, int line, const char *func, int level, struct ast_callid *callid, const char *fmt, ...)
+{
+ va_list ap;
va_start(ap, fmt);
- __ast_verbose_ap(file, line, func, level, fmt, ap);
+ __ast_verbose_ap(file, line, func, level, callid, fmt, ap);
va_end(ap);
}
@@ -1760,11 +1775,18 @@ void __ast_verbose(const char *file, int line, const char *func, int level, cons
void __attribute__((format(printf, 1,2))) ast_verbose(const char *fmt, ...);
void ast_verbose(const char *fmt, ...)
{
+ struct ast_callid *callid;
va_list ap;
+ callid = ast_read_threadstorage_callid();
+
va_start(ap, fmt);
- __ast_verbose_ap("", 0, "", 0, fmt, ap);
+ __ast_verbose_ap("", 0, "", 0, callid, fmt, ap);
va_end(ap);
+
+ if (callid) {
+ ast_callid_unref(callid);
+ }
}
int ast_register_verbose(void (*v)(const char *string))