diff options
-rw-r--r-- | main/rtp.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c index 14b961977..a39fc10f2 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -1749,6 +1749,21 @@ 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) { + struct ast_frame *f; + f = send_dtmf(rtp, AST_FRAME_DTMF_END); + rtp->resp = 0; + return f; + } + } + rtp->f.mallocd = 0; rtp->f.datalen = res - hdrlen; rtp->f.data.ptr = rtp->rawdata + hdrlen + AST_FRIENDLY_OFFSET; |