|
|
@ -632,18 +632,22 @@ static int calc_metric(struct ast_call_queue *q, struct member *mem, int pos, st
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case QUEUE_STRATEGY_ROUNDROBIN:
|
|
|
|
case QUEUE_STRATEGY_ROUNDROBIN:
|
|
|
|
if (!pos) {
|
|
|
|
if (!pos) {
|
|
|
|
/* rrpos > number of queue entries */
|
|
|
|
if (!q->wrapped) {
|
|
|
|
if (!q->wrapped)
|
|
|
|
/* No more channels, start over */
|
|
|
|
q->rrpos = 1;
|
|
|
|
q->rrpos = 0;
|
|
|
|
else
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* Prioritize next entry */
|
|
|
|
q->rrpos++;
|
|
|
|
q->rrpos++;
|
|
|
|
|
|
|
|
}
|
|
|
|
q->wrapped = 0;
|
|
|
|
q->wrapped = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pos < q->rrpos) {
|
|
|
|
if (pos < q->rrpos) {
|
|
|
|
tmp->metric = 1000 + pos;
|
|
|
|
tmp->metric = 1000 + pos;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (pos > q->rrpos)
|
|
|
|
if (pos > q->rrpos) {
|
|
|
|
|
|
|
|
/* Indicate there is another priority */
|
|
|
|
q->wrapped = 1;
|
|
|
|
q->wrapped = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
tmp->metric = pos;
|
|
|
|
tmp->metric = pos;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tmp->metric += mem->penalty * 1000000;
|
|
|
|
tmp->metric += mem->penalty * 1000000;
|
|
|
|