]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix blind transfers from failing if an 'h' extension is present.
authorMark Michelson <mmichelson@digium.com>
Mon, 23 Jan 2012 20:06:25 +0000 (20:06 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 23 Jan 2012 20:06:25 +0000 (20:06 +0000)
This prevents the 'h' extension from being run on the transferee
channel when it is transferred via a native transfer mechanism such
as SIP REFER.

(closes ASTERISK-19173)
Reported by: Ross Beer
Tested by: Kristjan Vrban
Patches:
ASTERISK-19173 by Mark Michelson (license 5049)

Review: https://reviewboard.asterisk.org/r/1685

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

main/features.c

index 939ffc1c2a0c29544fd0b26553353191efbea199..3e698df38a84bb3479d2a6ed8d8b8d51d5a5c455 100644 (file)
@@ -4096,6 +4096,17 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct a
                if (!f || (f->frametype == AST_FRAME_CONTROL &&
                                (f->subclass.integer == AST_CONTROL_HANGUP || f->subclass.integer == AST_CONTROL_BUSY ||
                                        f->subclass.integer == AST_CONTROL_CONGESTION))) {
+                       /*
+                        * If the bridge was broken for a hangup that isn't real, then
+                        * then don't run the h extension, because the channel isn't
+                        * really hung up. This should really only happen with AST_SOFTHANGUP_ASYNCGOTO,
+                        * but it doesn't hurt to check AST_SOFTHANGUP_UNBRIDGE either.
+                        */
+                       ast_channel_lock(chan);
+                       if (chan->_softhangup & (AST_SOFTHANGUP_ASYNCGOTO | AST_SOFTHANGUP_UNBRIDGE)) {
+                               ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_DONT);
+                       }
+                       ast_channel_unlock(chan);
                        res = -1;
                        break;
                }