]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure that when autofill is disabled that callers not in the front of the queue...
authorMark Michelson <mmichelson@digium.com>
Wed, 17 Feb 2010 16:24:17 +0000 (16:24 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 17 Feb 2010 16:24:17 +0000 (16:24 +0000)
(closes issue #16834)
Reported by: kebl0155
Patches:
      app_queue_no_autofill.v1.patch uploaded by kebl0155 (license 356)

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

apps/app_queue.c

index 46fddf615021544970f9c5b48e7ded3ae92d9835..4497e125fd199adcd10aad5461c20582ba96ce14 100644 (file)
@@ -2492,9 +2492,11 @@ static int is_our_turn(struct queue_ent *qe)
        }
 
        ao2_unlock(qe->parent);
-
-       /* If the queue entry is within avl [the number of available members] calls from the top ... */
-       if (ch && idx < avl) {
+       /* If the queue entry is within avl [the number of available members] calls from the top ... 
+        * Autofill and position check added to support autofill=no (as only calls
+        * from the front of the queue are valid when autofill is disabled)
+        */
+       if (ch && idx < avl && (qe->parent->autofill || qe->pos == 1)) {
                if (option_debug)
                        ast_log(LOG_DEBUG, "It's our turn (%s).\n", qe->chan->name);
                res = 1;