<p>Patch set 3:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/9510">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/9510/3/res/res_rtp_asterisk.c">File res/res_rtp_asterisk.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9510/3/res/res_rtp_asterisk.c@6105">Patch Set #3, Line 6105:</a> <code style="font-family:monospace,monospace">    if (!rtp->red) return 0;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Still missing curly braces.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/9510/3/res/res_rtp_asterisk.c@6108">Patch Set #3, Line 6108:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">               const unsigned char *primary = red->buf_data;<br>              if (red->t140.datalen > 0 && (primary[0] == 0x08 || primary[0] == 0x0a || primary[0] == 0x0d)) {<br>                        /* flush previous t140 packet if it is a command */<br>                   ast_rtp_write(instance, &rtp->red->t140);<br>           } else {<br>                      primary = frame->data.ptr;<br>                 if (primary[0] == 0x08 || primary[0] == 0x0a || primary[0] == 0x0d) {<br>                         /* flush previous t140 packet we send commands */<br>                             ast_rtp_write(instance, &rtp->red->t140);<br>                   }<br>             }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think the code should be this way:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">if (red->t140.datalen > 0) {<br>   const unsigned char *primary = red->buf_data;</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">   /* There is something already in the T.140 buffer */<br>   if (primary[0] == 0x08 ....) {<br>       /* Flush the previous T.140 packet if it is a command */<br>       ast_rtp_write(instance, &rtp->red->t140);<br>   } else {<br>       primary = frame->data->ptr;<br>       if (primary[0] == 0x08 ....) {<br>          /* Flush the previous T.140 packet if we are buffering a command now */<br>          ast_rtp_write(instance, &rtp->red->t140);<br>       }<br>   }<br>}</pre></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/9510">change 9510</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/9510"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Ifbe993311410fa855cb8aa4a12084db75f413462 </div>
<div style="display:none"> Gerrit-Change-Number: 9510 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Emmanuel BUU <emmanuel.buu@ives.fr> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 19 Jul 2018 16:50:57 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>