End stuck DTMF if AST_SOFTHANGUP_ASYNCGOTO because it isn't a real hangup.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 14 Feb 2013 19:52:14 +0000 (19:52 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 14 Feb 2013 19:52:14 +0000 (19:52 +0000)
It doesn't hurt to check AST_SOFTHANGUP_UNBRIDGE either, but it should not
be set outside of a bridge.

(issue ASTERISK-20492)
........

Merged revisions 381466 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 381467 from http://svn.asterisk.org/svn/asterisk/branches/11

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

main/features.c

index cc0e2ac..0224e78 100644 (file)
@@ -4276,9 +4276,12 @@ void ast_bridge_end_dtmf(struct ast_channel *chan, char digit, struct timeval st
        long duration;
 
        ast_channel_lock(chan);
-       dead = ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE) || ast_check_hangup(chan);
+       dead = ast_test_flag(ast_channel_flags(chan), AST_FLAG_ZOMBIE)
+               || (ast_channel_softhangup_internal_flag(chan)
+                       & ~(AST_SOFTHANGUP_ASYNCGOTO | AST_SOFTHANGUP_UNBRIDGE));
        ast_channel_unlock(chan);
        if (dead) {
+               /* Channel is a zombie or a real hangup. */
                return;
        }