mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
Always defer Agent logoff if any channels are up until they hang up. (issue #9123 reported by arbrandes)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@56279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1480,15 +1480,13 @@ static int agent_logoff(char *agent, int soft)
|
||||
|
||||
for (p=agents; p; p=p->next) {
|
||||
if (!strcasecmp(p->agent, agent)) {
|
||||
if (p->owner || p->chan)
|
||||
defer = 1;
|
||||
if (!soft) {
|
||||
if (p->owner) {
|
||||
defer = 1;
|
||||
if (p->owner)
|
||||
ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
|
||||
}
|
||||
if (p->chan) {
|
||||
defer = 1;
|
||||
if (p->chan)
|
||||
ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
|
||||
}
|
||||
}
|
||||
ret = 0; /* found an agent => return 0 */
|
||||
logintime = time(NULL) - p->loginstart;
|
||||
|
Reference in New Issue
Block a user