Uploaded image for project: 'FreePBX'
  1. FreePBX
  2. FREEPBX-5687

call waiting indication to caller in cases that the dialed extension is in use or busy

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.10, 2.11
    • Fix Version/s: None
    • Component/s: Follow Me
    • Labels:
    • Target Release:

      Description

      Hello,

      I would like to offer a feature request that will indicate a call waiting tone to the caller in cases when the dialed extension is in use or busy.

      instead of this line in macro-dial-one:

      exten => s,n(godial),Dial(${DSTRING},${ARG1},${D_OPTIONS})
      

      you can replace this line with this code sample:

      exten => s,n(godial),GotoIf($["${EXTENSION_STATE(${DEXTEN})}"="UNAVAILABLE" | "${EXTENSION_STATE(${DEXTEN})}"="NOT_INUSE" | "${EXTENSION_STATE(${DEXTEN})}"="UNKNOWN"]?dial:dialbusy)
      exten => s,n(dialbusy),GotoIf($["${EXTENSION_STATE(${DEXTEN})}" = "BUSY"]?dialcallwaiting)
      exten => s,n(dialcallwaiting),Dial(${DSTRING},${ARG1},r(callwaiting))
      exten => s,n(dial),Dial(${DSTRING},${ARG1},${D_OPTIONS})
      

      There is still a problem with the dialparties.agi. When ever an extension has a followme (that uses the dialparties.agi), this change will not take effect.

      Moshe, can you please take a look at that and add a fix to all the dial macros (including the dialparties.agi)? all you need to add when the extension state's in-use or busy is to add the call waiting indication (it will take is from indications.conf).

      this is the syntax to add a tone to the r option in the Dial application:

      Dial(${DSTRING},${ARG1},r(callwaiting))
      

      Maybe you can add an option in the general settings page to let the users choose if they want to play a call waiting tone when the extension is in-use or busy.

      Thank you,

      Daniel Friedman
      Trixton

      Tel: 972.72.2557000
      Mobile: 972.50.6655579

      Email: dani@3xton.com

      1. extinuse.wav
        47 kB
        davidlmansfield

        Activity

        Hide
        danielf danielf added a comment -

        Hi guys,

        Thank you for starting to show an interest in my suggestion for call waiting indications. I have corrected the typo as David has noticed. The code had worked even before but just to be on the safe side. Just take in mind it is only a suggestion and not a full integration.

        //Original Line Code
        //      $ext->add($mcontext,$exten,'godial', new ext_dial('${DSTRING}', '${ARG1},${D_OPTIONS}'));
        //Originel Line Code - End
         
        //Daniel Friedman Change for adding call waiting indication
         
            $ext->add($mcontext,$exten,'godial', new ext_gotoif('$["${EXTENSION_STATE(${DEXTEN})}"="INUSE"]','dialcwbusy:dialnocw'));
        	$ext->add($mcontext,$exten,'dialcwbusy', new ext_set('D_OPTIONS','wWr(callwaiting)'));
            $ext->add($mcontext,$exten,'', new ext_dial('${DSTRING}', '${ARG1},${D_OPTIONS}'));
        	$ext->add($mcontext,$exten,'dialnocw', new ext_set('D_OPTIONS', '${ARG1},${D_OPTIONS}'));
        	$ext->add($mcontext,$exten,'', new ext_dial('${DSTRING}', '${ARG1},${D_OPTIONS}'));
         
        //Daniel Friedman End
        

        David, just to answer your questions:
        1.
        I am replacing the dialing options only when the device is in use because I did not wanted to implement the code fully. It has written just to solve a problem. It seems back then a nice and clean solution.

        2.
        I am using the call indications tones that are located in indications.conf. If you want to use this tones you need to write it after the 'r' option like that: r(INDICATION_TONE) to get it played as the ring back tone. I am changing the ringback tone only in an IN_USE state of the device. If the device in in any other state is just falls back to the regular dial plan of the freepbx.

        3.
        Regarding the CONNECTEDLINE updates, I will need to check that more, but as I have mentioned before it is not a full integration in the dial plan. I hope that Andrew would implement this feature in the framework.

        Thank you,

        Daniel Friedman
        Trixton LTD.

        Mobile: 972.50.6655579
        Email: dani@3xton.com

        Show
        danielf danielf added a comment - Hi guys, Thank you for starting to show an interest in my suggestion for call waiting indications. I have corrected the typo as David has noticed. The code had worked even before but just to be on the safe side. Just take in mind it is only a suggestion and not a full integration. //Original Line Code // $ext->add($mcontext,$exten,'godial', new ext_dial('${DSTRING}', '${ARG1},${D_OPTIONS}')); //Originel Line Code - End   //Daniel Friedman Change for adding call waiting indication   $ext->add($mcontext,$exten,'godial', new ext_gotoif('$["${EXTENSION_STATE(${DEXTEN})}"="INUSE"]','dialcwbusy:dialnocw')); $ext->add($mcontext,$exten,'dialcwbusy', new ext_set('D_OPTIONS','wWr(callwaiting)')); $ext->add($mcontext,$exten,'', new ext_dial('${DSTRING}', '${ARG1},${D_OPTIONS}')); $ext->add($mcontext,$exten,'dialnocw', new ext_set('D_OPTIONS', '${ARG1},${D_OPTIONS}')); $ext->add($mcontext,$exten,'', new ext_dial('${DSTRING}', '${ARG1},${D_OPTIONS}'));   //Daniel Friedman End David, just to answer your questions: 1. I am replacing the dialing options only when the device is in use because I did not wanted to implement the code fully. It has written just to solve a problem. It seems back then a nice and clean solution. 2. I am using the call indications tones that are located in indications.conf. If you want to use this tones you need to write it after the 'r' option like that: r(INDICATION_TONE) to get it played as the ring back tone. I am changing the ringback tone only in an IN_USE state of the device. If the device in in any other state is just falls back to the regular dial plan of the freepbx. 3. Regarding the CONNECTEDLINE updates, I will need to check that more, but as I have mentioned before it is not a full integration in the dial plan. I hope that Andrew would implement this feature in the framework. Thank you, Daniel Friedman Trixton LTD. Mobile: 972.50.6655579 Email: dani@3xton.com
        Hide
        davidlmansfield davidlmansfield added a comment -

        For CONNECTEDLINE, I don't think there's anything wrong with the implementation that I can see, it seems either an asterisk or polycom thing. I tweaked the way the dialplan would be generated about 20 times trying to get it working, and anytime either r(callwaiting) or m(something) (which plays music-on-hold while ringing) is used, the CONNECTEDLINE stops working.

        I prefer a "broken ring tone" to a call waiting, so I had generated a sound file, assigned it to a new MOH class, "extinuse" and used m(extinuse). Same effect as your implementation - a bit more work though. Only difference for implementation is m(extinuse) instead of r(callwaiting).

        Show
        davidlmansfield davidlmansfield added a comment - For CONNECTEDLINE, I don't think there's anything wrong with the implementation that I can see, it seems either an asterisk or polycom thing. I tweaked the way the dialplan would be generated about 20 times trying to get it working, and anytime either r(callwaiting) or m(something) (which plays music-on-hold while ringing) is used, the CONNECTEDLINE stops working. I prefer a "broken ring tone" to a call waiting, so I had generated a sound file, assigned it to a new MOH class, "extinuse" and used m(extinuse). Same effect as your implementation - a bit more work though. Only difference for implementation is m(extinuse) instead of r(callwaiting).
        Hide
        davidlmansfield davidlmansfield added a comment -

        The sound file I play when the extension is in use. It's a "broken" ring tone.

        Show
        davidlmansfield davidlmansfield added a comment - The sound file I play when the extension is in use. It's a "broken" ring tone.
        Hide
        Offer Offer added a comment -

        Hello!

        I just want to add - if Daniel's 'tweak' to the dialplan will be included in the standard release - it will be a lot of help for many of us - which have to change the file each time after each major upgrade to the system.

        Also, there is an option to add to the GUI to enable or disable the call-waiting special ringtone.

        Thanks!

        Show
        Offer Offer added a comment - Hello! I just want to add - if Daniel's 'tweak' to the dialplan will be included in the standard release - it will be a lot of help for many of us - which have to change the file each time after each major upgrade to the system. Also, there is an option to add to the GUI to enable or disable the call-waiting special ringtone. Thanks!
        Hide
        Offer Offer added a comment -

        Another update -

        It seems something in the 3 lines that should be edited for Daniel's fix is changed in Asterisk 13.

        If someone can please review this and write the correct change for this version - it would be really helpful for many users.

        Thanks!

        Show
        Offer Offer added a comment - Another update - It seems something in the 3 lines that should be edited for Daniel's fix is changed in Asterisk 13. If someone can please review this and write the correct change for this version - it would be really helpful for many users. Thanks!

          People

          • Assignee:
            tm1000 Andrew Nagy
            Reporter:
            danielf danielf
          • Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:

              Development