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

SIP Transfer generates high CPU

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: None
    • Component/s: mod_sofia
    • Security Level: public
    • Labels:
      None
    • Environment:
      Debian/testing
    • CPU Architecture:
      x86-64
    • Kernel:
      Linux
    • Userland:
      GNU/Linux
    • Distribution:
      Debian
    • Distribution Version:
      Debian 7 wheezy
    • Compiler:
      gcc
    • FreeSWITCH GIT Revision:
      7884bee06a1089d97131017565c6efc58083d0f6
    • GIT Master Revision hash::
      7884bee06a1089d97131017565c6efc58083d0f6

      Description

      If I set ringback to

        tone_stream://%(300,10000,440);loops=-1

      then during a blind transfer FreeSwitch will

        [NOTICE] switch_ivr.c:2167 Transfer sofia/huge-play-sbc-egress/12@test.centrex.phone.kwaoo.net to inline[endless_playback:
      tone_stream://%(300,10000,440);loops=-1,park@refer]

      which then leads to

        EXECUTE sofia/huge-play-sbc-egress/12@test.centrex.phone.kwaoo.net endless_playback(tone_stream://%(300)

      (notice how the end of the `tone_stream` is missing) and then to

        [DEBUG] switch_ivr_play_say.c:1911 done playing file tone_stream://%(300

      repeatedly for as long as the call is ringing, because the `while` loop in endless_playback_function attempts to (unsuccesfully) execute the command, eventually leading to high CPU.

      The basic issue is that the parsing for the `inline` dialplan in mod_dptools.c uses the comma `,` as default delimiters, and strips the end of the tone_stream command when sending it to endless_playback.

      I'm opening the issues against mod_sofia because I believe the root cause of the problem to be the `endless_playback` command created at line 8681 of sofia.c, with limited control over how it is built.

      It could be useful for example that the separator be specified (apparently the inline dialplan allows for `m:!:` where `!` is the separator, see mod_dptools.c line 76, if I read it properly) and sofia.c could then say (for example)

        "endless_playback:m:!:%s!park"

      instead of

        "endless_playback:%s,park"

      (I'm using `!` as an exemple, a different separator might be a better solution.)

      Workaround: use `silence` or another string that does not contain a comma as your ringback tone.

        Attachments

          Activity

            People

            • Assignee:
              mikej Mike Jerris
              Reporter:
              stephalnet Stéphane Alnet
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: