summaryrefslogtreecommitdiff
path: root/main/features.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2012-01-23 20:29:48 +0000
committerMark Michelson <mmichelson@digium.com>2012-01-23 20:29:48 +0000
commit0920c50341632f53aaa6d8a6ba80b10c0c7ad563 (patch)
tree4bf9bc4157c62763aaea0cdcc2502652c24042d5 /main/features.c
parent59a42de303ae58d384a94dbcdbc09a6599bf393b (diff)
Fix blind transfers from failing if an 'h' extension is present.
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 ........ Merged revisions 352199 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352228 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/features.c b/main/features.c
index b4b779dcc..f1bf4db54 100644
--- a/main/features.c
+++ b/main/features.c
@@ -4117,6 +4117,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;
}