aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-01 22:07:09 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-01 22:07:09 +0000
commitbcc79de25b63a9828becf78260e80d35fd3cc39d (patch)
treec0cf80ef5b61daea9437ff89d011eac3f1afff50 /apps/app_queue.c
parent5c3520b84e3f608c7f05c9fa563237680a3b1332 (diff)
Add error checking when updating the "paused" field of a realtime queue member.
This code already existed in trunk and 1.6.1, but was not in 1.6.0 prior to this commit. (closes issue #14338) Reported by: fiddur Patches: 14338.patch uploaded by mmichelson (license 60) Tested by: fiddur git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@179222 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index ac1d0a317..70704f02b 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4131,6 +4131,7 @@ static int set_member_paused(const char *queuename, const char *interface, const
struct call_queue *q;
struct member *mem;
struct ao2_iterator queue_iter;
+ int failed;
/* Special event for when all queues are paused - individual events still generated */
/* XXX In all other cases, we use the membername, but since this affects all queues, we cannot */
@@ -4146,14 +4147,24 @@ static int set_member_paused(const char *queuename, const char *interface, const
if (mem->paused == paused) {
ast_debug(1, "%spausing already-%spaused queue member %s:%s\n", (paused ? "" : "un"), (paused ? "" : "un"), q->name, interface);
}
+
+ failed = 0;
+ if (mem->realtime) {
+ failed = update_realtime_member_field(mem, q->name, "paused", paused ? "1" : "0");
+ }
+
+ if (failed) {
+ ast_log(LOG_WARNING, "Failed %spausing realtime queue member %s:%s\n", (paused ? "" : "un"), q->name, interface);
+ ao2_ref(mem, -1);
+ ao2_unlock(q);
+ continue;
+ }
+
mem->paused = paused;
if (queue_persistent_members)
dump_queue_members(q);
- if (mem->realtime)
- update_realtime_member_field(mem, q->name, "paused", paused ? "1" : "0");
-
ast_queue_log(q->name, "NONE", mem->membername, (paused ? "PAUSE" : "UNPAUSE"), "%s", S_OR(reason, ""));
if (!ast_strlen_zero(reason)) {