asterisk/res/stasis
Scott Griepentrog 49f405fe4c stasis transfer: fix a race condition on stasis bridge push
After a bridge transfer completes where a local replacement
channel is used, a stasis transfer message with the details
of the transfer is sent.  This is processed by stasis which
then sets the stasis app name and replaced channel snapshot
on the replacement channel.

However, since a separate thread was already started to run
stasis on the new replacement channel, a race was on to see
if the message processing would be completed before the app
name was needed, otherwise the channel would be hung up.

This change moves the calls used to set the stasis app name
and the replace snapshot to the bridge_stasis_push function
callback from the bridge transfer logic, allowing the steps
to be completed earlier and more deterministically, and the
race elimianted.

NOTE: the swap channel parameter to bridge_stasis_push (and
thus all bridge push callbacks) must always be present when
performing a swap with another channel.

ASTERISK-24649 #close
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/4341/
........

Merged revisions 430939 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-22 18:10:13 +00:00
..
app.c stasis transfer: fix a race condition on stasis bridge push 2015-01-22 18:10:13 +00:00
app.h Stasis: Fix StasisStart/End order and missing events 2014-12-08 15:45:46 +00:00
command.c ARI: Fix a crash caused by hanging during playback to a channel in a bridge 2014-08-22 16:52:51 +00:00
command.h ARI: Fix a crash caused by hanging during playback to a channel in a bridge 2014-08-22 16:52:51 +00:00
control.c ARI: Fix a crash caused by hanging during playback to a channel in a bridge 2014-08-22 16:52:51 +00:00
control.h Stasis: Convey transfer information to applications 2014-08-07 15:30:19 +00:00
messaging.c stasis: Fix compilation issue with ao2 tagged objects 2014-08-05 21:48:05 +00:00
messaging.h Clean up files that do not end with newlines 2014-08-21 14:52:28 +00:00
stasis_bridge.c stasis transfer: fix a race condition on stasis bridge push 2015-01-22 18:10:13 +00:00
stasis_bridge.h ARI: Make mixing bridges propagate linkedids and accountcodes. 2014-07-09 16:34:51 +00:00