<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13310">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/asterisk/+/13310/2/apps/app_chanisavail.c">File apps/app_chanisavail.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/asterisk/+/13310/2/apps/app_chanisavail.c@31">Patch Set #2, Line 31:</a> <code style="font-family:monospace,monospace"><depend>func_cdr</depend></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">This is not a "true" dependance, since app_chanisavail can work without it. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This "depend" is a not hard dependency so it should not be listed here.  ChanIsAvail checks for the dialplan CDR_PROP function's existence before using it.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/13310/2/apps/app_chanisavail.c@183">Patch Set #2, Line 183:</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;">                          if (ast_custom_function_find("CDR_PROP") != NULL)<br>                                           ast_func_write(tempchan, "CDR_PROP(disable)", "1");<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Guidelines: Always use curly braces.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Also you don't need to explicitly check for not NULL.  Just</p><p style="white-space: pre-wrap; word-wrap: break-word;">if (ast_custom_function_find(...)) {<br>}</p><p style="white-space: pre-wrap; word-wrap: break-word;">One thing you probably should do is to pull the call to ast_custom_function_find() out of the current do-while loop and save the result.  This way Asterisk doesn't have to look up CDR_PROP so many times for this ChanIsAvail execution.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13310">change 13310</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/+/13310"/><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: I1cbe09e8d2169c0962c1195133ff260d291f2074 </div>
<div style="display:none"> Gerrit-Change-Number: 13310 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Frederic LE FOLL <frederic.lefoll@c-s.fr> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 11 Dec 2019 22:37:29 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Comment-In-Reply-To: Frederic LE FOLL <frederic.lefoll@c-s.fr> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>