Check availability on callback agents when no wrapuptime specified
authorMark Spencer <markster@digium.com>
Tue, 19 Aug 2003 15:06:13 +0000 (15:06 +0000)
committerMark Spencer <markster@digium.com>
Tue, 19 Aug 2003 15:06:13 +0000 (15:06 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1373 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index da9d9d9..babb5c8 100755 (executable)
@@ -488,9 +488,16 @@ static int agent_hangup(struct ast_channel *ast)
        } 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;