diff options
author | Mark Michelson <mmichelson@digium.com> | 2008-02-20 22:34:12 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2008-02-20 22:34:12 +0000 |
commit | caeb435271a9dcd95e3958e3e356d2d19c97e5ef (patch) | |
tree | 4b07df5190e29f51492880e258308bef8d35a53d | |
parent | 715ab328c11b718b86919ad0ea5113dab815bbd4 (diff) |
Merged revisions 103956 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r103956 | mmichelson | 2008-02-20 16:32:22 -0600 (Wed, 20 Feb 2008) | 8 lines
Clear up confusion when viewing the QUEUE_WAITING_COUNT of a
"dead" realtime queue. Since from the user's perspective, the queue
does exist, we shouldn't tell them we couldn't find the queue. Instead
since it is a dead queue, report a 0 waiting count
This issue was brought up on IRC by jmls
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | apps/app_queue.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index fa22cbeff..5f7e08ca0 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -4688,6 +4688,7 @@ static int queue_function_queuewaitingcount(struct ast_channel *chan, const char struct call_queue *q, tmpq = { .name = data, }; + struct ast_variable *var = NULL; buf[0] = '\0'; @@ -4701,6 +4702,13 @@ static int queue_function_queuewaitingcount(struct ast_channel *chan, const char count = q->count; ao2_unlock(q); queue_unref(q); + } else if ((var = ast_load_realtime("queues", "name", data, NULL))) { + /* if the queue is realtime but was not found in memory, this + * means that the queue had been deleted from memory since it was + * "dead." This means it has a 0 waiting count + */ + count = 0; + ast_variables_destroy(var); } else ast_log(LOG_WARNING, "queue %s was not found\n", data); |