]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix the build of app_queue
authorRussell Bryant <russell@russellbryant.com>
Mon, 20 Aug 2007 21:57:08 +0000 (21:57 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 20 Aug 2007 21:57:08 +0000 (21:57 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80088 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index c303107feef82d901545b7f56b5725264f2b9a1d..8cf3bf46f7398c35d7e60d21125cfe0bfc0c3db8 100644 (file)
@@ -1120,55 +1120,6 @@ static struct call_queue *find_queue_by_name_rt(const char *queuename, struct as
        return q;
 }
 
-static struct call_queue *load_realtime_queue(const char *queuename)
-{
-       struct ast_variable *queue_vars;
-       struct ast_config *member_config = NULL;
-       struct call_queue *q;
-
-       /* Find the queue in the in-core list first. */
-       AST_LIST_LOCK(&queues);
-       AST_LIST_TRAVERSE(&queues, q, list) {
-               if (!strcasecmp(q->name, queuename)) {
-                       break;
-               }
-       }
-       AST_LIST_UNLOCK(&queues);
-
-       if (!q || q->realtime) {
-               /*! \note Load from realtime before taking the global qlock, to avoid blocking all
-                  queue operations while waiting for the DB.
-
-                  This will be two separate database transactions, so we might
-                  see queue parameters as they were before another process
-                  changed the queue and member list as it was after the change.
-                  Thus we might see an empty member list when a queue is
-                  deleted. In practise, this is unlikely to cause a problem. */
-
-               queue_vars = ast_load_realtime("queues", "name", queuename, NULL);
-               if (queue_vars) {
-                       member_config = ast_load_realtime_multientry("queue_members", "interface LIKE", "%", "queue_name", queuename, NULL);
-                       if (!member_config) {
-                               ast_log(LOG_ERROR, "no queue_members defined in your config (extconfig.conf).\n");
-                               return NULL;
-                       }
-               }
-
-               AST_LIST_LOCK(&queues);
-
-               q = find_queue_by_name_rt(queuename, queue_vars, member_config);
-               if (member_config)
-                       ast_config_destroy(member_config);
-               if (queue_vars)
-                       ast_variables_destroy(queue_vars);
-
-               AST_LIST_UNLOCK(&queues);
-       } else { 
-               update_realtime_member(q);
-       }
-       return q;
-}
-
 static void update_realtime_members(struct call_queue *q)
 {
        struct ast_config *member_config = NULL;
@@ -1220,6 +1171,55 @@ static void update_realtime_members(struct call_queue *q)
        ast_mutex_unlock(&q->lock);
 }
 
+static struct call_queue *load_realtime_queue(const char *queuename)
+{
+       struct ast_variable *queue_vars;
+       struct ast_config *member_config = NULL;
+       struct call_queue *q;
+
+       /* Find the queue in the in-core list first. */
+       AST_LIST_LOCK(&queues);
+       AST_LIST_TRAVERSE(&queues, q, list) {
+               if (!strcasecmp(q->name, queuename)) {
+                       break;
+               }
+       }
+       AST_LIST_UNLOCK(&queues);
+
+       if (!q || q->realtime) {
+               /*! \note Load from realtime before taking the global qlock, to avoid blocking all
+                  queue operations while waiting for the DB.
+
+                  This will be two separate database transactions, so we might
+                  see queue parameters as they were before another process
+                  changed the queue and member list as it was after the change.
+                  Thus we might see an empty member list when a queue is
+                  deleted. In practise, this is unlikely to cause a problem. */
+
+               queue_vars = ast_load_realtime("queues", "name", queuename, NULL);
+               if (queue_vars) {
+                       member_config = ast_load_realtime_multientry("queue_members", "interface LIKE", "%", "queue_name", queuename, NULL);
+                       if (!member_config) {
+                               ast_log(LOG_ERROR, "no queue_members defined in your config (extconfig.conf).\n");
+                               return NULL;
+                       }
+               }
+
+               AST_LIST_LOCK(&queues);
+
+               q = find_queue_by_name_rt(queuename, queue_vars, member_config);
+               if (member_config)
+                       ast_config_destroy(member_config);
+               if (queue_vars)
+                       ast_variables_destroy(queue_vars);
+
+               AST_LIST_UNLOCK(&queues);
+       } else { 
+               update_realtime_members(q);
+       }
+       return q;
+}
+
 static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *reason)
 {
        struct call_queue *q;