aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_agent.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-09 15:10:08 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-09 15:10:08 +0000
commit8d1899346a46a908d2a90ba4d0c4680c329d9eb1 (patch)
tree183b08915bb75f1d4895fe29d03d714b1e28fe28 /channels/chan_agent.c
parent39dcae92602745601b2faa4fad6ebbbceced3045 (diff)
Merged revisions 121230 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r121230 | mmichelson | 2008-06-09 10:08:58 -0500 (Mon, 09 Jun 2008) | 27 lines Merged revisions 121229 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 (Note that this is being merged to trunk/1.6.0 because it may affect non-callback agents with ackcall set) ........ r121229 | mmichelson | 2008-06-09 10:02:37 -0500 (Mon, 09 Jun 2008) | 16 lines A unique situation of timeouts brought forth a failure situation for autologoff in chan_agent. If using AgentCallbackLogin-style agents, then if the timeout specified by the Dial() to reach the agent's phone was shorter than the timeout specified in queues.conf, then autologoff would only work if the caller hung up while the agent's phone was ringing. This patch allows autologoff to work in this situation when the call in queue transfers to the next available agent (as it would have if the timeout in queues.conf were less than the timeout in the Dial()). (closes issue #12754) Reported by: Rodrigo Patches: 12754.patch uploaded by putnopvut (license 60) Tested by: Rodrigo ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@121231 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
-rw-r--r--channels/chan_agent.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 8f05c20af..d44d0881f 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -434,7 +434,17 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
if (!ast_strlen_zero(p->loginchan)) {
if (p->chan)
ast_debug(1, "Bridge on '%s' being cleared (2)\n", p->chan->name);
-
+ if (p->owner->_state != AST_STATE_UP) {
+ int howlong = time(NULL) - p->start;
+ if (p->autologoff && howlong > p->autologoff) {
+ long logintime = time(NULL) - p->loginstart;
+ p->loginstart = 0;
+ ast_log(LOG_NOTICE, "Agent '%s' didn't answer/confirm within %d seconds (waited %d)\n", p->name, p->autologoff, howlong);
+ agent_logoff_maintenance(p, p->loginchan, logintime, ast->uniqueid, "Autologoff");
+ if (persistent_agents)
+ dump_agents();
+ }
+ }
status = pbx_builtin_getvar_helper(p->chan, "CHANLOCALSTATUS");
if (autologoffunavail && status && !strcasecmp(status, "CHANUNAVAIL")) {
long logintime = time(NULL) - p->loginstart;