[asterisk-commits] bridge : Fix one-way direct-media when early bridging with n... (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 21 10:57:57 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/6497 )

Change subject: bridge : Fix one-way direct-media when early bridging with native_rtp
......................................................................

bridge : Fix one-way direct-media when early bridging with native_rtp

When two channels were early bridged in a native_rtp bridge, the RTP description
on one side was not updated when the other side answered.
This patch forbids non-answered channels to enter a native_rtp bridge, and
triggers a bridge reconfiguration when an ANSWER frame is received.

ASTERISK-27257

Change-Id: If1aaee1b4ed9658a1aa91ab715ee0a6413b878df
---
M bridges/bridge_native_rtp.c
M include/asterisk/bridge_technology.h
M main/bridge_channel.c
3 files changed, 9 insertions(+), 2 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/bridges/bridge_native_rtp.c b/bridges/bridge_native_rtp.c
index a46b420..edbfe58 100644
--- a/bridges/bridge_native_rtp.c
+++ b/bridges/bridge_native_rtp.c
@@ -598,7 +598,8 @@
  */
 static int native_rtp_bridge_capable(struct ast_channel *chan)
 {
-	return !ast_channel_has_hook_requiring_audio(chan);
+	return !ast_channel_has_hook_requiring_audio(chan)
+			&& ast_channel_state(chan) == AST_STATE_UP;
 }
 
 /*!
diff --git a/include/asterisk/bridge_technology.h b/include/asterisk/bridge_technology.h
index def7b19..eaea28d 100644
--- a/include/asterisk/bridge_technology.h
+++ b/include/asterisk/bridge_technology.h
@@ -108,11 +108,13 @@
 	 *
 	 * \note On entry, bridge is already locked.
 	 *
-	 * \note The bridge technology must tollerate a failed to join channel
+	 * \note The bridge technology must tolerate a failed to join channel
 	 * until it can be kicked from the bridge.
 	 *
 	 * \note A channel may be in a suspended state already when joining a bridge
 	 * technology. The technology must handle this case.
+	 *
+	 * \note A channel may not be answered when joining a bridge technology.
 	 */
 	int (*join)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel);
 	/*!
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 66292bf..89e5571 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -2313,6 +2313,10 @@
 	case AST_CONTROL_ANSWER:
 		if (ast_channel_state(chan) != AST_STATE_UP) {
 			ast_answer(chan);
+			ast_bridge_channel_lock_bridge(bridge_channel);
+			bridge_channel->bridge->reconfigured = 1;
+			bridge_reconfigured(bridge_channel->bridge, 0);
+			ast_bridge_unlock(bridge_channel->bridge);
 		} else {
 			ast_indicate(chan, -1);
 		}

-- 
To view, visit https://gerrit.asterisk.org/6497
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If1aaee1b4ed9658a1aa91ab715ee0a6413b878df
Gerrit-Change-Number: 6497
Gerrit-PatchSet: 2
Gerrit-Owner: Jean Aunis - Prescom <jean.aunis at prescom.fr>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170921/1bd37b40/attachment-0001.html>


More information about the asterisk-commits mailing list