diff options
author | Kevin Harwell <kharwell@digium.com> | 2013-02-15 17:38:22 +0000 |
---|---|---|
committer | Kevin Harwell <kharwell@digium.com> | 2013-02-15 17:38:22 +0000 |
commit | 71bce17720d92ec286a2e85cdbc74545c7a4339f (patch) | |
tree | 2ecdd189cbd5e3fe89cb031e0657b07d173d910a /main/autoservice.c | |
parent | f008baddac22ba72415909ea65ac25a8a076836b (diff) |
Stopped spamming of debug messages during attended transfer.
While autoservice is running and servicing a channel the callid is being stored
and removed in the thread's local storage for each iteration of the thread loop.
If debug was set to a sufficient level the log file would be spammed with callid
thread local storage debug messages.
Added a new function that checks to see if the callid to be stored is different
than what is already contained (if anything). If it is different then
store/replace and log, otherwise just leave as is. Also made it so all logging
of debug messages pertaining to the callid thread storage outputs only when
TEST_FRAMEWORK is defined.
(issue ASTERISK-21014)
(closes issue ASTERISK-21014)
Report by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2324/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/autoservice.c')
-rw-r--r-- | main/autoservice.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/main/autoservice.c b/main/autoservice.c index afbcbd3e0..5b0c722ef 100644 --- a/main/autoservice.c +++ b/main/autoservice.c @@ -77,6 +77,7 @@ static int as_chan_list_state; static void *autoservice_run(void *ign) { + struct ast_callid *callid = NULL; struct ast_frame hangup_frame = { .frametype = AST_FRAME_CONTROL, .subclass.integer = AST_CONTROL_HANGUP, @@ -90,7 +91,6 @@ static void *autoservice_run(void *ign) int i, x = 0, ms = 50; struct ast_frame *f = NULL; struct ast_frame *defer_frame = NULL; - struct ast_callid *callid = NULL; AST_LIST_LOCK(&aslist); @@ -129,9 +129,8 @@ static void *autoservice_run(void *ign) continue; } - if ((callid = ast_channel_callid(chan))) { - ast_callid_threadassoc_add(callid); - } + callid = ast_channel_callid(chan); + ast_callid_threadassoc_change(callid); f = ast_read(chan); @@ -173,11 +172,11 @@ static void *autoservice_run(void *ign) } else if (f) { ast_frfree(f); } + } - if (callid) { - ast_callid_threadassoc_remove(); - callid = ast_callid_unref(callid); - } + if (callid) { + ast_callid_threadassoc_remove(); + callid = ast_callid_unref(callid); } asthread = AST_PTHREADT_NULL; |