]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #10209)
authorRussell Bryant <russell@russellbryant.com>
Tue, 17 Jul 2007 20:01:12 +0000 (20:01 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 17 Jul 2007 20:01:12 +0000 (20:01 +0000)
Reported by: juggie
Patches:
      10209-trunk-2.patch uploaded by juggie
Tested by: juggie, blitzrage

In ast_pbx_run(), mark a channel as hung up after an application returned -1,
or when it runs out of extensions to execute.  This is so that code can detect
that this channel has been hung up for things like making sure DeadAGI is used
on actual dead channels, and is beneficial for other things, like making sure
someone doesn't try to start spying on a channel that is about to go away.

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

main/pbx.c

index 73c80ee05916bca3858f5842ba0de803711a1d53..11b614583267778985c7858daa5dcbaf61a433c4 100644 (file)
@@ -2517,6 +2517,8 @@ static int __ast_pbx_run(struct ast_channel *c)
        }
        if (!found && !error)
                ast_log(LOG_WARNING, "Don't know what to do with '%s'\n", c->name);
+       if (res != AST_PBX_KEEPALIVE)
+               ast_softhangup(c, c->hangupcause ? c->hangupcause : AST_CAUSE_NORMAL_CLEARING);
        if ((res != AST_PBX_KEEPALIVE) && ast_exists_extension(c, c->context, "h", 1, c->cid.cid_num)) {
                if (c->cdr && ast_opt_end_cdr_before_h_exten)
                        ast_cdr_end(c->cdr);