[asterisk-bugs] [Asterisk 0011796]: [patch] refactoring of fax tone detection in DSP

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Jan 21 19:35:22 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11796 
====================================================================== 
Reported By:                dimas
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11796
Category:                   PBX/General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 99085 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             01-18-2008 20:36 CST
Last Modified:              01-21-2008 19:35 CST
====================================================================== 
Summary:                    [patch] refactoring of fax tone detection in DSP
Description: 
Refactored DTMF digit detection, fax tone detection & added CED fax tone
detection. See Additional Infrmation for details.
====================================================================== 

---------------------------------------------------------------------- 
 dimas - 01-21-08 19:35  
---------------------------------------------------------------------- 
Attached new patch.

1. mhit vs current_hit. I noticed that the mhit was never really used in
the MF code even before my modifications. The variable was never assigned a
value except of zero. (This is true for MF code only - DTMF code did use
mhit).

Anyway, I renamed the variable and also I fixed the code to use it. This
however led to another change - how ast_dsp_process interprets result of
digit-detection. Now this function is more interested in content of buffer
of collected digits than in actual result returned by the digit-detection
code. 

I believe this is right thing to do. However I clearly understand that it
now requires even more testing effort.

2. 10% actually is arbitrary. It is just assumption which looks
reasonable.

3. Oh.. You are right. Previously only 5 hits of CNG were required (63ms)
and now CNG tone is detected only when it is present for 500ms-10% which
means about 450ms. 

When I said the old code won't notice anything I actually meant the code
will be notified about CNG the same old way (AST_FRAME_DTMF/'f') and won't
get unexpected AST_FRAME_DTMF/'e' (CED) notifications. I do not think there
is a code which depends on the exact moment when the AST_FRAME_DTMF/'f'
gets received relative to tone start.

4. I understand the need of testing. Will do some more testing internally,
then ask people I have connections with and then finally will announce on
-dev mailing list.

5. Regarding the Goertzel block size for MF. Honestly I have no idea why
120 is used. It means block size is 15ms which is a bit too much when Bell
specification minimum tone is 30ms. The 30ms tone starting and ending in
the middle of 15ms block won't be detected because code requires two
successive hits while first and last blocks will miss. In contrast, with 80
samples block (10ms) the tone would be detected.

Only the original author of the code (steve?) knows why he increased the
block size. Probably there too many false positive/negatives. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-21-08 19:35  dimas          Note Added: 0080980                          
======================================================================




More information about the asterisk-bugs mailing list