[asterisk-commits] russell: branch 1.4 r80088 - /branches/1.4/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 20 16:57:08 CDT 2007


Author: russell
Date: Mon Aug 20 16:57:08 2007
New Revision: 80088

URL: http://svn.digium.com/view/asterisk?view=rev&rev=80088
Log:
Fix the build of app_queue

Modified:
    branches/1.4/apps/app_queue.c

Modified: branches/1.4/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=80088&r1=80087&r2=80088
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Mon Aug 20 16:57:08 2007
@@ -1120,55 +1120,6 @@
 	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;
@@ -1218,6 +1169,55 @@
 		m = next_m;
 	}
 	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)




More information about the asterisk-commits mailing list