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: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@179222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Mark Michelson 18 years ago
parent 8c5803b286
commit eb9e2f2c4e

@ -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)) {

Loading…
Cancel
Save