<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17933">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, approved
  Joshua Colp: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_tonedetect: Fixes some logic issues and typos<br><br>Fixes some minor logic issues with the module:<br><br>Previously, the OPT_END_FILTER flag was getting<br>tested before options were parsed, so it could<br>never evaluate to true (wrong ordering).<br><br>Additionally, the initially parsed timeout (float)<br>needs to be compared with 0, not the result int<br>which is set afterwards (wrong variable).<br><br>ASTERISK-29857 #close<br><br>Change-Id: I0062bce3b391c15e5df7a714780eeaa96dd93d4c<br>---<br>M res/res_tonedetect.c<br>1 file changed, 4 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_tonedetect.c b/res/res_tonedetect.c</span><br><span>index b65a69b..4943f69 100644</span><br><span>--- a/res/res_tonedetect.c</span><br><span>+++ b/res/res_tonedetect.c</span><br><span>@@ -596,12 +596,12 @@</span><br><span>      parse = ast_strdupa(data);</span><br><span>   AST_STANDARD_APP_ARGS(args, parse);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_test_flag(&flags, OPT_END_FILTER)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                return remove_detect(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span>    if (!ast_strlen_zero(args.options)) {</span><br><span>                ast_app_parse_options(td_opts, &flags, opt_args, args.options);</span><br><span>  }</span><br><span style="color: hsl(120, 100%, 40%);">+     if (ast_test_flag(&flags, OPT_END_FILTER)) {</span><br><span style="color: hsl(120, 100%, 40%);">+              return remove_detect(chan);</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span>    if (freq_parser(args.freqs, &freq1, &freq2)) {</span><br><span>               return -1;</span><br><span>   }</span><br><span>@@ -739,7 +739,7 @@</span><br><span>              pbx_builtin_setvar_helper(chan, "WAITFORTONESTATUS", "ERROR");</span><br><span>           return -1;</span><br><span>   }</span><br><span style="color: hsl(0, 100%, 40%);">-       if (!ast_strlen_zero(args.timeout) && (sscanf(args.timeout, "%30lf", &timeoutf) != 1 || timeout < 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+      if (!ast_strlen_zero(args.timeout) && (sscanf(args.timeout, "%30lf", &timeoutf) != 1 || timeoutf < 0)) {</span><br><span>            ast_log(LOG_WARNING, "Invalid timeout: %s\n", args.timeout);</span><br><span>               pbx_builtin_setvar_helper(chan, "WAITFORTONESTATUS", "ERROR");</span><br><span>           return -1;</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17933">change 17933</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/+/17933"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I0062bce3b391c15e5df7a714780eeaa96dd93d4c </div>
<div style="display:none"> Gerrit-Change-Number: 17933 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>