diff options
author | Jonathan Rose <jrose@digium.com> | 2012-03-29 19:54:35 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2012-03-29 19:54:35 +0000 |
commit | bf994f0e04696ba11ce0ec81df7880d61ef9c779 (patch) | |
tree | 280a6b0607ecb586b6e8f41bf41c2a559b6c5972 /apps | |
parent | dd9405db057da671c115619c9a5f8082ede2e134 (diff) |
Introducing the log message unique call identifiers feature
Log messages will now display a call number that they are tied to (ordered for calls
based on when they started). This feature is made to be minimally invasive without
requiring changes to many of the existing log messages. These IDs won't show up for
verbose messages on CLI (but they will in log files) This is currently in phase II
of production, see more about this feature on the wiki --
https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging
Review: https://reviewboard.asterisk.org/r/1823/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_mixmonitor.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index a89b6cc5d..c1f5ada72 100644 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -240,6 +240,7 @@ static const char * const mixmonitor_spy_type = "MixMonitor"; struct mixmonitor { struct ast_audiohook audiohook; + struct ast_callid *callid; char *filename; char *filename_read; char *filename_write; @@ -395,6 +396,10 @@ static void mixmonitor_free(struct mixmonitor *mixmonitor) ast_free(mixmonitor->name); ast_free(mixmonitor->post_process); } + + if (mixmonitor->callid) { + ast_callid_unref(mixmonitor->callid); + } ast_free(mixmonitor); } } @@ -440,6 +445,11 @@ static void *mixmonitor_thread(void *obj) int errflag = 0; struct ast_format format_slin; + /* Keep callid association before any log messages */ + if (mixmonitor->callid) { + ast_callid_threadassoc_add(mixmonitor->callid); + } + ast_verb(2, "Begin MixMonitor Recording %s\n", mixmonitor->name); fs = &mixmonitor->mixmonitor_ds->fs; @@ -674,6 +684,9 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename return; } + /* reference be released at mixmonitor destruction */ + mixmonitor->callid = ast_read_threadstorage_callid(); + ast_pthread_create_detached_background(&thread, NULL, mixmonitor_thread, mixmonitor); } |