[asterisk-commits] mmichelson: branch 1.6.0 r125478 - in /branches/1.6.0: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 26 15:58:49 CDT 2008


Author: mmichelson
Date: Thu Jun 26 15:58:48 2008
New Revision: 125478

URL: http://svn.digium.com/view/asterisk?view=rev&rev=125478
Log:
Merged revisions 125477 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r125477 | mmichelson | 2008-06-26 15:57:41 -0500 (Thu, 26 Jun 2008) | 19 lines

Merged revisions 125476 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125476 | mmichelson | 2008-06-26 15:56:01 -0500 (Thu, 26 Jun 2008) | 11 lines

Prior to this patch, the "queue show" command used cached
information for realtime queues instead of giving up-to-date
info. Now realtime is queried for the latest and greatest in
queue info.

(closes issue #12858)
Reported by: bcnit
Patches:
      queue_show.patch uploaded by putnopvut (license 60)


........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/apps/app_queue.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_queue.c?view=diff&rev=125478&r1=125477&r2=125478
==============================================================================
--- branches/1.6.0/apps/app_queue.c (original)
+++ branches/1.6.0/apps/app_queue.c Thu Jun 26 15:58:48 2008
@@ -5281,9 +5281,19 @@
 	if (argc != 2 && argc != 3)
 		return CLI_SHOWUSAGE;
 
-	/* We only want to load realtime queues when a specific queue is asked for. */
-	if (argc == 3)	/* specific queue */
+	if (argc == 3)	{ /* specific queue */
 		load_realtime_queue(argv[2]);
+	}
+	else if (ast_check_realtime("queues")) {
+		struct ast_config *cfg = ast_load_realtime_multientry("queues", "name LIKE", "%", SENTINEL);
+		char *queuename;
+		if (cfg) {
+			for (queuename = ast_category_browse(cfg, NULL); !ast_strlen_zero(queuename); queuename = ast_category_browse(cfg, queuename)) {
+				load_realtime_queue(queuename);
+			}
+			ast_config_destroy(cfg);
+		}
+	}
 
 	queue_iter = ao2_iterator_init(queues, 0);
 	while ((q = ao2_iterator_next(&queue_iter))) {
@@ -5349,11 +5359,15 @@
 		}
 		do_print(s, fd, "");	/* blank line between entries */
 		ao2_unlock(q);
-		if (argc == 3)	{ /* print a specific entry */
+		if (q->realtime || argc == 3) {
+			/* If a queue is realtime, then that means we used load_realtime_queue() above
+			 * to get its information. This means we have an extra reference we need to
+			 * remove at this point. If a specific queue was requested, then it also needs
+			 * to be unreffed here even if it is not a realtime queue.
+			 */
 			queue_unref(q);
-			break;
-		}
-		queue_unref(q);
+		}
+		queue_unref(q); /* Unref the iterator's reference */
 	}
 	if (!found) {
 		if (argc == 3)




More information about the asterisk-commits mailing list