<p>Jean Aunis - Prescom has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6462">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_native_rtp : update peer channel's RTP when receiving an ANSWER frame<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 updates the peer channel's RTP description when an AST_CONTROL_ANSWER<br>frame is written to the bridge.<br><br>ASTERISK-27257<br><br>Change-Id: If1aaee1b4ed9658a1aa91ab715ee0a6413b878df<br>---<br>M bridges/bridge_native_rtp.c<br>1 file changed, 24 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/62/6462/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 a166258..6dabb3e 100644<br>--- a/bridges/bridge_native_rtp.c<br>+++ b/bridges/bridge_native_rtp.c<br>@@ -345,8 +345,9 @@<br>              }<br> <br>          /*<br>-            * If we have a target, it's the channel that received the UNHOLD or<br>-              * UPDATE_RTP_PEER frame and was told to resume<br>+               * We may have a target for two reasons :<br>+             * - the channel that received the UNHOLD or UPDATE_RTP_PEER frame and was told to resume<br>+             * - the other channel answered<br>                */<br>           if (!target) {<br>                        /* Send both channels to remote */<br>@@ -358,10 +359,10 @@<br>                             ast_channel_name(bc0->chan), ast_channel_name(bc1->chan));<br>              } else {<br>                      /*<br>-                    * If a target was provided, it is the recipient of an unhold or an update and needs to have<br>-                  * its media redirected to fit the current remote bridging needs. The other channel is either<br>-                         * already set up to handle the new media path or will have its own set of updates independent<br>-                        * of this pass.<br>+                      * If a target was provided, it is the recipient of an unhold or an update, or its peer answered.<br>+                     * Anyway, it needs to have its media redirected to fit the current remote bridging needs.<br>+                    * The other channel is either already set up to handle the new media path or will have its<br>+                   * own set of updates independent of this pass.<br>                        */<br>                   ast_debug(2, "Bridge '%s'.  Sending '%s' back to remote\n",<br>                                 bridge->uniqueid, ast_channel_name(target));<br>@@ -890,8 +891,25 @@<br> static int native_rtp_bridge_write(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)<br> {<br>         const struct ast_control_t38_parameters *t38_parameters;<br>+     struct ast_channel *peer_chan;<br>        int defer = 0;<br> <br>+    if(frame->frametype == AST_FRAME_CONTROL<br>+          && frame->subclass.integer == AST_CONTROL_ANSWER) {<br>+               /*<br>+            * The channel answered, and then is likely to have updated<br>+           * its media description. We need to update the bridged channel.<br>+              */<br>+          if(bridge_channel == AST_LIST_FIRST(&bridge->channels)) {<br>+                     peer_chan = AST_LIST_LAST(&bridge->channels)->chan;<br>+                } else {<br>+                     peer_chan = AST_LIST_FIRST(&bridge->channels)->chan;<br>+               }<br>+            ast_verb(4, "%s answered, updating media on peer channel %s\n",<br>+                    ast_channel_name(bridge_channel->chan), ast_channel_name(peer_chan));<br>+             native_rtp_bridge_start(bridge, peer_chan);<br>+  }<br>+<br>  if (!ast_bridge_queue_everyone_else(bridge, bridge_channel, frame)) {<br>                 /* This frame was successfully queued so no need to defer */<br>          return 0;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6462">change 6462</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/6462"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 14 </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: 6462 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jean Aunis - Prescom <jean.aunis@prescom.fr> </div>