Review Board 1.7.16


stasis bridge: handle early hangup of swap channel

Review Request #4382 - Created Jan. 27, 2015 and submitted

Scott Griepentrog
ASTERISK-24649
Reviewers
asterisk-dev
Asterisk
During an attended transfer of a channel in stasis, where a local channel is used to replace (swap in for) a PJSIP channel, there is a race condition.  The PJSIP REFER transfer has been initiated (ast_bridge_impart) but will be completed later on another thread (bridge_channel_ind_thread), however, prior to the stasis bridging callback (bridge_stasis_push) being called the PJSIP channel is hungup, which allows the stasis app loop to exit, deleting the stasis control.  That prevents the stasis bridge callback from getting the app name from the channel being replaced (swap).

This patch adds a new stasis bridge callback push_peek, which is called from the ast_bridge_impart() thread.  This allows the new bridge_stasis_push_peek() function to copy the stasis app name from the originating channel before the PJSIP channel can be hungup.
Running tests/rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app now does not result in an occasional failure.
Total:
14
Open:
0
Resolved:
13
Dropped:
1
Status:
From:
Description From Last Updated Status
Review request changed
Updated (Jan. 29, 2015, 5:23 p.m.)
  • changed from pending to submitted
Committed in revision 431466

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.