Getting started – Creating a simple call flow
On this topic
In this chapter we’ll explain how to create a simple call flow and deploy it to 3CX Phone System. The idea of this chapter is to give an overview of how to work with the CFD. After you are able to build a simple application you can then familiarize yourself with the more advanced components and build more complex applications.
In this chapter we will build a call flow which will offer a simple menu (For Sales press 1, for Help Desk press 2, to make an outbound call press 3, or hold on and an operator will assist you). The concepts used in this section are explained in detail in the following chapters.
Creating the project
The first step is creating the project. To do this:
- Click “File > New > Project”.
- Enter a project name and location and click “Save”.
- The project will be created with default properties. If you need to change them, select the project in the Project Explorer. Then the Properties window will show its properties and let you change them.
The application will create a folder to store audio files for the project, another folder to store library files for the project, and a third folder for the build output.
Creating a call flow
When the project is created, an empty “Main” call flow is automatically created too. A new tab will open on which you can drag the components that will form your call flow.
Each call flow will be created with two properties, which can be edited from the properties Window:
- Name: The name of the call flow.
- Variables: The list of variables that you will be able to use in this call flow.
To open the call flow, double click on the call flow item from the Project Explorer.
Adding components to the call flow
Once you have created the call flow, you can drag and drop components from the toolbox to the designer. In this example, we’ll add a Menu component:
- From the toolbox on the left hand side, select the component “Menu”
- Now drag it onto the designer surface, and drop it in the desired position.
- Now give the component an appropriate name. In this case we’ll name it “mainMenu”.
- By default each menu starts with 2 options. We’re going to add a third option. Right-click with your mouse on the menu component just added, and select “Add Option 3”.
Note: When the Menu component is added to the designer, it will have its properties set to the template you have in “Tools > Options > Component Templates > Menu”. You may change the Menu component properties from the Properties windows or its configuration form. The configuration form can be opened by double clicking the component or in the context menu displayed when you right click on it.
- To change the menu prompt, edit the “InitialPrompts” property from the Properties window.
The Prompt Collection Editor will be shown. There you may add an “AudioFilePrompt”, and select an audio file from the drop down list, or browse for it in your file system. The drop down list shows the names of the files you have in the audio folder of the project, and when you browse for an audio file it will be automatically copied to this folder. Audio files must have the format: WAV, Mono, 8 KHz, 16 bits per sample. If you have audio files in a different format, please follow this article to convert them.
- You may want to add prompt messages to play when the user enters an invalid option or does not input any digit. You can do that by changing the “InvalidDigitsPrompts” and “TimeoutPrompts” properties for the Menu component.
- Now that we configured the simple menu, we need to add the components that will be executed when any of the options is activated. Let’s assume we want to transfer to the Sales department if the user presses 1. To do this, drag and drop a Transfer component from the Toolbox to the designer, under the “Option 1” branch.
- Change the name of the transfer component to “Sales”.
- Double-click on the Transfer component and enter the sales extension as the destination. Repeat this procedure for option 2 (transfer to Help Desk) and timeout or invalid option (transfer to the operator).
- For option 3, we are going to make things a bit more interesting. We will ask for a destination number and then transfer to that number. To ask for the destination number we will use a User Input component. Drag and drop it under the “Option 3” branch. Change the component name and configure the message prompt to use. Specify that valid digits are numbers from 0 to 9, and other digits are invalid (star and pound). Also set MinDigits and MaxDigits to a reasonable value, for example, between 3 and 5. When the user enters a valid input, we need to transfer the call to the specified destination. Otherwise, we’ll transfer the call to the operator.
- Drag and drop a transfer component onto the valid option area. Now double click on the transfer component. The transfer configuration dialog will appear.
- Now click on the Expression editor button, which is the “fx” button next to the destination field. The Expression editor will appear.
- To transfer the call to the selected destination, select the “Buffer” property of the “askForDestination” component.
Building the project
The project is ready. Now we need to build it to a package file with extension “tcxvoiceapp” that can be uploaded to 3CX Phone System.
In order to build the project, execute the menu command “Build > Build All”. The output window will show compilation progress, and the Error List window will show any error, warning or important message that you might need to see.
When the build finishes, the output package file will be shown in Windows Explorer.
Deploying the project to 3CX Phone System
Once you successfully built the project, you need to upload it to 3CX Phone System. Login to the 3CX Management Console, create a Call Queue, set a name and extension number, and go down to the Voice apps section.
Check the Voice apps checkbox, and then press the Upload button, select the output package created by the CFD (extension “tcxvoiceapp”), and save it.
Please note that the Queue Manager Service needs to be restarted, and therefore you will see a message to confirm. All ongoing queue calls will be terminated.
Now you’re ready to call the queue extension and execute your voice app.
Executing your voice application
When deploying a project, the call flow is registered in 3CX Phone System with a queue extension number. You can choose when a call flow is activated in the same way you decide that a Digital Receptionist or Queue is activated: for example when an inbound call arrives from a PSTN line, or when a user presses a digit on a Digital Receptionist.
Now that you have built and deployed your voice application, you are ready to try it out. Simply ring the extension that you have assigned to the voice application!
- Install the 3CX Call Flow Designer
- Accessing a database from a CFD voice app
- Sending e-mails from a CFD voice app
- How to play a sequence of digits from a 3CX Call Flow Designer voice app
- Creating a Phone Support Portal with the 3CX Call Flow Designer – Part 1, 2, 3, 4
- Routing Calls Based on the Time of Day
- Creating an outbound dialer
- Time-Based Routing without Programming
- Using the Authentication component to validate customers
- Using the Credit Card Component
- Text to Speech with the 3CX Call Flow Designer
- Creating a predictive dialer with the 3CX CFD