summaryrefslogtreecommitdiff
path: root/main/autoservice.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/autoservice.c')
-rw-r--r--main/autoservice.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/autoservice.c b/main/autoservice.c
index 4d53f15e5..37bbee682 100644
--- a/main/autoservice.c
+++ b/main/autoservice.c
@@ -90,6 +90,7 @@ 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);
@@ -128,6 +129,10 @@ static void *autoservice_run(void *ign)
continue;
}
+ if ((callid = ast_channel_callid(chan))) {
+ ast_callid_threadassoc_add(callid);
+ }
+
f = ast_read(chan);
if (!f) {
@@ -168,6 +173,11 @@ static void *autoservice_run(void *ign)
} else if (f) {
ast_frfree(f);
}
+
+ if (callid) {
+ ast_callid_threadassoc_remove();
+ callid = ast_callid_unref(callid);
+ }
}
asthread = AST_PTHREADT_NULL;