From 55c467eab12ed9cabfc31a5e22f3c58c05a131b6 Mon Sep 17 00:00:00 2001
From: "Joshua C. Colp" <jcolp@sangoma.com>
Date: Fri, 19 Mar 2021 06:56:18 -0300
Subject: [PATCH] app_queue: Only send QueueMemberStatus if status changes.

If a queue member was updated with the same status multiple
times each time a QueueMemberStatus event would be sent
which would be a duplicate of the previous.

This change makes it so that the QueueMemberStatus event is
only sent if the status actually changes.

ASTERISK-29355

Change-Id: I580c60d992a0a8f2bea8b91c868771b3b490d116
---
 apps/app_queue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/app_queue.c b/apps/app_queue.c
index eddf5c70ec..e84247dff0 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2457,9 +2457,9 @@ static void update_status(struct call_queue *q, struct member *m, const int stat
 		 * happen when there is latency in the connection to the member.
 		 */
 		pending_members_remove(m);
-	}
 
-	queue_publish_member_blob(queue_member_status_type(), queue_member_blob_create(q, m));
+		queue_publish_member_blob(queue_member_status_type(), queue_member_blob_create(q, m));
+	}
 }
 
 /*!
-- 
GitLab