aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-16 17:30:39 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-16 17:30:39 +0000
commitb1629f7a5f34068f1a3efafc97359030faa18785 (patch)
treecb65252a4642c6b0a2b62b9a376b2da55a76ddb3 /main
parent8affd2f796189e1e97afc37b26d8fe37f5064a75 (diff)
Merged revisions 277247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r277247 | mnicholson | 2010-07-16 12:29:57 -0500 (Fri, 16 Jul 2010) | 4 lines For pass through DTMF tones, measure the actual duration between the begin and end packets on the wire. If it is detected to be less than AST_MIN_DTMF_DURATION, trigger dtmf emulation. AST-362 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@277250 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 94d7d2616..a80eeeec0 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3849,6 +3849,19 @@ 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(now, chan->dtmf_tv);
+
+ /* detect tones that were received on
+ * the wire with durations shorter than
+ * AST_MIN_DTMF_DURATION and set f->len
+ * to the actual duration of the DTMF
+ * frames on the wire. This will cause
+ * dtmf emulation to be triggered later
+ * on.
+ */
+ if (ast_tvdiff_ms(now, chan->dtmf_tv) < AST_MIN_DTMF_DURATION) {
+ f->len = ast_tvdiff_ms(now, chan->dtmf_tv);
+ ast_log(LOG_DTMF, "DTMF end '%c' detected to have actual duration %ld on the wire, emulation will be triggered on %s\n", f->subclass, f->len, chan->name);
+ }
} else if (!f->len) {
ast_log(LOG_DTMF, "DTMF end accepted without begin '%c' on %s\n", f->subclass.integer, chan->name);
f->len = AST_MIN_DTMF_DURATION;