Time based routing without programming
On this topic
Routing calls depending on date and time is a very common task, so we have made it simpler than ever to do it using the 3CX Call Flow Designer. Now it’s possible to do this without creating a C# expression, so anyone can do this without any programming experience.
In this article we’ll explain how to use the new “Date & Time condition” component to route calls to different extensions depending on the time of the day, from a voice app created with the 3CX Call Flow Designer (formerly VAD). We’ll route calls as follows:
- During out of office hours (including holidays): calls will be routed to the “business closed” queue.
- During in-office hours, on Monday, Wednesday and Friday from 9 to 12 and from 14 to 17: calls will be routed to the “promotions” queue.
- During in-office hours, the rest of the days and times: calls will be routed to the “standard” queue.
The project for this application is installed along with the 3CX Call Flow Designer, in folder “Documents\3CX Call Flow Designer Demos”.
Step 1: Create the project
First, we need to create a new project. Open the CFD and go to “File > New > Project”, select the folder where you want to save it, and enter a name for the project. In this case we’ll name it “DateTimeRouting”.
Step 2: Add the “Date & Time condition” component
Now we’ll add the “Date & Time condition” component:
- Drag a “Date & Time condition” component from the toolbox, and drop it into the design surface of the “Main” callflow. Then select the component added, go to the Properties window and rename it to “dateTimeCondition”.
- Configure this component with 3 branches, and name them “businessClosed”, “promotions” and “standard”:
- Branches are evaluated from left to right. The first branch with a valid condition will be executed. Now we need to configure the conditions in which each branch will be executed. To do this, double click on the branch “businessClosed”, or right click on it and select the menu option “Configure”. You will see the following dialog:
- This dialog lets you configure DID filters as well as date time conditions. The DID filters let you specify that this branch will be activated only when the call arrives to 3CX to a specific DID. You can select “AllDIDs” to allow calls to any DID, “AllDIDsWithExceptions” to allow calls to any DID except the ones in the list below (DIDs separated by commas), or “SpecificDIDs” to allow calls only to the DIDs in the list below. We’ll set the DID Filter to “AllDIDs” as we don’t want to restrict DIDs in this particular case. Then, click on the “Edit Date Time Conditions” button to open the editor.
- In this dialog we can specify different date and time conditions:
- Day of week: to specify time ranges in specific days of the week, for example every Monday.
- Specific day: to specify a time range in a specific date, for example a particular holiday.
- 3CX Office Hours: to activate the branch during global office hours.
- 3CX Out of Office Hours: to activate the branch when we’re out of global office hours.
- In this case we will select “3CX Out of Office Hours” as we want to activate the branch when the business is closed. This option doesn’t require any other configuration, so we press OK to save the changes.
- Now we need to configure the “promotions” branch. We want to activate it for any DID, on Monday, Wednesday and Friday from 9 to 12 and from 14 to 17. To do this, we configure the conditions as follows:
- For the “standard” branch we can use the condition “3CX Office Hours”, and it will be selected when the previous ones didn’t.
Step 3: Add Transfer components
Now that we have our conditions ready, we need to add a “Transfer” component to each branch, so the call is transferred to a different internal extension in each case. To do this, drag a “Transfer” component from the toolbox, and drop it into the first branch. Then repeat the procedure to add 3 components, one into each branch. Configure each Transfer component with a different Destination. In our example, we’re setting the Destination property of each component to extensions 800, 801 and 802 respectively.
Step 4: Build and Deploy to 3CX Phone System
The project is ready. We just need to build and upload it to our 3CX Phone System server. To do this:
- Go to “Build > Build All”. The CFD will create the file “DateTimeRouting.tcxvoiceapp”.
- Go to the “3CX Management Console > Call Queues”, create a new queue, configure it with name and extension, check the “Voice apps” option, and upload the file created by the CFD in the previous step.
- Save the changes to the queue. The voice app is ready to use. Make a call to the configured extension, and you should be transferred to a different destination depending on the time of the day.