]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 274164 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Tue, 6 Jul 2010 14:33:16 +0000 (14:33 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 6 Jul 2010 14:33:16 +0000 (14:33 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r274164 | mmichelson | 2010-07-06 09:31:13 -0500 (Tue, 06 Jul 2010) | 22 lines

  Merged revisions 274157 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r274157 | mmichelson | 2010-07-06 09:29:23 -0500 (Tue, 06 Jul 2010) | 16 lines

    Fix problem with RFC 2833 DTMF not being accepted.

    A recent check was added to ensure that we did not erroneously
    detect duplicate DTMF when we received packets out of order.
    The problem was that the check did not account for the fact that
    the seqno of an RTP stream will roll over back to 0 after hitting
    65535. Now, we have a secondary check that will ensure that the
    seqno rolling over will not cause us to stop accepting DTMF.

    (closes issue #17571)
    Reported by: mdeneen
    Patches:
          rtp_seqno_rollover.patch uploaded by mmichelson (license 60)
    Tested by: richardf, maxochoa, JJCinAZ
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@274168 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/rtp.c

index 6ac4fe7d8a1f33fab8dd79d3337368bddb7f2aea..424912202006ce267087fa366097b17e3aa582fc 100644 (file)
@@ -1072,8 +1072,11 @@ static void process_rfc2833(struct ast_rtp *rtp, unsigned char *data, int len, u
                if (last_duration > 64000 && samples < last_duration)
                        new_duration += 0xFFFF + 1;
                new_duration = (new_duration & ~0xFFFF) | samples;
-
-               if (rtp->lastevent > seqno) {
+               /* The second portion of this check is to not mistakenly
+                * stop accepting DTMF if the seqno rolls over beyond
+                * 65535.
+                */
+               if (rtp->lastevent > seqno && rtp->lastevent - seqno < 50) {
                        /* Out of order frame. Processing this can cause us to
                         * improperly duplicate incoming DTMF, so just drop
                         * this.