summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2016-07-15 11:57:52 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-07-15 11:57:52 -0500
commit26b47608080c6b0f8a41471859560630bf04a7a0 (patch)
tree106cdf5ee8980e868d6afa126c78370399571ea6
parentd3348c51b54a3e201570fe60452ef7e7c754142e (diff)
parent31967dacdf53bbf52a53c59bdf69abbcf3652648 (diff)
Merge "app_queue: Only remove queue member from pending when state changes."
-rw-r--r--apps/app_queue.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 8f949635d..39413f9a6 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2359,10 +2359,17 @@ static void pending_members_remove(struct member *mem)
*/
static void update_status(struct call_queue *q, struct member *m, const int status)
{
- m->status = status;
-
- /* Whatever the status is clear the member from the pending members pool */
- pending_members_remove(m);
+ if (m->status != status) {
+ m->status = status;
+
+ /* Remove the member from the pending members pool only when the status changes.
+ * This is not done unconditionally because we can occasionally see multiple
+ * device state notifications of not in use after a previous call has ended,
+ * including after we have initiated a new call. This is more likely to
+ * 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));
}