<p>Jean Aunis - Prescom has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6497">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge : Fix one-way direct-media when early bridging with native_rtp<br><br>When two channels were early bridged in a native_rtp bridge, the RTP description<br>on one side was not updated when the other side answered.<br>This patch forbids non-answered channels to enter a native_rtp bridge, and<br>triggers a bridge reconfiguration when an ANSWER frame is received.<br><br>ASTERISK-27257<br><br>Change-Id: If1aaee1b4ed9658a1aa91ab715ee0a6413b878df<br>---<br>M bridges/bridge_native_rtp.c<br>M include/asterisk/bridge_technology.h<br>M main/bridge_channel.c<br>3 files changed, 9 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/97/6497/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/bridges/bridge_native_rtp.c b/bridges/bridge_native_rtp.c<br>index a46b420..edbfe58 100644<br>--- a/bridges/bridge_native_rtp.c<br>+++ b/bridges/bridge_native_rtp.c<br>@@ -598,7 +598,8 @@<br>  */<br> static int native_rtp_bridge_capable(struct ast_channel *chan)<br> {<br>-  return !ast_channel_has_hook_requiring_audio(chan);<br>+  return !ast_channel_has_hook_requiring_audio(chan)<br>+                   && ast_channel_state(chan) == AST_STATE_UP;<br> }<br> <br> /*!<br>diff --git a/include/asterisk/bridge_technology.h b/include/asterisk/bridge_technology.h<br>index def7b19..eaea28d 100644<br>--- a/include/asterisk/bridge_technology.h<br>+++ b/include/asterisk/bridge_technology.h<br>@@ -108,11 +108,13 @@<br>       *<br>     * \note On entry, bridge is already locked.<br>   *<br>-    * \note The bridge technology must tollerate a failed to join channel<br>+        * \note The bridge technology must tolerate a failed to join channel<br>          * until it can be kicked from the bridge.<br>     *<br>     * \note A channel may be in a suspended state already when joining a bridge<br>   * technology. The technology must handle this case.<br>+  *<br>+    * \note A channel may not be answered when joining a bridge technology.<br>       */<br>   int (*join)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel);<br>    /*!<br>diff --git a/main/bridge_channel.c b/main/bridge_channel.c<br>index 66292bf..4fe8d81 100644<br>--- a/main/bridge_channel.c<br>+++ b/main/bridge_channel.c<br>@@ -2267,10 +2267,12 @@<br> static void bridge_channel_handle_control(struct ast_bridge_channel *bridge_channel, struct ast_frame *fr)<br> {<br>    struct ast_channel *chan;<br>+    struct ast_bridge *bridge;<br>    struct ast_option_header *aoh;<br>        int is_caller;<br> <br>     chan = bridge_channel->chan;<br>+      bridge = bridge_channel->bridge;<br>   switch (fr->subclass.integer) {<br>    case AST_CONTROL_REDIRECTING:<br>                 is_caller = !ast_test_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING);<br>@@ -2313,6 +2315,8 @@<br>        case AST_CONTROL_ANSWER:<br>              if (ast_channel_state(chan) != AST_STATE_UP) {<br>                        ast_answer(chan);<br>+                    bridge->reconfigured = 1;<br>+                 bridge_reconfigured(bridge, 0);<br>               } else {<br>                      ast_indicate(chan, -1);<br>               }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6497">change 6497</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6497"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: If1aaee1b4ed9658a1aa91ab715ee0a6413b878df </div>
<div style="display:none"> Gerrit-Change-Number: 6497 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jean Aunis - Prescom <jean.aunis@prescom.fr> </div>