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

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Jul 25 14:44:17 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=14491 
====================================================================== 
Reported By:                asbestoshead
Assigned To:                jpeeler
====================================================================== 
Project:                    Asterisk
Issue ID:                   14491
Category:                   Applications/General
Reproducibility:            always
Severity:                   tweak
Priority:                   normal
Status:                     assigned
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-25 14:44 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 :)
====================================================================== 

---------------------------------------------------------------------- 
 (0108226) dimas (reporter) - 2009-07-25 14:44
 https://issues.asterisk.org/view.php?id=14491#c108226 
---------------------------------------------------------------------- 
cutting 400 ms always seems to me a wrong thing.
This is because lots of phones produce very long beep as lonf as you hold
the button. From the other hand, BEGIN frame always give you information
where the DTMF actually started and where you should cut. To my knowledge
the facts are:

1. When DTMFs are cocming from DAHDI channel, the BEGIN frame should be
received no latter than 20 ms of the moment the DTMF actually started. 
(you may assume 50 ms for weak signal and button click).

2. DAHDI driver itself suppresses the DTNF tone from recorded signal
(except for the first 20 ms). So in the case of proper operations, you will
get 0-20ms  DTMF audio, then DTMF BEGIN frame then silence for the duration
on DTMF and then DTMF end frame. So again, the right thing is to cut at the
moment you've got BEGIN - 20-50ms.

3. In the case of SIP and RFC2833 DTMF there is no DTMF audio already in
thee stream - you will probably be recording silence between BEGIN and END
frames so the approach above should work fine too.

4. In the case of SIP and INFO DTMF, you will be receiving DTMF END frame
only (probably preceeded by silence). So ideal approach would be to just
cut silence at the end.


Just my thoughts. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-07-25 14:44 dimas          Note Added: 0108226                          
======================================================================




More information about the asterisk-bugs mailing list