bridge.c: Fixed race condition during attended transfer
authorKevin Harwell <kharwell@digium.com>
Wed, 8 Jul 2015 19:56:10 +0000 (14:56 -0500)
committerKevin Harwell <kharwell@digium.com>
Mon, 13 Jul 2015 17:57:56 +0000 (12:57 -0500)
commitc8555235195ed1deb37f5e27390b0ed4da329dc5
tree45d9a85a0858cf8e0dc9daeab658dcc3f6ef3f08
parent66b57b10f65bee8600c01a0fc03fb491edb7ad76
bridge.c: Fixed race condition during attended transfer

During an attended transfer a thread is started that handles imparting the
bridge channel. From the start of the thread to when the bridge channel is
ready exists a gap that can potentially cause problems (for instance, the
channel being swapped is hung up before the replacement channel enters the
bridge thus stopping the transfer). This patch adds a condition that waits
for the impart thread to get to a point of acceptable readiness before
allowing the initiating thread to continue.

ASTERISK-24782
Reported by: John Bigelow

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