Time of day within VAD

Discussion in 'CRM / Helpdesk / App Integration' started by millsey, Dec 9, 2013.

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

    millsey New Member

    Joined:
    Dec 21, 2011
    Messages:
    190
    Likes Received:
    0
    Hi

    We have a queue which is open 9 till 8 Mon till Friday and 9 till 1 Saturday. One of the possible destinations for calls is to a queue which is only open 9 till 5 M to F and outside these times we want to forward the call to a company who answer out of hours for us.

    I can do this easily using Inbound rules on the main 3CX but how can I do this within the VAD? Any example would help as I am unsure how to structure a javascript check of the time and day.

    Is it going to be easier to raise a web service or web page to answer whether we are in or out of hours? would prefer nto as it is another thing that might go wrong or be unavailable.

    Thanks
    Millsey
     
  2. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    Hi Millsey,

    This article may help you:
    http://www.3cx.com/blog/voip-howto/javascript-3cx-vad/

    Also, you can use an External Code Execution component with javascript to do it. Just create a text file containing a javascript function which performs the calculation, and call it from an External Code Execution component.

    Kind regards.
     
  3. JMazio

    Joined:
    Feb 14, 2014
    Messages:
    4
    Likes Received:
    0
    Millsey

    I have the same problem to resolve.

    I'd like VAD follows the Open/Close status of 3CX System, to have a different behavior instead transfer the calls to the queue, like a promt message "The office is closed" to simplify for the end user.

    If I could read 3CX status, i can do a Conditional into the user component to transfer the call to Queue or AudioPrompt.

    I'll try duplicate the entire structure of my callflow on VAD changing the extension number and the transfer behavior to set Inbound Rules to the "open" or "closed" callflow.

    3CX could simplify and add some function to do this in a future update of the system.

    If you found another way to resolve it, please help me.
     
  4. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    Hi there,

    Another possible approach could be using the 3CX Call Control API (https://www.3cx.com/blog/docs/take-control-of-calls-on-3cx-with-the-call-control-api/) from an External Code Execution component, to check the 3CX configuration.

    Using that API you can read the 3CX configuration, like the open/close status, and then change the callflow behavior depending on that.

    Hope it helps.

    Kind regards.
     
  5. millsey

    millsey New Member

    Joined:
    Dec 21, 2011
    Messages:
    190
    Likes Received:
    0
    Hi

    Using the call control API is something we have wanted to do for a long time. Is it possible to include that dll and then call straight to it or will we need an intermediate dll or exe to do this?

    If it is possible to call the API directly from VAD external code execution then could we please have an example of doing this.

    Thanks
    Millsey
     
  6. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    You can not call that DLL directly. You need to create your own DLL to do what you need, referencing the library 3cxpscomcpp2.dll included when you install 3CX Phone System. Your DLL has to be built for AnyCPU, so it uses the 64/32 bits .NET runtime depending on the operating system bitness.

    This is because the External Code Execution component works creating an instance of an object and calling a single method on that object instance. To use the Call Control API you need to use many objects and combine them together, so you need to wrap that into another DLL and call that DLL from the VAD.

    Kind regards.
     
Thread Status:
Not open for further replies.