]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Prior to this patch, the "queue show" command used cached
authorMark Michelson <mmichelson@digium.com>
Thu, 26 Jun 2008 20:56:01 +0000 (20:56 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 26 Jun 2008 20:56:01 +0000 (20:56 +0000)
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125476 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 688ffed134344023bb95ebd7187c1ab83f9a97cd..736c4b3d635d4497717046c562aa747e6daf70bf 100644 (file)
@@ -4311,8 +4311,18 @@ static int __queues_show(struct mansession *s, int manager, int fd, int argc, ch
                return RESULT_SHOWUSAGE;
 
        /* We only want to load realtime queues when a specific queue is asked for. */
-       if (queue_show)
+       if (queue_show) {
                load_realtime_queue(argv[2]);
+       } else if (ast_check_realtime("queues")) {
+               struct ast_config *cfg = ast_load_realtime_multientry("queues", "name LIKE", "%", (char *) NULL);
+               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);
+               }
+       }
 
        AST_LIST_LOCK(&queues);
        if (AST_LIST_EMPTY(&queues)) {