]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
The cli command "agent logoff Agent/x soft" did not work...at all. Now it does.
authorMark Michelson <mmichelson@digium.com>
Wed, 11 Jul 2007 21:12:30 +0000 (21:12 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 11 Jul 2007 21:12:30 +0000 (21:12 +0000)
(closes issue #10178, reported and patched by makoto, with slight modification for 1.4 and trunk by me)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@74719 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index 66104e7718fb603c10e7b8f785ca44d37e659a95..c106162e4c708692411987a272819bdc35aa316d 100644 (file)
@@ -1998,6 +1998,8 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
                                                ast_device_state_changed("Agent/%s", p->agent);
                                                while (res >= 0) {
                                                        ast_mutex_lock(&p->lock);
+                                                       if (!p->loginstart && p->chan)
+                                                               ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
                                                        if (p->chan != chan)
                                                                res = -1;
                                                        ast_mutex_unlock(&p->lock);