Fix logic reversal error when queue callers join the queue.

When a specific position is specified for the queue, the idea
was that the caller cannot be placed ahead of higher-priority
callers. Unfortunately, the logic was reversed so that the caller
could ONLY be placed ahead of higher priority callers.

Discovered while writing a unit test.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson 2010-04-30 19:53:36 +00:00
parent 623ba816fa
commit 2dcb4df6d8
1 changed files with 1 additions and 1 deletions

View File

@ -2263,7 +2263,7 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *
/* <= is necessary for the position comparison because it may not be possible to enter
* at our desired position since higher-priority callers may have taken the position we want
*/
if (!inserted && (qe->prio <= cur->prio) && position && (position <= pos + 1)) {
if (!inserted && (qe->prio >= cur->prio) && position && (position <= pos + 1)) {
insert_entry(q, prev, qe, &pos);
/*pos is incremented inside insert_entry, so don't need to add 1 here*/
if (position < pos) {