* is already ringing at another agent. Ignore such callers; otherwise, all agents
* will be unused until the first caller is picked up.
*/
- if (ch->start < caller->start && !ch->pending) {
- ast_debug(1, "Queue %s has a call at position %i that's been waiting longer (%li vs %li)\n",
- q->name, ch->pos, ch->start, caller->start);
- is_longest_waiting = 0;
+ if (!ch->pending) {
+ if (ch->start < caller->start) {
+ ast_debug(1, "Queue %s has a call at position %i that's been waiting longer (%li vs %li)\n",
+ q->name, ch->pos, ch->start, caller->start);
+ is_longest_waiting = 0;
+ }
break;
}
ch = ch->next;