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.
      1. freeswitch.log
        3.22 MB
        Stéphane Alnet

        Activity

        Hide
        stephalnet Stéphane Alnet added a comment - - edited
        I'm working on a PR to test this fully.
        Show
        stephalnet Stéphane Alnet added a comment - - edited I'm working on a PR to test this fully.
        Hide
        mikej Mike Jerris added a comment -
        any update on this?
        Show
        mikej Mike Jerris added a comment - any update on this?
        Hide
        stephalnet Stéphane Alnet added a comment -
        This is still on my list. I haven't been able / had time to rebuild FS to test my fix because of the libssl issues in Debian, which I'm working on in a separate Jira.
        Show
        stephalnet Stéphane Alnet added a comment - This is still on my list. I haven't been able / had time to rebuild FS to test my fix because of the libssl issues in Debian, which I'm working on in a separate Jira.
        Hide
        stephalnet Stéphane Alnet added a comment -
        OK, created PR https://freeswitch.org/stash/projects/FS/repos/freeswitch/pull-requests/1122/overview for this.

        Tested (master + FS-9785 (required for compilation) + FS-9776) and the fix works as expected; the `inline` dialplan properly parses

        ```
        2016-12-22 23:26:34.276189 [NOTICE] switch_ivr.c:2196 Transfer sofia/huge-play-sbc-ingress/336434827…@178.250.209.… to inline[m:":endless_playback:tone_stream://%(300,10000,440);loops=-1"park@transfer-162d2eb9-9bb5-4678-a849-dff13a59f42d]
        ```

        and executes

        ```
        EXECUTE sofia/huge-play-sbc-ingress/336434827…@178.250.209.… endless_playback(tone_stream://%(300,10000,440);loops=-1)
        ```

        However I noticed the `park` command is not executed, and thinking of it, I'm wondering whether it is needed after `endless_playback` (I guess `endless_playback` might fail and we need a fallback situation?).

        I guess the only item that might be left open to discussion is whether the double-quote is the best separator in this patch.
        Show
        stephalnet Stéphane Alnet added a comment - OK, created PR https://freeswitch.org/stash/projects/FS/repos/freeswitch/pull-requests/1122/overview for this. Tested (master + FS-9785 (required for compilation) + FS-9776 ) and the fix works as expected; the `inline` dialplan properly parses ``` 2016-12-22 23:26:34.276189 [NOTICE] switch_ivr.c:2196 Transfer sofia/huge-play-sbc-ingress/336434827…@178.250.209.… to inline[m:":endless_playback:tone_ stream://%(300,10000,440);loops=-1 " park@transfer-162d2eb9-9bb5-4678-a849-dff13a59f42d ] ``` and executes ``` EXECUTE sofia/huge-play-sbc-ingress/336434827…@178.250.209.… endless_playback(tone_ stream://%(300,10000,440);loops=-1) ``` However I noticed the `park` command is not executed, and thinking of it, I'm wondering whether it is needed after `endless_playback` (I guess `endless_playback` might fail and we need a fallback situation?). I guess the only item that might be left open to discussion is whether the double-quote is the best separator in this patch.
        Hide
        brian Brian West added a comment -
        I reviewed and " makes sense there just in case ! is used in teletone, I fixed both locations.

        Thanks,

        /b
        Show
        brian Brian West added a comment - I reviewed and " makes sense there just in case ! is used in teletone, I fixed both locations. Thanks, /b

          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:

              Development