📜 ⬆️ ⬇️

Routing incoming calls to 3CX depending on the time of day

Introduction


In this article, we will show how to create a 3CX voice call designer application that routes incoming calls with 3CX depending on the time of day.


Such a function is very much in demand if you need to inform the callers of different greeting messages depending on the time of day, or to send subscribers to the Service Queues in different languages, depending on the time of the call.


This simple application will help you get started in the development environment and gain basic CFD skills.


Please note - the 3CX CFD utility is available for free to 3CX Phone System Pro users.


For your convenience, 3CX has included this application in the CFD demo application suite. You can discover and study it in more detail. The finished working draft of the application is placed in the Documents \ 3CX Call Flow Designer Demos folder when installing CFDs.


Project creation


Create a new CFD project. Open the development environment, go to File → New → Project , specify the folder where the project will be saved, and specify the name of the project, for example, TimeBasedRouting .

3CX Call Flow Designer

Add the Create a condition component


To add a component:


  1. Drag the Create a condition component from the Component Panel on the left to the workspace under the green arrow indicating the start of the voice application. Give the component a meaningful name, for example, selectTimeRange . To do this, click on the component and change the name in the lower right window of the Properties Window.
  2. Create 4 application branches and name them from0to9 , from9to12 , from12to18 and from18to0 . To do this, right-click on the component and select Add branch .
  3. Now for each branch should create the appropriate conditions. Conditions are logical expressions in C # that must return TRUE for the component inside the branch to work (visually - under the condition). Conditions are checked from left to right, i.e. if the first condition returns FALSE, the second condition is checked, etc. We define the conditions:
    ')
    • For branch from0to9 : DateTime.Now.Hour <9
    • For branching from9to12 : DateTime.Now.Hour> = 9 && DateTime.Now.Hour <12
    • For branching from12to18 : DateTime.Now.Hour> = 12 && DateTime.Now.Hour <18
    • For branching from18to0 : leave it blank. This branch will be executed if other branches have not “worked”.


Creating branches in 3CX Call Flow Designer

Add Transfer Components


After creating the conditions for the branch, we will add the Transfer component to each branch . Thus, when the condition is “triggered”, the call will be transferred to the corresponding extension number.


To do this, drag the Transfer component to each of the branches. Configure each component to transfer the call to a different extension. To do this, click on the component and set the Destination property to extensions 101, 102, 103 and 104, respectively.


Adding Transfer Items to Call Flow Designer

The Destination property is an expression, so if you specify a constant here, it must be bracketed. Note that you can specify both variables and calculated expressions in Destination.


Add extension for call transfer


Compiling and installing the application on the 3CX server


Voice application is ready! Now it should be compiled and uploaded to the 3CX server. For this:


  1. Go to Build → Build All , and the CFD will create a TimeBasedRouting.tcxvoiceapp file.
  2. Go to the 3CX management interface, in the Call Queues section. Create a new Call Queue, specify the name and extension number of the Queue, and then set the Voice Applications option and download the compiled file .
  3. Save your changes to the Call Queue. Voice application is ready to go. Now, when a call is received on this Queue, it will be transferred to the appropriate extension number depending on the time of day.

Uploading voice application to 3CX server

You can check the operation of the application by calling the extension of the Queue, or by sending calls from external trunks to this Queue.


Downloads and Documentation


Source: https://habr.com/ru/post/333958/


All Articles