Bug#533532: DTMF tones double detection
Tzafrir Cohen
tzafrir.cohen at xorcom.com
Thu Jun 18 14:07:22 UTC 2009
On Thu, Jun 18, 2009 at 02:18:40PM +0200, Joerg Dorchain wrote:
> I am affected by a DTMF detection bug decribed here
> https://issues.asterisk.org/view.php?id=13209.
For the record, that patch is attached. Tested to apply. Not even tested
to build.
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
-------------- next part --------------
commit 99a6a04e5f28de54bb8aec8ef593ccbc9a55905e
Author: file <file at f38db490-d61c-443f-a65b-d21fe96a405b>
Date: Tue Dec 9 19:47:07 2008 +0000
Make sure that the timestamp for DTMF is not the same as the previous voice frame and do not send audio when transmitting DTMF as this confuses some equipment.
(closes issue #13209)
Reported by: ip-rob
Patches:
13209.diff uploaded by file (license 11)
Tested by: ip-rob, bujones
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162204 f38db490-d61c-443f-a65b-d21fe96a405b
diff --git a/main/rtp.c b/main/rtp.c
index 2cdfeed..c11d4ce 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -2215,6 +2215,7 @@ int ast_rtp_senddigit_begin(struct ast_rtp *rtp, char digit)
rtp->dtmfmute = ast_tvadd(ast_tvnow(), ast_tv(0, 500000));
rtp->send_duration = 160;
+ rtp->lastdigitts = rtp->lastts + rtp->send_duration;
/* Get a pointer to the header */
rtpheader = (unsigned int *)data;
@@ -2334,10 +2335,9 @@ int ast_rtp_senddigit_end(struct ast_rtp *rtp, char digit)
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
}
+ rtp->lastts += rtp->send_duration;
rtp->sending_digit = 0;
rtp->send_digit = 0;
- /* Increment lastdigitts */
- rtp->lastdigitts += 960;
rtp->seqno++;
return res;
@@ -2621,6 +2621,10 @@ static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec
int pred;
int mark = 0;
+ if (rtp->sending_digit) {
+ return 0;
+ }
+
ms = calc_txstamp(rtp, &f->delivery);
/* Default prediction */
if (f->frametype == AST_FRAME_VOICE) {
More information about the Pkg-voip-maintainers
mailing list