ensure that agent channels don't get seized during login (issue #5020)
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 14 Sep 2005 00:59:51 +0000 (00:59 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 14 Sep 2005 00:59:51 +0000 (00:59 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6577 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index 808776f..dd5d3a5 100755 (executable)
@@ -1749,6 +1749,11 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
                        if (!strcmp(p->agent, user) &&
                            !strcmp(p->password, pass) && !p->pending) {
                                login_state = 1; /* Successful Login */
+
+                               /* Ensure we can't be gotten until we're done */
+                               gettimeofday(&p->lastdisc, NULL);
+                               p->lastdisc.tv_sec++;
+
                                /* Set Channel Specific Agent Overides */
                                if (pbx_builtin_getvar_helper(chan, "AGENTACKCALL") && strlen(pbx_builtin_getvar_helper(chan, "AGENTACKCALL"))) {
                                        if (!strcasecmp(pbx_builtin_getvar_helper(chan, "AGENTACKCALL"), "always"))