summaryrefslogtreecommitdiff
path: root/rtp.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-05-05 03:56:27 +0000
committerMark Spencer <markster@digium.com>2004-05-05 03:56:27 +0000
commit6f3dd86f22ca5e4f65e1e2db4cc1ae79465ffbf7 (patch)
tree50bedd46c02b92d57cdb75d22cc0d8fac61ac493 /rtp.c
parentcc1da2eb5b0c0c54e8df70391ad839fbb0f9ab28 (diff)
Ignore dupe packets for RFC2833 (bug #1034)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/rtp.c b/rtp.c
index 14a2f9825..b88274457 100755
--- a/rtp.c
+++ b/rtp.c
@@ -43,7 +43,7 @@
#define TYPE_DONTSEND 0x3
#define TYPE_MASK 0x3
-static int dtmftimeout = 300; /* 300 samples */
+static int dtmftimeout = 3000; /* 3000 samples */
static int rtpstart = 0;
static int rtpend = 0;
@@ -68,6 +68,7 @@ struct ast_rtp {
unsigned int lastrxts;
unsigned int lastividtimestamp;
unsigned int lastovidtimestamp;
+ unsigned int lasteventseqn;
int lasttxformat;
int lastrxformat;
int dtmfcount;
@@ -449,11 +450,17 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
// This is special in-band data that's not one of our codecs
if (rtpPT.code == AST_RTP_DTMF) {
/* It's special -- rfc2833 process it */
- f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
+ if (rtp->lasteventseqn <= seqno) {
+ f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
+ rtp->lasteventseqn = seqno;
+ }
if (f) return f; else return &null_frame;
} else if (rtpPT.code == AST_RTP_CISCO_DTMF) {
/* It's really special -- process it the Cisco way */
- f = process_cisco_dtmf(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
+ if (rtp->lasteventseqn <= seqno) {
+ f = process_cisco_dtmf(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
+ rtp->lasteventseqn = seqno;
+ }
if (f) return f; else return &null_frame;
} else if (rtpPT.code == AST_RTP_CN) {
/* Comfort Noise */