aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-28 18:57:52 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-28 18:57:52 +0000
commitb96f6ebdb15c0f02066e24bf1beb66e926276b4f (patch)
tree83b3d6d54e3b62cdfaf35f545e19a81596eea8f5 /channels
parentedd4bb40217ccbf09ed86cd7d347feb1fcb8fd23 (diff)
Merged revisions 57092 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57092 | file | 2007-02-28 13:55:45 -0500 (Wed, 28 Feb 2007) | 2 lines Fix a few more issues with the agent logoff CLI command. (issue #9123 reported by arbrandes) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57093 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_agent.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 903041a6f..4ec79a098 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -778,6 +778,8 @@ static int agent_hangup(struct ast_channel *ast)
ast_log(LOG_NOTICE, "Agent '%s' didn't answer/confirm within %d seconds (waited %d)\n", p->name, p->autologoff, howlong);
p->deferlogoff = 0;
agent_logoff_maintenance(p, p->loginchan, logintime, ast->uniqueid, "Autologoff");
+ if (persistent_agents)
+ dump_agents();
}
} else if (p->dead) {
ast_channel_lock(p->chan);
@@ -792,9 +794,16 @@ static int agent_hangup(struct ast_channel *ast)
}
}
ast_mutex_unlock(&p->lock);
+
/* Only register a device state change if the agent is still logged in */
- if (p->loginstart)
+ if (!p->loginstart) {
+ p->loginchan[0] = '\0';
+ p->logincallerid[0] = '\0';
+ if (persistent_agents)
+ dump_agents();
+ } else {
ast_device_state_changed("Agent/%s", p->agent);
+ }
if (p->pending) {
AST_LIST_LOCK(&agents);