Merged revisions 101216 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Wed, 30 Jan 2008 15:27:14 +0000 (15:27 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 30 Jan 2008 15:27:14 +0000 (15:27 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r101216 | mmichelson | 2008-01-30 09:23:00 -0600 (Wed, 30 Jan 2008) | 5 lines

Fix a logic error with regards to autofill. Prior to this change, it was possible
for a caller to go out of turn if autofill were enabled and callers ahead in the queue were attempting
to call a member. This change fixes this.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@101217 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 27d3f19..9e1d906 100644 (file)
@@ -2666,8 +2666,9 @@ static int is_our_turn(struct queue_ent *qe)
 
                ast_debug(1, "There are %d available members.\n", avl);
        
-               while ((idx < avl) && (ch) &&  !ch->pending && (ch != qe)) {
-                       idx++;
+               while ((idx < avl) && (ch) && (ch != qe)) {
+                       if (!ch->pending)
+                               idx++;
                        ch = ch->next;                  
                }