aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 782642969..54f3a85ff 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1038,10 +1038,11 @@ static struct ast_frame *process_rfc2833(struct ast_rtp *rtp, unsigned char *dat
ast_log(LOG_DEBUG, "Ignoring RTP 2833 Event: %08x. Not a DTMF Digit.\n", event);
return &ast_null_frame;
}
-
+
if (ast_test_flag(rtp, FLAG_DTMF_COMPENSATE)) {
if ((rtp->lastevent != timestamp) || (rtp->resp && rtp->resp != resp)) {
rtp->resp = resp;
+ rtp->dtmfcount = 0;
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
f->len = 0;
rtp->lastevent = timestamp;
@@ -1050,15 +1051,16 @@ static struct ast_frame *process_rfc2833(struct ast_rtp *rtp, unsigned char *dat
if ((!(rtp->resp) && (!(event_end & 0x80))) || (rtp->resp && rtp->resp != resp)) {
rtp->resp = resp;
f = send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
+ rtp->dtmfcount = dtmftimeout;
} else if ((event_end & 0x80) && (rtp->lastevent != seqno) && rtp->resp) {
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
f->len = ast_tvdiff_ms(ast_samp2tv(samples, 8000), ast_tv(0, 0)); /* XXX hard coded 8kHz */
rtp->resp = 0;
+ rtp->dtmfcount = 0;
rtp->lastevent = seqno;
}
}
- rtp->dtmfcount = dtmftimeout;
rtp->dtmfsamples = samples;
return f;