aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-31 21:00:16 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-31 21:00:16 +0000
commit43c75db33e757e08cdec37b1713a0e275d9a039b (patch)
treed86d2423fc3d84c96124fde6e1cfbeb65c4e6903 /main
parent1d4845cffdac2efd5eb2367895f04e35031cb45d (diff)
Tweak the DTMF muting stuff a bit to take into account VLDTMF and compensation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41632 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/rtp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 619acc347..b62ed1480 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -545,7 +545,8 @@ void ast_rtp_setdtmfcompensate(struct ast_rtp *rtp, int compensate)
static struct ast_frame *send_dtmf(struct ast_rtp *rtp, enum ast_frame_type type)
{
- if (ast_tvcmp(ast_tvnow(), rtp->dtmfmute) < 0) {
+ if (((ast_test_flag(rtp, FLAG_DTMF_COMPENSATE) && type == AST_FRAME_DTMF_END) ||
+ (type == AST_FRAME_DTMF_BEGIN)) && ast_tvcmp(ast_tvnow(), rtp->dtmfmute) < 0) {
if (option_debug)
ast_log(LOG_DEBUG, "Ignore potential DTMF echo from '%s'\n", ast_inet_ntoa(rtp->them.sin_addr));
rtp->resp = 0;
@@ -2078,6 +2079,8 @@ int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit)
if (digit_convert(digit))
return -1;
+ rtp->dtmfmute = ast_tvadd(ast_tvnow(), ast_tv(0, 500000));
+
rtpheader = (unsigned int *)data;
rtpheader[0] = htonl((2 << 30) | (1 << 23) | (rtp->send_payload << 16) | (rtp->seqno));
rtpheader[1] = htonl(rtp->lastdigitts);