mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 06:48:25 +00:00
truncate last 200ms of DTMF-terminated recording to eliminate inband DTMF (issue #5383)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -962,7 +962,11 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
|
|||||||
switch(f->frametype) {
|
switch(f->frametype) {
|
||||||
case AST_FRAME_DTMF:
|
case AST_FRAME_DTMF:
|
||||||
if (strchr(argv[4], f->subclass)) {
|
if (strchr(argv[4], f->subclass)) {
|
||||||
/* This is an interrupting chracter */
|
/* This is an interrupting chracter, so rewind to chop off any small
|
||||||
|
amount of DTMF that may have been recorded
|
||||||
|
*/
|
||||||
|
ast_stream_rewind(fs, 200);
|
||||||
|
ast_truncstream(fs);
|
||||||
sample_offset = ast_tellstream(fs);
|
sample_offset = ast_tellstream(fs);
|
||||||
fdprintf(agi->fd, "200 result=%d (dtmf) endpos=%ld\n", f->subclass, sample_offset);
|
fdprintf(agi->fd, "200 result=%d (dtmf) endpos=%ld\n", f->subclass, sample_offset);
|
||||||
ast_closestream(fs);
|
ast_closestream(fs);
|
||||||
|
|||||||
Reference in New Issue
Block a user