mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 00:24:05 +00:00
Don't do wierd things on a callback agent that has attempted logoff while still on the phone.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@37212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -795,13 +795,15 @@ static int agent_hangup(struct ast_channel *ast)
|
|||||||
ast_mutex_lock(&p->chan->lock);
|
ast_mutex_lock(&p->chan->lock);
|
||||||
ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
|
ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
|
||||||
ast_mutex_unlock(&p->chan->lock);
|
ast_mutex_unlock(&p->chan->lock);
|
||||||
} else {
|
} else if (p->loginstart) {
|
||||||
ast_mutex_lock(&p->chan->lock);
|
ast_mutex_lock(&p->chan->lock);
|
||||||
ast_moh_start(p->chan, p->moh);
|
ast_moh_start(p->chan, p->moh);
|
||||||
ast_mutex_unlock(&p->chan->lock);
|
ast_mutex_unlock(&p->chan->lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast_mutex_unlock(&p->lock);
|
ast_mutex_unlock(&p->lock);
|
||||||
|
/* Only register a device state change if the agent is still logged in */
|
||||||
|
if (p->loginstart)
|
||||||
ast_device_state_changed("Agent/%s", p->agent);
|
ast_device_state_changed("Agent/%s", p->agent);
|
||||||
|
|
||||||
if (p->pending) {
|
if (p->pending) {
|
||||||
|
Reference in New Issue
Block a user