Fix a few more issues with the agent logoff CLI command. (issue #9123 reported by arbrandes)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@57092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2
Joshua Colp 18 years ago
parent 93c0385bc0
commit c8a883fd2f

@ -793,6 +793,8 @@ static int agent_hangup(struct ast_channel *ast)
} else if (!p->loginstart) { } else if (!p->loginstart) {
p->loginchan[0] = '\0'; p->loginchan[0] = '\0';
p->logincallerid[0] = '\0'; p->logincallerid[0] = '\0';
if (persistent_agents)
dump_agents();
} }
} else if (p->dead) { } else if (p->dead) {
ast_mutex_lock(&p->chan->lock); ast_mutex_lock(&p->chan->lock);
@ -805,9 +807,16 @@ static int agent_hangup(struct ast_channel *ast)
} }
} }
ast_mutex_unlock(&p->lock); ast_mutex_unlock(&p->lock);
/* Only register a device state change if the agent is still logged in */ /* 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); ast_device_state_changed("Agent/%s", p->agent);
}
if (p->pending) { if (p->pending) {
ast_mutex_lock(&agentlock); ast_mutex_lock(&agentlock);

Loading…
Cancel
Save