[asterisk-commits] file: branch certified-13.1 r431159 - in /certified/branches/13.1: ./ main/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 27 11:35:39 CST 2015


Author: file
Date: Tue Jan 27 11:35:36 2015
New Revision: 431159

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=431159
Log:
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

Modified:
    certified/branches/13.1/   (props changed)
    certified/branches/13.1/main/bridge_channel.c
    certified/branches/13.1/res/res_pjsip_sdp_rtp.c

Propchange: certified/branches/13.1/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: certified/branches/13.1/main/bridge_channel.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/13.1/main/bridge_channel.c?view=diff&rev=431159&r1=431158&r2=431159
==============================================================================
--- certified/branches/13.1/main/bridge_channel.c (original)
+++ certified/branches/13.1/main/bridge_channel.c Tue Jan 27 11:35:36 2015
@@ -1994,6 +1994,19 @@
 			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 @@
 		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);

Modified: certified/branches/13.1/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/13.1/res/res_pjsip_sdp_rtp.c?view=diff&rev=431159&r1=431158&r2=431159
==============================================================================
--- certified/branches/13.1/res/res_pjsip_sdp_rtp.c (original)
+++ certified/branches/13.1/res/res_pjsip_sdp_rtp.c Tue Jan 27 11:35:36 2015
@@ -1182,6 +1182,10 @@
 
 	/* audio stream handles music on hold */
 	if (media_type != AST_MEDIA_TYPE_AUDIO) {
+		if ((pjmedia_sdp_neg_was_answer_remote(session->inv_session->neg) == PJ_FALSE)
+			&& (session->inv_session->state == PJSIP_INV_STATE_CONFIRMED)) {
+			ast_queue_control(session->channel, AST_CONTROL_UPDATE_RTP_PEER);
+		}
 		return 1;
 	}
 
@@ -1201,6 +1205,9 @@
 		ast_queue_unhold(session->channel);
 		ast_queue_frame(session->channel, &ast_null_frame);
 		session_media->held = 0;
+	} else if ((pjmedia_sdp_neg_was_answer_remote(session->inv_session->neg) == PJ_FALSE)
+		&& (session->inv_session->state == PJSIP_INV_STATE_CONFIRMED)) {
+		ast_queue_control(session->channel, AST_CONTROL_UPDATE_RTP_PEER);
 	}
 
 	/* This purposely resets the encryption to the configured in case it gets added later */




More information about the asterisk-commits mailing list