Uploaded image for project: 'FreeSWITCH'
  1. FreeSWITCH
  2. FS-7578

Telephone-event codec clock-rate mismatch (leads to DTMF issue)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.18, 1.4.19, 1.4.20
    • Fix Version/s: 1.6
    • Component/s: freeswitch-core
    • Security Level: public
    • Labels:
      None
    • Environment:
      Linux
    • CPU Architecture:
      x86-64
    • Kernel:
      Linux
    • Userland:
      GNU/Linux
    • Distribution:
      CentOS
    • Distribution Version:
      CentOS Based (3.x kernel)
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      9eb887af478eb7615cfbb1f43055e5c1b73ee9ef
    • GIT Master Revision hash::
      9eb887af478eb7615cfbb1f43055e5c1b73ee9ef

      Description

      Telephone-event codec is used to send/receive DTMF.

      Telephone-event codec clock rate should be the clock rate of the audio codec.

      But when FS receives SDP as follows:

      m=audio 7090 RTP/AVP 96 97 98 99 100 102 103 0 8 104 101 105 106 107 108
      [...]
      a=rtpmap:101 telephone-event/48000
      a=rtpmap:105 telephone-event/16000
      a=rtpmap:106 telephone-event/24000
      a=rtpmap:107 telephone-event/12000
      a=rtpmap:108 telephone-event/8000

      FS replies as follows:
      a=rtpmap:101 telephone-event/8000

      The remote client will see that FS is changing the clock-rate of the 101 payload from 48000 to 8000 .

      RFC4733 states ( https://tools.ietf.org/html/rfc4733#section-2.1 ) :

      "Named telephone events are carried as part of the audio stream and
      MUST use the same sequence number and timestamp base as the regular
      audio channel to simplify the generation of audio waveforms at a
      gateway"

      For example, for Opus, the RTP clock rate is at 48000 , but the telephone-event clock rate offered by FS is 8000, so DTMF on RFC compliant clients would not work (sending telephone-event/8000 over a 48000 Hz audio stream is prohibited).

      This situation is becoming more common, as Opus is becoming used more and more.

      This patch addresses the issue,replacing the hardcoded clock rate (8000) with the clock rate of the offered audio codec..
      Pull request here :
      https://freeswitch.org/stash/projects/FS/repos/freeswitch/pull-requests/258/overview

      Tested with <param name="inbound-codec-negotiation" value="greedy"/>

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        New New Needs Review Needs Review
        5d 22h 24m 1 Brian West 01/Jun/15 9:55 AM
        Needs Review Needs Review Resolved Resolved
        32d 8h 37m 1 Mike Jerris 03/Jul/15 6:32 PM

          People

          • Assignee:
            anthm Anthony Minessale II
            Reporter:
            dragos_oancea Dragos Oancea
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development