[asterisk-bugs] [Asterisk 0011968]: [patch] DSP cleanup phase 2

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Mar 26 10:49:46 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11968 
====================================================================== 
Reported By:                dimas
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11968
Category:                   PBX/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 100974 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             02-10-2008 15:57 CST
Last Modified:              03-26-2008 10:49 CDT
====================================================================== 
Summary:                    [patch] DSP cleanup phase 2
Description: 
NOTE: these changes ara made on top of
http://bugs.digium.com/view.php?id=11796 so it must be applied first.
Publishing changes mainly for review.

1. Removed MUTECONF/MUTEMAX options support from DSP code. The idea behind
these is somewhat unclear and my analisys shows it is broken anyway -
http://lists.digium.com/pipermail/asterisk-dev/2008-January/031650.html

2. The code now generated DTMF_BEGIN frames in addition to DTMF_END ones.

3. "quelching" rewritten - now each detector (MF/DTMF/generic tone) may
mark fragment of a frame for suppression (squelching, muting) with a call
to mute_fragment. Actual muting happens only once at the very end of
ast_dsp_process where all marked fragments are zeroed. This way every
detector sees original data in the frame without any piece of a frame being
zeroed by a detector which was run before.

4. DTMF detector tries to "mute" one block before and one block after the
block where actual tone was detected. Muting of previois block is something
new for this patch. Obviously this operation is not always possible - if
current frame does not contain data for previous block - it is too late.
But at least we make our best.

Muting of next block was already done by the old code but it only affects
part of the next block which is in the frame being processed. New code
keeps this information in state structures so it will mute proper number of
samples in the next frame(s) too.

5. Removed ast_dsp_digitdetect and ast_dsp_getdigits APIs because these
are not used anyway but would made patch more complicated if kept.

====================================================================== 

---------------------------------------------------------------------- 
 dimas - 03-26-08 10:49  
---------------------------------------------------------------------- 
Updated the patch. Now it consists of two files:

 v2-11968-dsp.patch
 v4-11968-zap.patch

please ignore other files.

What is new;
1. DSP API extented a bit - ast_dsp_was_muted() function added which
returns true if DSP code was muting any fragment in the last frame.
chan_zap uses this function to decide it needs to turn on confmute on the
channel.

This is to replace AST_FRAME_DTMF 'm'/'u' (mute/unmute) functionality.

2. dsp.c now has two new defines:

/* How many successive hits needed to consider begin of a digit */
#define DTMF_HITS_TO_BEGIN      2
/* How many successive misses needed to consider end of a digit */
#define DTMF_MISSES_TO_END      3

These will allow people easily patch the code and have reliable DTMF
recognition in cases where signal is wobbling (like when GSM phone calls
in). Increasing DTMF_MISSES_TO_END to 4-6 will allow DSP code to ignore
long "dropouts" of DTMF within digit without ending it. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-26-08 10:49  dimas          Note Added: 0084583                          
======================================================================




More information about the asterisk-bugs mailing list