]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameter 69/369/1
authorIvan Poddubny <ivan.poddubny@gmail.com>
Tue, 5 May 2015 19:48:36 +0000 (19:48 +0000)
committerIvan Poddubny <ivan.poddubny@gmail.com>
Tue, 5 May 2015 20:38:23 +0000 (15:38 -0500)
This patch fixes EXITWITHTIMEOUT queue_log entry to always come with 3
parameters: position, original position and waiting time.

ASTERISK-25038 #close
Reported by: Etienne Lessard

Change-Id: I0c62045922e26bee2125e93aee1dee17eee79618

apps/app_queue.c

index df5ff306efdcb9c78df215516067ab9fc9455ede..c0018b555f10ea813c7cd5840911f6594b432811 100644 (file)
@@ -7817,7 +7817,8 @@ check_turns:
                        record_abandoned(&qe);
                        reason = QUEUE_TIMEOUT;
                        res = 0;
-                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHTIMEOUT",
+                               "%d|%d|%ld", qe.pos, qe.opos, (long) (time(NULL) - qe.start));
                        break;
                }
 
@@ -7846,7 +7847,8 @@ check_turns:
                /* exit after 'timeout' cycle if 'n' option enabled */
                if (noption && tries >= ao2_container_count(qe.parent->members)) {
                        ast_verb(3, "Exiting on time-out cycle\n");
-                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHTIMEOUT", "%d", qe.pos);
+                       ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHTIMEOUT",
+                               "%d|%d|%ld", qe.pos, qe.opos, (long) (time(NULL) - qe.start));
                        record_abandoned(&qe);
                        reason = QUEUE_TIMEOUT;
                        res = 0;