Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 84112) +++ apps/app_queue.c (working copy) @@ -4425,6 +4425,7 @@ int qmemcount = 0; int qmemavail = 0; int qchancount = 0; + int qlongestholdtime = 0; const char *id = astman_get_header(m, "ActionID"); const char *queuefilter = astman_get_header(m, "Queue"); char idText[256] = ""; @@ -4444,6 +4445,12 @@ /* List queue properties */ if (ast_strlen_zero(queuefilter) || !strcmp(q->name, queuefilter)) { + /* Reset the necessary local variables if no queuefilter is set*/ + qmemcount = 0; + qmemavail = 0; + qchancount = 0; + qlongestholdtime = 0; + /* List Queue Members */ mem_iter = ao2_iterator_init(q->members, 0); while ((mem = ao2_iterator_next(&mem_iter))) { @@ -4456,6 +4463,9 @@ ao2_ref(mem, -1); } for (qe = q->head; qe; qe = qe->next) { + if ((now - qe->start) > qlongestholdtime) { + qlongestholdtime = now - qe->start; + } ++qchancount; } astman_append(s, "Event: QueueSummary\r\n" @@ -4464,9 +4474,10 @@ "Available: %d\r\n" "Callers: %d\r\n" "HoldTime: %d\r\n" + "LongestHoldTime: %d\r\n" "%s" "\r\n", - q->name, qmemcount, qmemavail, qchancount, q->holdtime, idText); + q->name, qmemcount, qmemavail, qchancount, q->holdtime, qlongestholdtime, idText); } ao2_unlock(q); queue_unref(q);