<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6325">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_native_rtp.c: Fixup native_rtp_framehook()<br><br>* Fix framehook to test frame type for control frame.<br>* Made framehook exit early if frame type is not a control frame.<br>* Eliminated RAII_VAR in framehook.<br>* Use switch instead of else-if ladder for control frame handling.<br><br>Change-Id: Ia555fc3600bd85470e3c0141147dbe3ad07c1d18<br>---<br>M bridges/bridge_native_rtp.c<br>1 file changed, 13 insertions(+), 5 deletions(-)<br><br></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 899523e..a166258 100644<br>--- a/bridges/bridge_native_rtp.c<br>+++ b/bridges/bridge_native_rtp.c<br>@@ -541,10 +541,12 @@<br> static struct ast_frame *native_rtp_framehook(struct ast_channel *chan,<br> struct ast_frame *f, enum ast_framehook_event event, void *data)<br> {<br>- RAII_VAR(struct ast_bridge *, bridge, NULL, ao2_cleanup);<br>+ struct ast_bridge *bridge;<br> struct native_rtp_framehook_data *native_data = data;<br> <br>- if (!f || (event != AST_FRAMEHOOK_EVENT_WRITE)) {<br>+ if (!f<br>+ || f->frametype != AST_FRAME_CONTROL<br>+ || event != AST_FRAMEHOOK_EVENT_WRITE) {<br> return f;<br> }<br> <br>@@ -563,14 +565,20 @@<br> ast_channel_unlock(chan);<br> ast_bridge_lock(bridge);<br> if (!native_data->detached) {<br>- if (f->subclass.integer == AST_CONTROL_HOLD) {<br>+ switch (f->subclass.integer) {<br>+ case AST_CONTROL_HOLD:<br> native_rtp_bridge_stop(bridge, chan);<br>- } else if ((f->subclass.integer == AST_CONTROL_UNHOLD) ||<br>- (f->subclass.integer == AST_CONTROL_UPDATE_RTP_PEER)) {<br>+ break;<br>+ case AST_CONTROL_UNHOLD:<br>+ case AST_CONTROL_UPDATE_RTP_PEER:<br> native_rtp_bridge_start(bridge, chan);<br>+ break;<br>+ default:<br>+ break;<br> }<br> }<br> ast_bridge_unlock(bridge);<br>+ ao2_ref(bridge, -1);<br> ast_channel_lock(chan);<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6325">change 6325</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/6325"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia555fc3600bd85470e3c0141147dbe3ad07c1d18 </div>
<div style="display:none"> Gerrit-Change-Number: 6325 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>