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

Carlos Oliva asteriskteam at digium.com
Tue Oct 13 04:51:03 CDT 2015


Carlos Oliva has uploaded a new change for review.

  https://gerrit.asterisk.org/1431

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)

ASTERISK-25442#close

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/31/1431/1

diff --git a/apps/app_queue.c b/apps/app_queue.c
index 6dfb143..2864695 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/1431
To unsubscribe, visit https://gerrit.asterisk.org/settings

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



More information about the asterisk-code-review mailing list