mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
bridge_native_rtp/bridge_channel: Fix direct media issues due to frame hook
This patch fixes issues with direct media bridges that occur after a blind transfer. These issues were caught by the (currently failing) pjsip/transfers/blind_transfer/caller_direct_media test. The test currently fails primarily for two reasons: (1) When Bob and Charlie (the transfer target and the transfer destination) enter a bridge together, the framehook remains on the transfer target channel until both channels are in the bridge. As it consumes voice frames, the initial bridge type is a simple bridge. The framehook is removed when both channels are in the bridge; however, this does not currently cause the bridging framework to re-evaluate the bridge. This patch adds a AST_SOFTHANGUP_UNBRIDGE poke to the transfer target channel when a framehook is removed so the bridge can re-evaluate itself. (2) When a channel leaves a native RTP bridge, it may be leaving due to being hung up. Sending a re-INVITE to a channel that is about to be hung up is not nice - in fact, there's a good chance we'll send the BYE request before the channel has had a chance to send back a 200 OK. To be somewhat nicer, this patch adds a function to channel.h that allows the bridging framework to query for exactly why a channel is leaving a bridge via the channel's soft hangup flags. This allows it to only send the re-INVITE if there's a chance the channel will survive the native bridging experience. Review: https://reviewboard.asterisk.org/r/3535/ ........ Merged revisions 414122 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4272,6 +4272,22 @@ struct ast_bridge *ast_channel_get_bridge(const struct ast_channel *chan);
|
||||
*/
|
||||
int ast_channel_is_bridged(const struct ast_channel *chan);
|
||||
|
||||
/*!
|
||||
* \brief Determine if a channel is leaving a bridge, but \em not hung up
|
||||
* \since 12.3.0
|
||||
*
|
||||
* \param chan The channel to test
|
||||
*
|
||||
* \note If a channel is hung up, it is implicitly leaving any bridge it
|
||||
* may be in. This function is used to test if a channel is leaving a bridge
|
||||
* but may survive the experience, if it has a place to go to (dialplan or
|
||||
* otherwise)
|
||||
*
|
||||
* \retval 0 The channel is not leaving the bridge or is hung up
|
||||
* \retval non-zero The channel is leaving the bridge
|
||||
*/
|
||||
int ast_channel_is_leaving_bridge(struct ast_channel *chan);
|
||||
|
||||
/*!
|
||||
* \brief Get the channel's bridge peer only if the bridge is two-party.
|
||||
* \since 12.0.0
|
||||
|
Reference in New Issue
Block a user