3CX PBX in the Cloud
1 year FREE - no ties!
google cloud platform
3CX
Zero Admin
With the new Dashboard
3CX
Bulletproof Security
With SSL certs and NGINX
3CX
Install on $200 Appliance
Intel MiniPC architecture
3CX
New, Intuitive Windows Client
More themes, more UC
3CX
More CRM Integrations
Scripting Interface to add your own
3CX
Improved Integrated Web Conferencing
iOS and Android apps included
3CX
Run On-Premise or in the Cloud
Google, OVH, Windows & Linux
Fast & easy call management
With the 3CX Web Client

CFD Prompts & Expressions

Prompts & Expressions

On this topic

Prompts & Expressions

Introduction

Prompt Types

The Prompt Collection Editor

The Expression Editor

See also

Introduction

When configuring different components, you will find that some functionality is shared between all of them. For example, the Prompt Playback, Menu, User Input and Record components, all of them use a collection of prompts to define the audio files to play to the caller. When configuring any of these components, you can use the Prompt Collection Editor to define them.

In the same way, when a component property has to be set using an expression, you can easily create this expression using the Expression Editor.

Prompt Types

As explained previously, many CFD components use prompts in order to perform the desired operation. When a component has a prompt collection, each prompt can be one of the following types:

  • Audio file: The prompt is stored in a wav file, and the filename is selected from a file list, or you can browse looking for it in the file system.
  • Dynamic Audio file: The prompt is stored in a wav file, but the file name is dynamically created using an expression.
  • Recorded Audio: The prompt is stored as a RecordComponent.AudioId variable, containing the audio previously recorded from the caller.
  • Text to Speech Audio: The prompt will be generated in real time using the Amazon Polly TTS engine, saved as a wav file, and finally the wav file will be played. More information on using text to speech can be found here.

When using a Dynamic Audio file prompt, the expression that creates the file name must return a string containing the file path relative to the project audio folder, or the absolute path to the file. If the audio file is located in your project Audio folder, then you just need to refer to it by its name, no special path information is required. The project Audio folders are:

Windows: “C:\ProgramData\3CX\Instance1\Data\Voiceapps\PROJECT_NAME\Audio”

Linux: “/var/lib/3cxpbx/Instance1/Data/Voiceapps/PROJECT_NAME/Audio”

The Prompt Collection Editor

The Prompt Collection Editor lets you edit the prompts to be played by a component for a specific purpose.

The Prompts Collection Editor

Here you can add any of the 4 different prompt types, and depending on the selected type you will need to configure each prompt using an expression or selecting the wav file from a list or from the file system. You can also change the order of the files, moving them up or down.

The Expression Editor

Many component properties must be set using an expression. In this case, when configuring the component from the configuration dialog, you will see a button on the right of the text box:

Click on that button to open the expression editor.

The Expression Editor

An expression can be a Constant String, a C# Expression, a Variable, or an Inbuilt Function. The list of available inbuilt functions to use in a CFD Expression is the following:

  • AND: Performs a logical AND between every parameter, returning a Boolean value as a result. Can have from 2 to 20 parameters.
  • OR: Performs a logical OR between every parameter, returning a Boolean value as a result. Can have from 2 to 20 parameters.
  • NOT: Receives a single Boolean parameter and returns another Boolean that is the negation of the provided parameter.
  • EQUAL: Receives two parameters of any type, and returns a Boolean indicating if they are equal.
  • NOT_EQUAL: Receives two parameters of any type, and returns a Boolean indicating if they are not equal.
  • GREAT_THAN: Receives two parameters of any type, and returns a Boolean indicating if the first is greater than the second.
  • GREAT_THAN_OR_EQUAL: Receives two parameters of any type, and returns a Boolean indicating if the first is greater than or equal to the second.
  • LESS_THAN: Receives two parameters of any type, and returns a Boolean indicating if the first is less than the second.
  • LESS_THAN_OR_EQUAL: Receives two parameters of any type, and returns a Boolean indicating if the first is less than or equal to the second.
  • CONCATENATE: Concatenates every string parameter and returns the resulting string. Can have from 2 to 20 parameters.
  • TRIM: Receives a string and returns the same string removing leading and trailing not visible characters (spaces, new lines, etc.)
  • LEFT: Receives two parameters. The first is a string to cut. The second is the number of characters to cut. Returns a string that is the first N characters of the original string.
  • MID: Receives three parameters. The first is a string to cut. The second is the start position where the cut must start, using a zero based index. The third is the number of characters to cut. Returns a string that is the specified substring of the original string.
  • RIGHT: Receives two parameters. The first is a string to cut. The second is the number of characters to cut. Returns a string that is the last N characters of the original string.
  • REPLACE: Receives three parameters. The first is a string where the replacement must be made. The second is the text to find in order to replace. The third is the text to replace with. Returns a string with the replacements specified.
  • REPLACE_REG_EXP: Receives three parameters. The first is a string where the replacement must be made. The second is the regular expression used to find text in order to replace. The third is the text to replace with. Returns a string with the replacements specified.
  • UPPER: Receives a single string parameter and returns another string that is the original string with upper case.
  • LOWER: Receives a single string parameter and returns another string that is the original string with lower case.
  • NOW: Receives no parameters, and returns the current date and time as a DateTime object.
  • LEN: Receives a single string parameter and returns its length as a number.
  • SUM: Sums every numeric parameter and returns the result. Operates with 32 bits integers. Can have from 2 to 20 parameters.
  • SUM_LONG: Sums every numeric parameter and returns the result. Operates with 64 bits integers. Can have from 2 to 20 parameters.
  • NEGATIVE: Returns the negative number of the single numeric parameter received. Operates with 32 bits integers.
  • NEGATIVE_LONG: Returns the negative number of the single numeric parameter received. Operates with 64 bits integers.
  • MULTIPLY: Multiplies every numeric parameter and returns the result. Operates with 32 bits integers. Can have from 2 to 20 parameters.
  • MULTIPLY_LONG: Multiplies every numeric parameter and returns the result. Operates with 64 bits integers. Can have from 2 to 20 parameters.
  • DIVIDE: Receives two numeric parameters, and returns “first / second”. Operates with 32 bits integers.
  • DIVIDE_LONG: Receives two numeric parameters, and returns “first / second”. Operates with 64 bits integers.
  • ABS: Returns the absolute positive number of the single numeric parameter received. Operates with 32 bits integers.
  • ABS_LONG: Returns the absolute positive number of the single numeric parameter received. Operates with 64 bits integers.
  • GET_TABLE_ROW_COUNT: Returns the number of rows of the table received. The table is the result of a database query.
  • GET_TABLE_CELL_VALUE: Receives three parameters. The first is the variable containing the table (the result of a database query). The second is the row identifier, using a zero based index. The third is the column identifier, using a zero based index. Returns the value of the cell from the specified table, at the specified row and column.
  • GET_LIST_ITEM_COUNT: Returns the number of items of the list received. The list is the result returned by the component “3CX Get Queue Extensions”.
  • GET_LIST_ITEM: Receives two parameters. The first is the variable containing the list (the result returned by the component “3CX Get Queue Extensions”). The second is the zero based item index. Returns the value of the item from the specified list, at the specified index.

See also

You might also be interested in:

Get 3CX Free for 1 Year Today
Download On-Premise Try in the Cloud