]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a logic error with regards to autofill. Prior to this change, it was possible
authorMark Michelson <mmichelson@digium.com>
Wed, 30 Jan 2008 15:23:00 +0000 (15:23 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 30 Jan 2008 15:23:00 +0000 (15:23 +0000)
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/branches/1.4@101216 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 0ee13c91b64d4aad4a88d07bdb89be1193bfb867..3dbb7f0a4f53a31203af4a0e70d512969fa4950d 100644 (file)
@@ -2391,8 +2391,9 @@ static int is_our_turn(struct queue_ent *qe)
                if (option_debug)
                        ast_log(LOG_DEBUG, "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;                  
                }