[Asterisk-code-review] app queue: Ensure realtime members are updated if there is a... (asterisk[master])
Carlos Oliva
asteriskteam at digium.com
Mon Nov 23 07:05:15 CST 2015
Carlos Oliva has uploaded a new change for review.
https://gerrit.asterisk.org/1693
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/93/1693/1
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 234543f..6a95c73 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -5290,6 +5290,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 (;;) {
@@ -5357,6 +5358,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/1693
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If1e036d013a5c1d8b0bf60d71d48fe98694a8682
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Carlos Oliva <carlos.oliva at invoxcontact.com>
More information about the asterisk-code-review
mailing list