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 Improvement
    • Status: Open (View Workflow)
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.10, 2.11
    • Fix Version/s: None
    • Component/s: Follow Me
    • Labels:
    • Target Release:
    • Backend Engine:
      Asterisk 1.8
    • Confirmation:
      Unreviewed
    • ToDo:

      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
        davidlmansfield added a comment -

        I just hacked this in - and it works fine. I think it's a great idea - everyone at my office complains about this, and had even hacked it into dialparties.agi once (back when it was used in the "dial one" case, too), but it was unmaintainable.

        But now that we have CONNECTEDLINE stuff, I think it would alse be nice to show on the "screen" of the callers phone that the called line is busy.

        Any idea how hard that would be to add?

        Show
        davidlmansfield added a comment - I just hacked this in - and it works fine. I think it's a great idea - everyone at my office complains about this, and had even hacked it into dialparties.agi once (back when it was used in the "dial one" case, too), but it was unmaintainable. But now that we have CONNECTEDLINE stuff, I think it would alse be nice to show on the "screen" of the callers phone that the called line is busy. Any idea how hard that would be to add?
        Hide
        davidlmansfield added a comment -

        A few issues with the actual code above that modifies modules/core/functions.inc.php:

        1) The code
        new ext_gotoif('$["${EXTENSION_STATE(${DEXTEN}}"="INUSE"]','dialcwbusy:dialnocw'));
        Is missing a closing parenthesis after $

        {DEXTEN}

        2) The code replaces D_OPTIONS instead of appending - however one of the existing options is the 'r', and we would be appending r(callwaiting). Not sure what happens if the same options appear many times.

        3) It seems like setting a custom ringback i.e. 'r(callwaiting)' seems to prevent proper CONNECTEDLINE updates - at least for me on asterisk 11.13.0 with polycom phones.

        Show
        davidlmansfield added a comment - A few issues with the actual code above that modifies modules/core/functions.inc.php: 1) The code new ext_gotoif('$ ["${EXTENSION_STATE(${DEXTEN}}"="INUSE"] ','dialcwbusy:dialnocw')); Is missing a closing parenthesis after $ {DEXTEN} 2) The code replaces D_OPTIONS instead of appending - however one of the existing options is the 'r', and we would be appending r(callwaiting). Not sure what happens if the same options appear many times. 3) It seems like setting a custom ringback i.e. 'r(callwaiting)' seems to prevent proper CONNECTEDLINE updates - at least for me on asterisk 11.13.0 with polycom phones.
        Hide
        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 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 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 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 added a comment -

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

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

          People

          • Assignee:
            Andrew Nagy
            Reporter:
            danielf
          • Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:

              Development