[asterisk-bugs] [Asterisk 0014491]: [patch] DTMF blips at end of recordings in __ast_play_and_record()

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Jul 15 06:27:49 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=14491 
====================================================================== 
Reported By:                asbestoshead
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14491
Category:                   Applications/General
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     new
Target Version:             1.6.0.12
Asterisk Version:           Older 1.6.0 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-02-17 10:39 CST
Last Modified:              2009-07-15 06:27 CDT
====================================================================== 
Summary:                    [patch] DTMF blips at end of recordings in
__ast_play_and_record()
Description: 
When using a channel with real in-band DTMF (e.g. Dahdi), voicemail
greetings and other recordings have remnants of the DTMF tone left at the
end. Usually it's about 5-15ms of DTMF before the Dahdi DTMF detector
kicked in, and sometimes there's an additional 5ms at the end of the tone.

The attached patch stops recording on button DOWN, not button UP; it also
trims the last 400ms from the recording in the case where it was terminated
by DTMF. I'm not 100% happy with this, but it seems to completely get rid
of noisy blips at the end of recordings a little over 50% (*) of the time,
and I haven't heard complaints about it truncating too much. I'm sort of
looking for feedback more than anything.

The patch is against 1.6.0-beta9, but it applies cleanly to 1.6.0.5.

(*) 24 out of 43 users who changed their greetings since I applied the
patch. Some of them might have retried if they heard the blip, but most
probably wouldn't notice. I didn't notice, until it was pointed out to me
-- and since then it's all I can hear :)
====================================================================== 

---------------------------------------------------------------------- 
 (0107774) dimas (reporter) - 2009-07-15 06:27
 https://issues.asterisk.org/view.php?id=14491#c107774 
---------------------------------------------------------------------- 
1. If you are checking for AST_FRAME_DTMF_BEGIN then the second check
should be for AST_FRAME_DTMF_END and not just AST_FRAME_DTMF. These are the
same values so nothing really changes. The idea is that old code uses
AST_FRAME_DTMF which is the end while newer code knows both begin and end.

2. Your comment says 5-25 ms but AFAIK ast_stream_rewind takes
milliseconds so you are trimming 400 ms.

3. Are you sure that long trim is really necessay? To my knowledge if you
are catching DTMF_BEGIN, then only very short blip ( < 20 ms ) of DTMF
signal will be in recorded audio. 

4. If you ae beaking by DTMF_BEGIN, you should be pepared that DTMF_END
will be received by another piece of code which is not good really. My
understanding of proper implementation is: you detect both BEGIN and END.
You take actions on END only. However BEGIN gives you point to cut your
recording to (-20ms) 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-07-15 06:27 dimas          Note Added: 0107774                          
======================================================================




More information about the asterisk-bugs mailing list