Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Enable/Disable diverts programatically

Discussion in '3CX Phone System - General' started by jamesdawson, Jan 30, 2014.

Thread Status:
Not open for further replies.
  1. jamesdawson

    Joined:
    Jan 30, 2014
    Messages:
    21
    Likes Received:
    0
    Hi, we're looking at 3cx as an alternative to our current provider. I've looked at the VAD and it lokos like we can achieve all our needs for call flows, DB integration, etc, which is great.

    We have one other requirement which is a must. At 5pm, we divert 3 specific extensions to a 3rd party for out of hours support. We are currently able to turn the diverts on and off programmatically and have been able to do some clever stuff to allow this from our yealink phones via the XML browser and some web services.

    my questions are:
    1) can we programmatically enable/disable diverts for specific extensions?
    2) if so how would this be achieved?

    an ideal solution for us would be able to enable/disabled the diverts via .net code, compile this to a DLL and then be able to execute it by calling an extension, or using the XML browser function of the phone and calling it via a web service.

    thanks

    james
     
  2. GManNAtl

    Joined:
    Sep 13, 2012
    Messages:
    58
    Likes Received:
    0
    It's not even that complicated. Each extension can be assigned it's own office hours. You can then use the Presence modes for the extension to change automatically based on the schedule. Then simply change the forwarding for the "Out of Office" mode.
     
  3. jamesdawson

    Joined:
    Jan 30, 2014
    Messages:
    21
    Likes Received:
    0
    thanks for the reply. We want to do this toggling manually (the people in charge need to confirm the hand over to an external party).

    I think we've got it working roughly as you suggested is this how you would approach this:

    Code:
         public void Getqs(Boolean SetOOHOn, string ext)
            {
                PhoneSystem ps = PhoneSystem.Root;
                foreach (Queue aq in ps.GetQueues())
                {
                    if (ext == aq.Number)
                    {
                        if (SetOOHOn == false)
                        {
                            //none answered calls go to voicemail after 30 seconds
                            aq.ForwardNoAnswer.To = DestinationType.VoiceMail;
                            aq.ForwardNoAnswer.External = "";
                            aq.RingTimeout = 30;
                        }
                        else
                        {
                            //none answered calls go to external number after 1 second (ie immediatly)
                            aq.ForwardNoAnswer.To = DestinationType.External;
                            aq.ForwardNoAnswer.External = "01978858300";
                            aq.RingTimeout = 1;
                        }
                        aq.Save();
                    }
                }           
            }
     
  4. bardissi

    bardissi Member

    Joined:
    Jan 31, 2012
    Messages:
    318
    Likes Received:
    0
    Why dont you just setup the OUT OF OFFICE Status to forward to the outside number.

    When those extensions are ready to go home for the day go to the 3CX Phone and change your status from Available to Out of Office via the drop down.

    Solved!
     
  5. jamesdawson

    Joined:
    Jan 30, 2014
    Messages:
    21
    Likes Received:
    0
    its a queue not an extension , plus the users only have phones, so there is no drop down to select :)

    thanks anyway for the pointer.
     
  6. bardissi

    bardissi Member

    Joined:
    Jan 31, 2012
    Messages:
    318
    Likes Received:
    0
    Ok I didnt get that from the string before.

    You could have the Destination if No Answer settings on the queue go to a virtual extension and still follow the same rules that I mentioned before with available and out of office.

    Then you could have someone from their phone dial 999 and then that extension and pin and then use option 9 to change the extension status.
     
  7. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    When call is coming to PBX from external source, it comes to inbound rule.
    Inbound rule can be configured to forward calls to different destinations during "in-office" and "out-of-office" hours
    So, you need to just configure in-office/out-of-office destination of the inbound rule. "in-office" - set to queue, "out-of-office" set to any other destination. It will work automatically and you will not need to make it through API.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. jamesdawson

    Joined:
    Jan 30, 2014
    Messages:
    21
    Likes Received:
    0
    Thanks for the reply Stephen. It's great that there is lots of flexibility so this can be set at different points to meet different needs.

    We do however do not want this to be automatic. We need to do a full handover to the out of hours company and someone has to manually switch it on and off. Sounds mad i know, but they want a button to press (or click) and be able to see the redirection ON or OFF. we can do this via the API and get the properties from the extension.

    The API is pretty damn good as well i might add. having been dealing with a linux based VoIP system since September and hitting brick walls with their API simply not working, the 3CX Call Control API is refreshingly good!

    The fact that you have wallboards and other tools out of the box means i don't have to do as much development, but little things like turning OOH on and off manually look easily achievable via the APi.
     
  9. jamesdawson

    Joined:
    Jan 30, 2014
    Messages:
    21
    Likes Received:
    0
    hi, just one last quick point on this. I've done as bardissi suggested on another number.

    this number is both a DDI and an option off a couple of menus, so I don't think an inbond rule would be appropriate.

    I have set up an extension 304, that redirects on no answer to the in hours IVR 321, and OOH to 322.

    couple of quick questions:
    1) as it's an extension and not a queue, does this cause any issues with number of concurrent calls, etc
    2) is there anything I should set to stop people beign able to accidently log into this extension, thus stopping the unavailable logic from firing?

    with the above questions in mind, should I have 304 - the initial destination - set as a queue which always forwards to a new extension say 305 which can then redirect to 321/322 depending on the time? is there any need to go to a queue initially rather than an extension?

    thanks

    james
     
  10. bardissi

    bardissi Member

    Joined:
    Jan 31, 2012
    Messages:
    318
    Likes Received:
    0
    1) as it's an extension and not a queue, does this cause any issues with number of concurrent calls, etc

    NO

    2) is there anything I should set to stop people beign able to accidently log into this extension, thus stopping the unavailable logic from firing?

    Just don't give anyone the password for this extension.

    with the above questions in mind, should I have 304 - the initial destination - set as a queue which always forwards to a new extension say 305 which can then redirect to 321/322 depending on the time?

    That can work.

    Is there any need to go to a queue initially rather than an extension?

    NO need
     
  11. jamesdawson

    Joined:
    Jan 30, 2014
    Messages:
    21
    Likes Received:
    0
    brilliant, thanks for your help and input!
     
Thread Status:
Not open for further replies.