<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6327">View Change</a></p><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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/6327/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 02b27e1..a46b420 100644<br>--- a/bridges/bridge_native_rtp.c<br>+++ b/bridges/bridge_native_rtp.c<br>@@ -539,10 +539,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>@@ -561,14 +563,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/6327">change 6327</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/6327"/><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: Ia555fc3600bd85470e3c0141147dbe3ad07c1d18 </div>
<div style="display:none"> Gerrit-Change-Number: 6327 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>