3CX Voice Application Development: An Beginner's Guide
- Recovery mode
Call Flow Designer Development Environment
The 3CX Call Flow Designer (CFD) development environment allows the PBX administrator to create complex call processing logic (voice applications) in a convenient visual editor - with minimal or no programming skills. Voice applications interact with the user over the phone, taking input from him and performing certain actions. You can, for example, request a customer’s card number from a subscriber, check it in the CRM system and transfer it to a fixed manager. Or you can route the call based on date, time, and other factors.
Note: 3CX Pro Edition is required to run 3CX CFD applications.
A CFD application is “assembled” from building blocks called components. There are quite a few ready-made components, and their list is expanding, for example: Menu (Voice Menu / IVR), Prompt Playback (Playback to a user), User Input (Reception of user input). Each component has several configurable parameters, which we will talk about below. The components combined together form the Project of the voice application. After compilation, this project is uploaded to the 3CX server (Windows or Linux) in the Call Queues interface. Next, you route calls to this Queue number from the voice menu (IVR) or directly from the outside line. In the process, the voice application can transfer calls to Queues, Groups, IVR, certain users, etc. again.
Advantages of using CFD development environment before writing scripts manually:
- The use of many ready-made components - a record speed of "assembly" of the application
- Visualization of the created algorithm - another employee can easily change or modify the application
- Using Debugged Component Code - Minimizing Design Errors
- Support for the popular C # language extending voice applications
- Compiling a CFD application (rather than interpreting a script) - high execution speed, minimal processor load
3CX Call Flow Designer installs only on a 64-bit version of Windows. The application takes up about 15 MB plus space for user projects. CFD can be installed on any suitable computer, not just a computer with a 3CX system. The project is created locally and then uploaded to the PBX server. This, in particular, allows 3CX partners to create custom voice applications for their customers.
Consider the terms you'll come across when developing 3CX voice applications:
- Project - in fact, the application being developed. It consists of call processing flows, dealers and other components.
- Callflow - a certain interaction with the user, i.e. a set of actions performed by a component (or components). For example, a stream is a request to enter numbers from a user.
- Dialer - A processing thread that automatically makes an outgoing call.
- Components - building blocks of the call flow, for example, playing menu items, receiving user input, accessing a database, etc. Components are part of an inbound processing stream, an outgoing stream (dialer), or a more complex user component.
- Custom Component - you can create your own components with special features.
Create a simple voice application
Let's see how to create the simplest voice application in the CFD environment. Once you get comfortable with simple components, it will not be difficult to move on to more complex applications that consist of the same simple components.
Our application is a simple Voice menu (to transfer to the Sales Department, press 1, Support Department - 2, Outgoing Call - 3, or stay on the line to connect to the Operator.
To create a project, go to File> New> Project and specify a file name. When you save the project, three folders are created: for the audio files of the project, for additional libraries and for the finished assembly of the voice application. The project is created with a set of default parameters, which you can then change.
When you create a project, an empty Main workflow is also created. It is located in the tab of the main window into which you drag the components of the stream. Each stream has two properties: the name of the stream and the set of variables that are used in the stream
Adding Components to a Stream
After creating an empty stream, fill it with working components. Let's start with the Menu component.
- Drag it to the thread tab and name mainMenu
- By default, the menu has two options. Add a third - right-click on a component and select Add Option 3.
When you add the Menu component to the stream, its parameters are set according to the template in accordance with the settings in the Tools> Options> Component Templates> Menu section. There are three ways to set the component’s parameters:
- In the Properties window
- Double-click on a component
- From the component context menu
For example, to set the voice message played to the user, in the Properties window, change the InitialPrompts property. The voice editor of the Prompt Collection Editor opens. Specify the AudioFilePrompt option, and then select the sound file to play.
Sound files located in the project audio files folder are visible in the drop-down list. And if you select a file in another place on the disk, it is automatically copied to the project folder.
Please note: CFD only supports audio files of the following format: WAV, mono, 8 KHz, 16 bit. You can prepare files of the correct format according to this instruction .
To add a voice message that will sound to the user if the entry is incorrect, change the InvalidDigitsPrompts parameter. The message if there is no user input is set in the TimeoutPrompts parameter.
Having configured the main parameters of the menu itself, we add the components that will be executed when choosing one or another option. For example, when you select Option 1, the application transfers the call to the Sales Department - add the Transfer component under the Option 1 branch and change the component name to Sales.
Double-click on the Transfer component and specify the direction - extension number of the Sales Department. Similarly, indicate in Option 2 the extension number of the Service Department.
In Option 3, the algorithm is a bit more complicated. We will ask the user the number to which the call should be transferred, and then transfer to the entered number. To obtain the number, the User Input component is used:
- Drag it to the Option 3 branch, change the name and add a message that will prompt the user to enter the number.
- Indicate valid numbers - from 0 to 9 (asterisk and dot are not allowed).
- Specify the minimum and maximum number length (MinDigits and MaxDigits parameters), for example, from 3 to 5.
- If the user made an incorrect entry, the call is transferred to the agent.
To configure the transfer of a call to the entered number, double-click on the Transfer component in option 3 and click on the Expression Editor button fx. As an expression, specify the buffer property of the askForDestination component.
Compiling and downloading the application to the server
The completed project will look something like the screenshot above. However, we need to compile the finished application (a file with the tcxvoiceapp extension, which is installed on the server.
To do this, select the Build> Build All option from the CFD menu. A compilation window and an error window will appear in which all errors and warnings that occur during compilation are visible. Then, Windows Explorer opens with the file of the finished application.To
upload the file to the PBX server, in the 3CX management interface, create a Call Queue, specify its name and extension number, and go to the Voice applications section.
Check the Voice applications box and download your application. After that, a warning message about restarting the Queue Manager Service will appear. Please note that upon restart, all calls in the Queues will be interrupted.
The voice application is registered in the 3CX system under the Call Queue extension. The application is launched either upon receipt of a direct external call to this Queue, or upon transfer to the Queue. In our case, just call the Queue extension number and the application will start!
We have described the basic principles for developing applications for 3CX. Of course, CFD capabilities are much larger. It is constantly supplemented with new components and gets integration capabilities with third-party services, for example, Amazon Polly, a natural speech generation service. In addition, it has recently become possible to access the 3CX server API directly from CFD applications using C #. Understanding the basics, you can move on to creating more complex and useful applications. We have repeatedly considered such applications in the past:
- Using the 3CX Server API from a CFD Application
- Natural speech generation in CFD application
- Predictive Outgoing Calls with 3CX
- Automatic outgoing dialing in CFD application
- Sophisticated routing of incoming calls
- Read user input in CFD application
- Working with databases in the CFD application
- Sending email in CFD application
If you have any questions about the development of voice applications, the best place for advice - Developer Forum 3CX CFD and documentation 3CX CFD .