mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Merged revisions 178373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r178373 | russell | 2009-02-24 14:36:19 -0600 (Tue, 24 Feb 2009) | 6 lines Only set dtmfcount on BEGIN, and ensure it gets reset to 0 properly. (issue #14460) Reported by: moliveras Tested by: russell ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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);
|
ast_log(LOG_DEBUG, "Ignoring RTP 2833 Event: %08x. Not a DTMF Digit.\n", event);
|
||||||
return &ast_null_frame;
|
return &ast_null_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast_test_flag(rtp, FLAG_DTMF_COMPENSATE)) {
|
if (ast_test_flag(rtp, FLAG_DTMF_COMPENSATE)) {
|
||||||
if ((rtp->lastevent != timestamp) || (rtp->resp && rtp->resp != resp)) {
|
if ((rtp->lastevent != timestamp) || (rtp->resp && rtp->resp != resp)) {
|
||||||
rtp->resp = resp;
|
rtp->resp = resp;
|
||||||
|
rtp->dtmfcount = 0;
|
||||||
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
|
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
|
||||||
f->len = 0;
|
f->len = 0;
|
||||||
rtp->lastevent = timestamp;
|
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)) {
|
if ((!(rtp->resp) && (!(event_end & 0x80))) || (rtp->resp && rtp->resp != resp)) {
|
||||||
rtp->resp = resp;
|
rtp->resp = resp;
|
||||||
f = send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
|
f = send_dtmf(rtp, AST_FRAME_DTMF_BEGIN);
|
||||||
|
rtp->dtmfcount = dtmftimeout;
|
||||||
} else if ((event_end & 0x80) && (rtp->lastevent != seqno) && rtp->resp) {
|
} else if ((event_end & 0x80) && (rtp->lastevent != seqno) && rtp->resp) {
|
||||||
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
|
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 */
|
f->len = ast_tvdiff_ms(ast_samp2tv(samples, 8000), ast_tv(0, 0)); /* XXX hard coded 8kHz */
|
||||||
rtp->resp = 0;
|
rtp->resp = 0;
|
||||||
|
rtp->dtmfcount = 0;
|
||||||
rtp->lastevent = seqno;
|
rtp->lastevent = seqno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtp->dtmfcount = dtmftimeout;
|
|
||||||
rtp->dtmfsamples = samples;
|
rtp->dtmfsamples = samples;
|
||||||
|
|
||||||
return f;
|
return f;
|
||||||
|
Reference in New Issue
Block a user