diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-20 21:57:08 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-20 21:57:08 +0000 |
commit | f9f8fc323671ac273e4ad0e0d738cc0427c2ac19 (patch) | |
tree | b427049798771e17fa750b5369f8e45f48919959 | |
parent | eaca1770b5d8d15f1b898634254ec667aae6e2c2 (diff) |
Fix the build of app_queue
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@80088 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_queue.c | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index c303107fe..8cf3bf46f 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -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; |