if (p->dnd)
return 0;
/* If guard time, definitely not */
- if (time(NULL) < p->guardtime)
+ if (p->guardtime && (time(NULL) < p->guardtime))
return 0;
/* If no owner definitely available */
if (roundrobin)
round_robin[x] = p;
#if 0
- ast_verbose("name = %s, %d\n",p->owner->name,p->channel);
+ ast_verbose("name = %s, %d, %d, %d\n",p->owner ? p->owner->name : "<none>", p->channel, channelmatch, groupmatch);
#endif
if (p && available(p, channelmatch, groupmatch, &busy)) {
if (option_debug)
ast_mutex_unlock(lock);
restart_monitor();
if (!tmp) {
- if (busy) {
+ if (busy && (channelmatch != CHAN_PSEUDO)) {
tmp = zt_request("Zap", format, "pseudo");
if (tmp) {
char newname[80];
ast_setstate(tmp, AST_STATE_BUSY);
ast_mutex_unlock(&tmp->lock);
}
+ } else if (busy) {
+ ast_log(LOG_WARNING, "Whoa, the pseudo was busy somehow!\n");
}
}
return tmp;