diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-24 20:36:19 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-02-24 20:36:19 +0000 |
commit | 6af5b89f060b5ccdfdc47ff1da72446b02106606 (patch) | |
tree | 442cb8884da2aa080df1f2a76eb93be7d27b1e74 | |
parent | 328bdebba68bd3235a77e80e90864345580f7857 (diff) |
Only set dtmfcount on BEGIN, and ensure it gets reset to 0 properly.
(issue #14460)
Reported by: moliveras
Tested by: russell
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@178373 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/rtp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/rtp.c b/main/rtp.c index 8ac8d832d..131e27d2e 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -745,6 +745,7 @@ static struct ast_frame *process_rfc2833(struct ast_rtp *rtp, unsigned char *dat 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; @@ -753,16 +754,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; - return f; } @@ -1332,7 +1333,6 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) rtp->f.delivery.tv_usec = 0; if (mark) rtp->f.subclass |= 0x1; - } rtp->f.src = "RTP"; return &rtp->f; |