summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 18e9942b5..6557edd50 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -680,7 +680,8 @@ enum {
QUEUE_STRATEGY_RANDOM,
QUEUE_STRATEGY_RRMEMORY,
QUEUE_STRATEGY_LINEAR,
- QUEUE_STRATEGY_WRANDOM
+ QUEUE_STRATEGY_WRANDOM,
+ QUEUE_STRATEGY_RRORDERED,
};
enum {
@@ -708,6 +709,7 @@ static const struct strategy {
{ QUEUE_STRATEGY_RRMEMORY, "roundrobin" },
{ QUEUE_STRATEGY_LINEAR, "linear" },
{ QUEUE_STRATEGY_WRANDOM, "wrandom"},
+ { QUEUE_STRATEGY_RRORDERED, "rrordered"},
};
static const struct autopause {
@@ -1538,7 +1540,7 @@ static void init_queue(struct call_queue *q)
q->autopause = QUEUE_AUTOPAUSE_OFF;
q->timeoutpriority = TIMEOUT_PRIORITY_APP;
if (!q->members) {
- if (q->strategy == QUEUE_STRATEGY_LINEAR)
+ if (q->strategy == QUEUE_STRATEGY_LINEAR || q->strategy == QUEUE_STRATEGY_RRORDERED)
/* linear strategy depends on order, so we have to place all members in a single bucket */
q->members = ao2_container_alloc(1, member_hash_fn, member_cmp_fn);
else
@@ -3909,6 +3911,7 @@ static int calc_metric(struct call_queue *q, struct member *mem, int pos, struct
}
tmp->metric += mem->penalty * 1000000 * usepenalty;
break;
+ case QUEUE_STRATEGY_RRORDERED:
case QUEUE_STRATEGY_RRMEMORY:
if (pos < q->rrpos) {
tmp->metric = 1000 + pos;
@@ -4231,7 +4234,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_PARKCALL);
break;
case 'n':
- if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_LINEAR)
+ if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_LINEAR || qe->parent->strategy == QUEUE_STRATEGY_RRORDERED)
(*tries)++;
else
*tries = qe->parent->membercount;
@@ -4418,8 +4421,9 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
}
ast_channel_unlock(qe->chan);
ao2_lock(qe->parent);
- if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
+ if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_RRORDERED) {
store_next_rr(qe, outgoing);
+
}
if (qe->parent->strategy == QUEUE_STRATEGY_LINEAR) {
store_next_lin(qe, outgoing);