]> git.ipfire.org Git - thirdparty/asterisk.git/commit
stasis transfer: fix stasis bridge push race part two 65/2665/1
authorScott Griepentrog <sgriepentrog@digium.com>
Thu, 29 Jan 2015 23:02:41 +0000 (23:02 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 20 Apr 2016 21:51:57 +0000 (16:51 -0500)
commitb81052d194f9990831dad0d16dd3fb69bc002626
treef9d23806c73b45e29a574c9f0bc355edc9b683d7
parenta38d044e0a537e61f69ba0e6725a3984f6aa509d
stasis transfer: fix stasis bridge push race part two

When swapping a Local channel in place of one already
in a bridge (to complete a bridge attended transfer),
the channel that was swapped out can actually be hung
up before the stasis bridge push callback executes on
the independant transfer thread.  This results in the
stasis app loop dropping out and removing the control
that has the the app name which the local replacement
channel needs so it can re-enter stasis.

To avoid this race condition a new push_peek callback
has been added, and called from the ast_bridge_impart
thread before it launches the independant thread that
will complete the transfer.  Now the stasis push_peek
callback can copy the stasis app name before the swap
channel can hang up.

ASTERISK-24649
Review: https://reviewboard.asterisk.org/r/4382/

This patch is a remedial cherry-pick from v13.

Change-Id: I307c3b506af5af80ec506f73e8b78a91d79999e0
include/asterisk/bridge.h
main/bridge.c
res/stasis/stasis_bridge.c