Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 274538) +++ apps/app_queue.c (working copy) @@ -2722,6 +2722,7 @@ struct call_queue *q; struct member *mem; int found = 0; + int num_avail; struct ao2_iterator queue_iter; /* q's lock and rq's lock already set by try_calling() @@ -2736,7 +2737,14 @@ if (q->count && q->members) { if ((mem = ao2_find(q->members, member, OBJ_POINTER))) { ast_debug(1, "Found matching member %s in queue '%s'\n", mem->interface, q->name); - if (q->weight > rq->weight && q->count >= num_available_members(q)) { + if (!mem->paused && /* paused on this queue so free for other queues */ + q->weight > rq->weight && + /* belt and braces - if no members are available on this + queue, then our member must be somehow unavailable, + although the only reason we know is being paused, which + has been efficiently pre-checked. */ + (num_avail = num_available_members(q)) && + q->count >= num_avail) { ast_debug(1, "Queue '%s' (weight %d, calls %d) is preferred over '%s' (weight %d, calls %d)\n", q->name, q->weight, q->count, rq->name, rq->weight, rq->count); found = 1; }