--- app_queue.c 2010-02-16 11:12:37.000000000 +0000 +++ app_queue.new 2010-02-16 11:15:20.000000000 +0000 @@ -3140,8 +3140,11 @@ 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->parent->head==qe)) { ast_debug(1, "It's our turn (%s).\n", qe->chan->name); res = 1; } else {