Adding agent in conversation counter in QueueSummary AMI event (based on AST_DEVICE_INUSE flag)
Index: asterisk-22.8.2/apps/app_queue.c
===================================================================
--- asterisk-22.8.2.orig/apps/app_queue.c
+++ asterisk-22.8.2/apps/app_queue.c
@@ -10688,6 +10688,7 @@ static int manager_queues_summary(struct
 {
 	time_t now;
 	int qmemcount = 0;
+	int qmembusy = 0;
 	int qmemavail = 0;
 	int qchancount = 0;
 	int qlongestholdtime = 0;
@@ -10719,6 +10720,7 @@ static int manager_queues_summary(struct
 		if (ast_strlen_zero(queuefilter) || !strcasecmp(q->name, queuefilter)) {
 			/* Reset the necessary local variables if no queuefilter is set*/
 			qmemcount = 0;
+			qmembusy = 0;
 			qmemavail = 0;
 			qchancount = 0;
 			qlongestholdtime = 0;
@@ -10732,6 +10734,9 @@ static int manager_queues_summary(struct
 						++qmemavail;
 					}
 				}
+				if (mem->status == AST_DEVICE_INUSE) {
+					++qmembusy;
+				}
 				ao2_ref(mem, -1);
 			}
 			ao2_iterator_destroy(&mem_iter);
@@ -10745,13 +10750,14 @@ static int manager_queues_summary(struct
 				"Queue: %s\r\n"
 				"LoggedIn: %d\r\n"
 				"Available: %d\r\n"
+				"Talking: %d\r\n"
 				"Callers: %d\r\n"
 				"HoldTime: %d\r\n"
 				"TalkTime: %d\r\n"
 				"LongestHoldTime: %d\r\n"
 				"%s"
 				"\r\n",
-				q->name, qmemcount, qmemavail, qchancount, q->holdtime, q->talktime, qlongestholdtime, idText);
+				q->name, qmemcount, qmemavail, qmembusy, qchancount, q->holdtime, q->talktime, qlongestholdtime, idText);
 			++qsummaries;
 		}
 		ao2_unlock(q);
