summaryrefslogtreecommitdiff
path: root/main/bridge_channel.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-01-27 17:34:37 +0000
committerJoshua Colp <jcolp@digium.com>2015-01-27 17:34:37 +0000
commita43d24a9d3d61274e6b7b8cf594af0d802c100b7 (patch)
tree15b7e72afbfaf7bb1e6769944e3c083a0d2779c7 /main/bridge_channel.c
parentfb8a2e039978b264737aa7a4ed08f9af4c329f47 (diff)
bridge / res_pjsip_sdp_rtp: Fix issues with media not being reinvited during direct media.
This change fixes two issues: 1. During a swap operation bridging added the new channel before having the swap channel leave. This was not handled in bridge_native_rtp and could result in a channel not getting reinvited back to Asterisk. After this change the swap channel will leave first and the new channel will then join. 2. If a re-invite was received after a session had been established any upstream elements (such as bridge_native_rtp) were not notified that they may want to re-evaluate things. After this change an UPDATE_RTP_PEER control frame is queued when this situation occurs and upstream can react. AST-1524 #close Review: https://reviewboard.asterisk.org/r/4378/ ........ Merged revisions 431157 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/bridge_channel.c')
-rw-r--r--main/bridge_channel.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 25a1a5153..ac72c8bc2 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -1994,6 +1994,19 @@ int bridge_channel_internal_push(struct ast_bridge_channel *bridge_channel)
bridge->uniqueid, bridge_channel, ast_channel_name(bridge_channel->chan));
return -1;
}
+
+ if (swap) {
+ int dissolve = ast_test_flag(&bridge->feature_flags, AST_BRIDGE_FLAG_DISSOLVE_EMPTY);
+
+ /* This flag is cleared so the act of this channel leaving does not cause it to dissolve if need be */
+ ast_clear_flag(&bridge->feature_flags, AST_BRIDGE_FLAG_DISSOLVE_EMPTY);
+
+ ast_bridge_channel_leave_bridge(swap, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, 0);
+ bridge_channel_internal_pull(swap);
+
+ ast_set2_flag(&bridge->feature_flags, dissolve, AST_BRIDGE_FLAG_DISSOLVE_EMPTY);
+ }
+
bridge_channel->in_bridge = 1;
bridge_channel->just_joined = 1;
AST_LIST_INSERT_TAIL(&bridge->channels, bridge_channel, entry);
@@ -2015,10 +2028,6 @@ int bridge_channel_internal_push(struct ast_bridge_channel *bridge_channel)
bridge->uniqueid);
ast_bridge_publish_enter(bridge, bridge_channel->chan, swap ? swap->chan : NULL);
- if (swap) {
- ast_bridge_channel_leave_bridge(swap, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, 0);
- bridge_channel_internal_pull(swap);
- }
/* Clear any BLINDTRANSFER and ATTENDEDTRANSFER since the transfer has completed. */
pbx_builtin_setvar_helper(bridge_channel->chan, "BLINDTRANSFER", NULL);