]> git.ipfire.org Git - thirdparty/asterisk.git/commit
bridge: Hold off more than one imparting channel at a time. 61/2661/1
authorRichard Mudgett <rmudgett@digium.com>
Tue, 19 Apr 2016 21:58:32 +0000 (16:58 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 20 Apr 2016 20:44:21 +0000 (15:44 -0500)
commit1c5248c3839a3b8f6295d4ed94765bfe0d718ef9
tree3a10a912ac5992db2b4c892459f5277b2573b4c7
parentcc9b72208f72f21022ff4f08384ef3316b5aa807
bridge: Hold off more than one imparting channel at a time.

An earlier patch blocked the ast_bridge_impart() call until the channel
either entered the target bridge or it failed.  Unfortuantely, if the
target bridge is stasis and the imprted channel is not a stasis channel,
stasis bounces the channel out of the bridge to come back into the bridge
as a proper stasis channel.  When the channel is bounced out, that
released the block on ast_bridge_impart() to continue.  If the impart was
a result of a transfer, then it became a race to see if the swap channel
would get hung up before the imparted channel could come back into the
stasis bridge.  If the imparted channel won then everything is fine.  If
the swap channel gets hung up first then the transfer will fail because
the swap channel is leaving the bridge.

* Allow a chain of ast_bridge_impart()'s to happen before any are
unblocked to prevent the race condition described above.  When the channel
finally joins the bridge or completely fails to join the bridge then the
ast_bridge_impart() instances are unblocked.

ASTERISK-25947
Reported by: Richard Mudgett

ASTERISK-24649
Reported by: John Bigelow

ASTERISK-24782
Reported by: John Bigelow

Change-Id: I8fef369171f295f580024ab4971e95c799d0dde1
include/asterisk/bridge_channel_internal.h
main/bridge.c
main/bridge_channel.c