]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix issue where queue log events might be missing. (issue #7765 reported by mtryfoss)
authorJoshua Colp <jcolp@digium.com>
Wed, 27 Jun 2007 22:43:11 +0000 (22:43 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 27 Jun 2007 22:43:11 +0000 (22:43 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@72327 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 74cee9c42c6dadf611f54a889eecd684e077a579..730c1153f15ad919d2ffa1544dcd89e4c045d344 100644 (file)
@@ -2052,6 +2052,7 @@ static int wait_our_turn(struct queue_ent *qe, int ringing, enum queue_result *r
                /* leave the queue if no agents, if enabled */
                if (qe->parent->leavewhenempty && (stat == QUEUE_NO_MEMBERS)) {
                        *reason = QUEUE_LEAVEEMPTY;
+                       ast_queue_log(qe->parent->name, qe->chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long)(time(NULL) - qe->start));
                        leave_queue(qe);
                        break;
                }
@@ -2059,6 +2060,7 @@ static int wait_our_turn(struct queue_ent *qe, int ringing, enum queue_result *r
                /* leave the queue if no reachable agents, if enabled */
                if ((qe->parent->leavewhenempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS)) {
                        *reason = QUEUE_LEAVEUNAVAIL;
+                       ast_queue_log(qe->parent->name, qe->chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long)(time(NULL) - qe->start));
                        leave_queue(qe);
                        break;
                }
@@ -3172,6 +3174,7 @@ check_turns:
                                if (qe.parent->leavewhenempty && (stat == QUEUE_NO_MEMBERS)) {
                                        record_abandoned(&qe);
                                        reason = QUEUE_LEAVEEMPTY;
+                                       ast_queue_log(queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
                                        res = 0;
                                        break;
                                }
@@ -3180,6 +3183,7 @@ check_turns:
                                if ((qe.parent->leavewhenempty == QUEUE_EMPTY_STRICT) && (stat == QUEUE_NO_REACHABLE_MEMBERS)) {
                                        record_abandoned(&qe);
                                        reason = QUEUE_LEAVEUNAVAIL;
+                                       ast_queue_log(queuename, chan->uniqueid, "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
                                        res = 0;
                                        break;
                                }