aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-18 05:56:46 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-18 05:56:46 +0000
commite4bf31e6eeb3c048b07ed8ee0d57ba4bce18923b (patch)
tree887771c073f8003bd8c181a65b2f0467a51b3c9e /apps
parent18d5476e2318ddd12f654713e9556b3b66f1901d (diff)
Flesh out remaining "rrmemory" logic
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3001 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_queue.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 8f4689e72..fe3373b7a 100755
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -599,8 +599,15 @@ static int store_next(struct queue_ent *qe, struct localuser *outgoing)
qe->parent->rrpos = best->metric % 1000;
} else {
/* Just increment rrpos */
- qe->parent->rrpos++;
+ if (!qe->parent->wrapped) {
+ /* No more channels, start over */
+ qe->parent->rrpos = 0;
+ } else {
+ /* Prioritize next entry */
+ qe->parent->rrpos++;
+ }
}
+ qe->parent->wrapped = 0;
return 0;
}