git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@28968
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
cur = cur->next;
}
- if (qe->parent->timeout)
- to = qe->parent->timeout * 1000;
- else
- to = -1;
+ 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;
ring_one(qe, outgoing, &numbusies);
ast_mutex_unlock(&qe->parent->lock);
if (use_weight)