summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2012-09-04 19:26:02 +0000
committerJonathan Rose <jrose@digium.com>2012-09-04 19:26:02 +0000
commitb02c65752ccfc2317693644c424d221339d57e19 (patch)
tree709c2516e0973b62c8a4f148beaa5aa7c937c118 /apps/app_queue.c
parenta40f702aef6f9cc779bd718475175e53154147da (diff)
app_queue: Only log PAUSEALL/UNPAUSEALL when 1+ memebers changed.
Prior to this patch, if pause or unpause was issued on an interface without specifying a specific queue, a PAUSEALL or UNPAUSEALL event would be logged in the queue log even if that interface wasn't a member of any queues. This patch changes it so that these events are only logged when at least one member of any queue exists for that interface. (closes issue AST-946) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/2079/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 8cc6cc1a5..b94f1de16 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -5944,11 +5944,6 @@ static int set_member_paused(const char *queuename, const char *interface, const
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 */
- if (ast_strlen_zero(queuename))
- ast_queue_log("NONE", "NONE", interface, (paused ? "PAUSEALL" : "UNPAUSEALL"), "%s", "");
-
queue_iter = ao2_iterator_init(queues, 0);
while ((q = ao2_t_iterator_next(&queue_iter, "Iterate over queues"))) {
ao2_lock(q);
@@ -5971,6 +5966,16 @@ static int set_member_paused(const char *queuename, const char *interface, const
continue;
}
found++;
+
+ /* Before we do the PAUSE/UNPAUSE log, if this was a PAUSEALL/UNPAUSEALL, log that here, but only on the first found entry. */
+ if (found == 1) {
+
+ /* XXX In all other cases, we use the membername, but since this affects all queues, we cannot */
+ if (ast_strlen_zero(queuename)) {
+ ast_queue_log("NONE", "NONE", interface, (paused ? "PAUSEALL" : "UNPAUSEALL"), "%s", "");
+ }
+ }
+
mem->paused = paused;
if (queue_persistent_members) {