Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 112598) +++ apps/app_queue.c (working copy) @@ -2743,10 +2743,18 @@ free(tmp); } } - if (qe->expire && (!qe->parent->timeout || (qe->expire - now) <= qe->parent->timeout)) - to = (qe->expire - now) * 1000; - else - to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1; + + if (qe->expire && qe->expire<=now) { + to = 0; + } else if (qe->parent->timeout) { + to = qe->parent->timeout * 1000; + } else { + to = -1; + } + + if (option_debug) + ast_log(LOG_DEBUG, "Setting timeout for callattempt to %d\n", to); + ++qe->pending; ast_mutex_unlock(&qe->parent->lock); ring_one(qe, outgoing, &numbusies);