[Asterisk-code-review] app queue: Ensure realtime members are updated if there is a... (asterisk[13])

Carlos Oliva asteriskteam at digium.com
Mon Nov 23 07:23:24 CST 2015


Carlos Oliva has uploaded a new change for review.

  https://gerrit.asterisk.org/1694

Change subject: app_queue: Ensure realtime members are updated if there is a call in a queue
......................................................................

app_queue: Ensure realtime members are updated if there is a call in a queue

If a call enters on a queue and the members on that queue are updated in
realtime (ex: using mysql inserting a new agent) the queue members are never
refreshed and the call will stay in the queue until other event occurs
(ex: a new call joins queue)
This patch prevent this issue, ensuring realtime members are update each 5
iterations of the call (mainly each 5 seconds)

Change-Id: If1e036d013a5c1d8b0bf60d71d48fe98694a8682
---
M apps/app_queue.c
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/94/1694/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index 5a8dcd2..bedbbfc 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -5267,6 +5267,7 @@
 static int wait_our_turn(struct queue_ent *qe, int ringing, enum queue_result *reason)
 {
 	int res = 0;
+	int updrtcount = 0;
 
 	/* This is the holding pen for callers 2 through maxlen */
 	for (;;) {
@@ -5334,6 +5335,14 @@
 			*reason = QUEUE_TIMEOUT;
 			break;
 		}
+
+		/* Update realtime members each 5 iterations/seconds */
+		if (updrtcount < 5) {
+			updrtcount++;
+		} else {
+			update_realtime_members(qe->parent);
+			updrtcount = 0;
+		}
 	}
 
 	return res;

-- 
To view, visit https://gerrit.asterisk.org/1694
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1e036d013a5c1d8b0bf60d71d48fe98694a8682
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Carlos Oliva <carlos.oliva at invoxcontact.com>



More information about the asterisk-code-review mailing list