aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-11 23:56:37 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-11 23:56:37 +0000
commit8daf379eefe5160344b913fb1a844e6260d69173 (patch)
treedea5bc99f5180b90f051b4d07d9936038338fe29 /main/rtp.c
parentc8dda30fa05cb3f3fa319191565e38e665b80753 (diff)
Fixify infinite DTMF in the case that no RFC2833 END event is ever received
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@174985 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 5165ade83..c917e70b4 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1299,6 +1299,18 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
/* Record received timestamp as last received now */
rtp->lastrxts = timestamp;
+ if (rtp->dtmfcount) {
+ rtp->dtmfcount -= (timestamp - rtp->lastrxts);
+
+ if (rtp->dtmfcount < 0) {
+ rtp->dtmfcount = 0;
+ }
+
+ if (rtp->resp && !rtp->dtmfcount) {
+ return send_dtmf(rtp, AST_FRAME_DTMF_END);
+ }
+ }
+
rtp->f.mallocd = 0;
rtp->f.datalen = res - hdrlen;
rtp->f.data = rtp->rawdata + hdrlen + AST_FRIENDLY_OFFSET;