} else if (p->chan) {
/* Not dead -- check availability now */
ast_mutex_lock(&p->lock);
- /* check_availability(p, 1); */
- /* Store last disconnect time */
- gettimeofday(&p->lastdisc, NULL);
+ if (strlen(p->loginchan)) {
+ if (!p->wrapuptime)
+ check_availability(p, 1);
+ else {
+ /* XXX Need to add support for wrapuptime on callback agents */
+ }
+ } else {
+ /* Store last disconnect time */
+ gettimeofday(&p->lastdisc, NULL);
+ }
ast_mutex_unlock(&p->lock);
}
return 0;