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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_milliwatt: Timing fix<br><br>The Milliwatt application uses incorrect tone timings<br>that cause it to play the 1004 Hz tone constantly.<br><br>This adds an option to enable the correct timing<br>behavior, so that the Milliwatt application can<br>be used for milliwatt test lines. The default behavior<br>remains unchanged for compatability reasons, even<br>though it is incorrect.<br><br>ASTERISK-29575 #close<br><br>Change-Id: I73ccc6c6fcaa31931c6fff3b85ad1805b2ce9d8c<br>---<br>M apps/app_milliwatt.c<br>A doc/CHANGES-staging/app_milliwatt.txt<br>2 files changed, 29 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c</span><br><span>index 64513fe..1ca6621 100644</span><br><span>--- a/apps/app_milliwatt.c</span><br><span>+++ b/apps/app_milliwatt.c</span><br><span>@@ -40,19 +40,29 @@</span><br><span> /*** DOCUMENTATION</span><br><span>  <application name="Milliwatt" language="en_US"></span><br><span>            <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-                        Generate a Constant 1004Hz tone at 0dbm (mu-law).</span><br><span style="color: hsl(120, 100%, 40%);">+                     Generates a 1004 Hz test tone at 0dbm (mu-law).</span><br><span>              </synopsis></span><br><span>            <syntax></span><br><span>                       <parameter name="options"></span><br><span>                           <optionlist></span><br><span style="color: hsl(120, 100%, 40%);">+                                    <option name="m"></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>Generate a 1004 Hz Milliwatt test tone at 0dbm, with a</span><br><span style="color: hsl(120, 100%, 40%);">+                                            1 second silent interval. This option must be specified</span><br><span style="color: hsl(120, 100%, 40%);">+                                               if you are using this for a milliwatt test line.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                 </option></span><br><span>                                      <option name="o"></span><br><span style="color: hsl(0, 100%, 40%);">-                                               <para>Generate the tone at 1000Hz like previous version.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                           <para>Generate a constant tone at 1000 Hz like previous version.</para></span><br><span>                                  </option></span><br><span>                              </optionlist></span><br><span>                  </parameter></span><br><span>           </syntax></span><br><span>              <description></span><br><span style="color: hsl(0, 100%, 40%);">-                     <para>Previous versions of this application generated the tone at 1000Hz.  If for</span><br><span style="color: hsl(120, 100%, 40%);">+                       <para>Generates a 1004 Hz test tone.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                       <para>By default, this application does not provide a Milliwatt test tone. It simply</span><br><span style="color: hsl(120, 100%, 40%);">+                    plays a 1004 Hz tone, which is not suitable for performing a milliwatt test.</span><br><span style="color: hsl(120, 100%, 40%);">+                  The <literal>m</literal> option should be used so that a real Milliwatt test tone</span><br><span style="color: hsl(120, 100%, 40%);">+                 is provided. This will include a 1 second silent interval every 10 seconds.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                      <para>Previous versions of this application generated a constant tone at 1000 Hz. If for</span><br><span>                       some reason you would prefer that behavior, supply the <literal>o</literal> option to get the</span><br><span>                    old behavior.</para></span><br><span>           </description></span><br><span>@@ -155,8 +165,11 @@</span><br><span>  if (!ast_strlen_zero(options) && strchr(options, 'o')) {</span><br><span>             return old_milliwatt_exec(chan);</span><br><span>     }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       res = ast_playtones_start(chan, 23255, "1004/1000", 0);</span><br><span style="color: hsl(120, 100%, 40%);">+     if (!ast_strlen_zero(options) && strchr(options, 'm')) {</span><br><span style="color: hsl(120, 100%, 40%);">+              res = ast_playtones_start(chan, 23255, "1004/9000,0/1000", 0);</span><br><span style="color: hsl(120, 100%, 40%);">+      } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              res = ast_playtones_start(chan, 23255, "1004/1000", 0);</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span> </span><br><span>        while (!res) {</span><br><span>               res = ast_safe_sleep(chan, 10000);</span><br><span>diff --git a/doc/CHANGES-staging/app_milliwatt.txt b/doc/CHANGES-staging/app_milliwatt.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..434ace2</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_milliwatt.txt</span><br><span>@@ -0,0 +1,11 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_milliwatt</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The Milliwatt application's existing behavior is</span><br><span style="color: hsl(120, 100%, 40%);">+incorrect in that it plays a constant tone, which</span><br><span style="color: hsl(120, 100%, 40%);">+is not how digital milliwatt test lines actually</span><br><span style="color: hsl(120, 100%, 40%);">+work.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+An option is added so that a proper milliwatt test</span><br><span style="color: hsl(120, 100%, 40%);">+tone can be provided, including a 1 second silent</span><br><span style="color: hsl(120, 100%, 40%);">+interval every 10 seconds. However, for compatability</span><br><span style="color: hsl(120, 100%, 40%);">+reasons, the default behavior remains unchanged.</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/+/16335">change 16335</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/+/16335"/><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: I73ccc6c6fcaa31931c6fff3b85ad1805b2ce9d8c </div>
<div style="display:none"> Gerrit-Change-Number: 16335 </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: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>