<p>Vitezslav Novy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6895">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_native_rtp: Improved handling of channel hold/unhold<br><br>When channel is put on hold, reinvite both bridge parties as<br>we need RTP via asterisk in that case.<br>When AST_CONTROL_UPDATE_RTP_PEER frame is handled by framehook<br>strat the bridge only if no member channel is on hold.<br><br>ASTERISK-27303<br><br>Change-Id: I811fcadd40912bf8814560b8b02582357f19ed5a<br>---<br>M bridges/bridge_native_rtp.c<br>1 file changed, 13 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/95/6895/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 edbfe58..a0a97a2 100644<br>--- a/bridges/bridge_native_rtp.c<br>+++ b/bridges/bridge_native_rtp.c<br>@@ -540,6 +540,7 @@<br>        struct ast_frame *f, enum ast_framehook_event event, void *data)<br> {<br>  struct ast_bridge *bridge;<br>+   struct ast_bridge_channel *bc0, *bc1;<br>         struct native_rtp_framehook_data *native_data = data;<br> <br>      if (!f<br>@@ -565,10 +566,21 @@<br>                 if (!native_data->detached) {<br>                      switch (f->subclass.integer) {<br>                     case AST_CONTROL_HOLD:<br>-                               native_rtp_bridge_stop(bridge, chan);<br>+                                native_rtp_bridge_stop(bridge, NULL);<br>                                 break;<br>                        case AST_CONTROL_UNHOLD:<br>+                             native_rtp_bridge_start(bridge, NULL);<br>+                               break;<br>                        case AST_CONTROL_UPDATE_RTP_PEER:<br>+                            bc0 = AST_LIST_FIRST(&bridge->channels);<br>+                              bc1 = AST_LIST_LAST(&bridge->channels);<br>+<br>+                            if (bc0 && ast_channel_hold_state(bc0->chan) == AST_CONTROL_HOLD)<br>+                                 break;<br>+<br>+                            if (bc1 && ast_channel_hold_state(bc1->chan) == AST_CONTROL_HOLD)<br>+                                 break;<br>+<br>                             native_rtp_bridge_start(bridge, chan);<br>                                break;<br>                        default:<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6895">change 6895</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/6895"/><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: I811fcadd40912bf8814560b8b02582357f19ed5a </div>
<div style="display:none"> Gerrit-Change-Number: 6895 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vitezslav Novy <a1@vnovy.net> </div>