<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14503">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_channel: Don't queue unmapped frames.<br><br>If a frame is written to a channel in a bridge we<br>would normally queue this frame up and the channel<br>thread would then act upon it. If this frame had no<br>stream mapping on the channel it would then be<br>discarded.<br><br>This change adds a check before the queueing occurs<br>to determine if a mapping exists. If it does not<br>exist then the frame is not even queued at all. This<br>stops a frame duplication from happening and from<br>the channel thread having to wake up and deal with<br>it.<br><br>Change-Id: I17189b9b1dec45fc7e4490e8081d444a25a00bda<br>---<br>M main/bridge_channel.c<br>1 file changed, 15 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/03/14503/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/bridge_channel.c b/main/bridge_channel.c</span><br><span>index 8566187..7f2b01e 100644</span><br><span>--- a/main/bridge_channel.c</span><br><span>+++ b/main/bridge_channel.c</span><br><span>@@ -1043,6 +1043,21 @@</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (fr->stream_num > -1) {</span><br><span style="color: hsl(120, 100%, 40%);">+ int num = -1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_bridge_channel_lock(bridge_channel);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (fr->stream_num < (int)AST_VECTOR_SIZE(&bridge_channel->stream_map.to_channel)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ num = AST_VECTOR_GET(&bridge_channel->stream_map.to_channel, fr->stream_num);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_bridge_channel_unlock(bridge_channel);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (num == -1) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We don't have a mapped stream so just discard this frame. */</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> dup = ast_frdup(fr);</span><br><span> if (!dup) {</span><br><span> return -1;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14503">change 14503</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/14503"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I17189b9b1dec45fc7e4490e8081d444a25a00bda </div>
<div style="display:none"> Gerrit-Change-Number: 14503 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>