<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=RU link=blue vlink=purple style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Regarding the </span><span lang=EN-US>&lt;</span><a
href="http://www.blueboxmoon.com/bitweaver/blogs/view_post.php?post_id=10"
target="_blank"><span lang=EN-US>http://www.blueboxmoon.com/bitweaver/blogs/view_post.php?post_id=10</span></a><span
lang=EN-US>&gt; </span><span lang=EN-US style='font-size:11.0pt;font-family:
"Calibri","sans-serif";color:#1F497D'>patch &#8211; as I understand you allow
up to 4 successive misses inside a digit to still consider it a single digit. With
block size of 102 samples (12.75 ms @ 8 KHz sampling) it means about 50 ms. However,
50 ms is valid inter-digit interval (matching minimum interval duration
requirements) . Which means your patch is not for &#8220;general public&#8221;
because it will almost certainly be eliminating double-digits even where they
are should remain.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> asterisk-dev-bounces@lists.digium.com
[mailto:asterisk-dev-bounces@lists.digium.com] <b>On Behalf Of </b>Daniel
Hazelbaker<br>
<b>Sent:</b> Monday, December 03, 2007 9:31 PM<br>
<b>To:</b> Asterisk Developers Mailing List<br>
<b>Subject:</b> Re: [asterisk-dev] DTMF end accepted without begin<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Have you tried setting the relaxdtmf setting in
/etc/asterisk/zapata.conf? &nbsp;You also have to turn on &quot;Relax DTMF for
Radio Applications&quot; (even though it has nothing to do with radio
communications). &nbsp;That might solve the completely missing tones.<o:p></o:p></p>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>Based upon my own research and that of somebody else (sorry
can't remember name) that did some major fixing up of code in the dsp.c DTMF
detection code recently, dsp.c does the actual DTMF detection. &nbsp;Zaptel
doesn't seem to do squat when it comes to DTMF detection.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>You can play around in dsp.c near line 165. &nbsp;Play with
those DTMF_ defines (make sure you are in the right #ifdef) and you might be
able to tweak some stuff to better detect in your situation. &nbsp;Personally I
found that when I turned on the relaxdtmf option people's voices were being
detected as tones, but you might be able to get a more precise
&quot;relaxed&quot; mode.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>Also, my patch stemmed from the following logging
information. &nbsp;You might be able to turn it on and see exactly what is
happening when tones are missed. &nbsp;(Warning: this will spit out a TON of
logging information).<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>This is from 1.4.12, line 591 and surrounding:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;&amp;
goertzel_result(&amp;s-&gt;row_out2nd[best_row])*DTMF_2ND_HARMONIC_ROW &lt;
row_energy[best_row]) {<o:p></o:p></p>

</div>

<div>

<div>

<p class=MsoNormal>#else<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* ... and fraction of total energy test */<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>ADD-&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;ast_log(LOG_NOTICE, &quot;dtmf_detect row_energy=%f, col_energy=%f,
total=%f &gt; %f (%f + %f)&quot;, row_energy[best_row], col_energy[best_col],<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>ADD-&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;(row_energy[best_row] + col_energy[best_col]), (DTMF_TO_TOTAL_ENERGY *
s-&gt;energy), DTMF_TO_TOTAL_ENERGY, s-&gt;energy);<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (i &gt;= 4 &amp;&amp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(row_energy[best_row] +
col_energy[best_col]) &gt; DTMF_TO_TOTAL_ENERGY*s-&gt;energy) {<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>#endif<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* Got a hit */<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>It is a bit messy, but it might help track down exactly what
&quot;energy&quot; values you would need to catch those false negatives.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

<div>

<p class=MsoNormal>Daniel<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<div>

<p class=MsoNormal>On Dec 3, 2007, at 9:55 AM, John Aughey wrote:<o:p></o:p></p>

</div>

<p class=MsoNormal><br>
<br>
<o:p></o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>We actually get both the
&quot;wobble&quot; detection (multiple tones detected with one button press)
and missing detection (press 201 and it detects 01 missing the 2).&nbsp; The
suggestions on voip-info have not yet helped and the lack of DTMF_BEGIN events
concern me.&nbsp; It's also not clear right now where the dtmf detection is
done, if it's in the zaptel-1.4.6 code base or within
asterisk-1.4.14/main/dsp.c.&nbsp; They both seem to do tone detection.<br>
<br>
John<o:p></o:p></p>

<div>

<p class=MsoNormal>On Dec 3, 2007 10:31 AM, Daniel Hazelbaker &lt;<a
href="mailto:daniel@highdesertchurch.com"> daniel@highdesertchurch.com</a>&gt;
wrote:<o:p></o:p></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>On Dec 2, 2007, at 5:35 PM,
John Aughey wrote: <br>
<br>
&gt; The begin frames (and associated end frames) are helpful to filter<br>
&gt; out short dtmf reads. &nbsp;There's even a #define which specifies the<br>
&gt; minimum length of a dtmf tone. &nbsp;One problem we're having is multiple <br>
&gt; dtmf detections on a noisy cell phone connection, which should be<br>
&gt; mostly filtered by knowing the begin and end time so that the length<br>
&gt; can be properly measured and filtered if needed.<br>
&gt;<br>
&gt; John <o:p></o:p></p>

</div>

<p class=MsoNormal>If you are running 1.4.15 (it should apply down to .12 as
well I<br>
believe) then you can try this patch. &nbsp;We have a similar problem at<br>
our site, except it is due to a junky NEC that is currently the front- <br>
end to the Telco. &nbsp;Tones would have a drop-out in the middle of them<br>
so Asterisk was detected double digits. &nbsp;i.e. they dial 235 and it<br>
reads 2335. &nbsp;With this patch the &quot;wobble&quot; tones are almost never
an <br>
issue anymore.<br>
<br>
&lt;<a
href="http://www.blueboxmoon.com/bitweaver/blogs/view_post.php?post_id=10"
target="_blank">http://www.blueboxmoon.com/bitweaver/blogs/view_post.php?post_id=10</a>&gt;<br>
<span style='color:#888888'><br>
Daniel</span><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--"
target="_blank">http://www.api-digital.com-- </a><br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
&nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev"
target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a> <o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a>--<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
&nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</body>

</html>