aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-06 21:01:31 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-06 21:01:31 +0000
commite762ec1d871bd990ea52cfa3b03b38be45f4d62a (patch)
tree9ff4514fa74134854843c308ace281f5d9ef52b9
parentb3d8b67448ab6cad13278173ecba3a59fc67147d (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@37221 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_agent.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index e41ee0994..65a8fbef4 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -795,14 +795,16 @@ static int agent_hangup(struct ast_channel *ast)
ast_mutex_lock(&p->chan->lock);
ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
ast_mutex_unlock(&p->chan->lock);
- } else {
+ } else if (p->loginstart) {
ast_mutex_lock(&p->chan->lock);
ast_moh_start(p->chan, p->moh);
ast_mutex_unlock(&p->chan->lock);
}
}
ast_mutex_unlock(&p->lock);
- ast_device_state_changed("Agent/%s", p->agent);
+ /* Only register a device state change if the agent is still logged in */
+ if (p->loginstart)
+ ast_device_state_changed("Agent/%s", p->agent);
if (p->pending) {
ast_mutex_lock(&agentlock);