]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
detect sequence number rollover (bug #2887)
authorRussell Bryant <russell@russellbryant.com>
Thu, 18 Nov 2004 04:03:10 +0000 (04:03 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 18 Nov 2004 04:03:10 +0000 (04:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4286 65c4cc65-6c06-0410-ace0-fbb531ad65f3

rtp.c

diff --git a/rtp.c b/rtp.c
index dbe67a2401d303926b77c710a11f0e13a8e25392..bf122ff7b66f28a5614599d03cabb414021d9f05 100755 (executable)
--- a/rtp.c
+++ b/rtp.c
@@ -469,14 +469,14 @@ 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 */
-           if (rtp->lasteventseqn <= seqno) {
+           if (rtp->lasteventseqn <= seqno || rtp->resp == 0 || (rtp->lasteventseqn >= 65530 && seqno <= 6)) {
              f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
              rtp->lasteventseqn = seqno;
            } else f = NULL;
            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 */
-           if (rtp->lasteventseqn <= seqno) {
+           if (rtp->lasteventseqn <= seqno || rtp->resp == 0 || (rtp->lasteventseqn >= 65530 && seqno <= 6)) {
              f = process_cisco_dtmf(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
              rtp->lasteventseqn = seqno;
            } else f = NULL;