aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-23 17:57:32 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-23 17:57:32 +0000
commitb109c0a8098a6cd47d17d3ce734acbdae6373381 (patch)
tree5e1d3ea7f8561de7809c58ba2618c42cf212a535
parent0a45ece39a7769af8800b7759b6a865ef5dce406 (diff)
Ensure that digits passing through Asterisk have a reasonable minimum length.
It is currently 100 ms. If someone thinks this should be different, feel free to speak up. (related to issues #8944, #9250, and #9348) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61763 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/channel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 4f0b58536..f0215851b 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2268,7 +2268,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
ast_set_flag(chan, AST_FLAG_EMULATE_DTMF);
chan->emulate_dtmf_digit = f->subclass;
chan->dtmf_begin_tv = ast_tvnow();
- if (f->len)
+ if (f->len && f->len > AST_DEFAULT_EMULATE_DTMF_DURATION)
chan->emulate_dtmf_duration = f->len;
else
chan->emulate_dtmf_duration = AST_DEFAULT_EMULATE_DTMF_DURATION;
@@ -2276,6 +2276,12 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
ast_clear_flag(chan, AST_FLAG_IN_DTMF);
if (!f->len)
f->len = ast_tvdiff_ms(ast_tvnow(), chan->dtmf_begin_tv);
+ if (f->len < AST_DEFAULT_EMULATE_DTMF_DURATION) {
+ ast_set_flag(chan, AST_FLAG_EMULATE_DTMF);
+ chan->emulate_dtmf_digit = f->subclass;
+ chan->emulate_dtmf_duration = AST_DEFAULT_EMULATE_DTMF_DURATION - f->len;
+ f = &ast_null_frame;
+ }
}
break;
case AST_FRAME_DTMF_BEGIN: