Components - Your Application’s Building Blocks

Introduction

Components are the main building blocks of a call flow or dialer to perform basic actions, e.g. playing a prompt, recording audio from the caller, asking for user input, accessing a database, etc. There are two types of components – the ones with “branches”, such as the “Menu” component, and those without – like the “Prompt Playback” component.

When a component is selected in the designer, the “Properties” panel displays its input properties. These are the options you need to set for the component to function, e.g. the connection information for a database. Also, some components have output properties exposed after execution, containing the execution result, e.g. the data returned by a database. The public properties created for a user-defined component can be used as input and output.

An alert icon appearing on a component’s top right indicates invalid property values. Click on it for more info.

Component Default Options

Components added to the designer are automatically configured with the default options set in “Tools” > “Options” > “Component Templates”. Please note that the values entered here are constant values, not expressions. As these values are not in the context of a project, constant string values set here must not use quotes.

Online Services

A CFD app can use these Text to Speech and Speech to Text (Speech Recognition) online services:

To configure the credentials the CFD app uses to connect to the selected engine, you need to fill the settings from the menu “Tools” > “Online Services”.

Credentials for connecting a 3CX CFD app to online services.

To configure Online Services, please check our guides for Amazon Polly and Google Cloud.

Main Building Blocks

The built-in components available for your application can be configured via the “Properties” panel, accessed via the “Properties” context menu item, or by double-clicking the component to open its configuration dialog.

Enabling & Disabling components

Components and their options can be enabled or disabled, by setting their “Enabled” property or right-clicking and selecting “Enable” or “Disable” in the context menu. Disabled components and options appear as dim gray in the designer view to distinguish visually.

Checking Execution Results

When a component is selected, the Properties window will show the Tag property among others. This property is a free text field, which is shown between parenthesis in the component box in the designer, to provide additional information about the purpose of the component.

When an input property is an expression, click on the button on the right of the text box to open the Expression Editor. These are the main CFD application building blocks, grouped by functionality:

Call Control

Menu

Menu component options

This component provides a menu for single-digit options, handling the retry logic when the user enters an invalid or or no DTMF input. Its execution finalizes when a valid option is selected or the number of retries is exhausted. Its input properties are:

  • AcceptDtmfInput: True to accept DTMF input during prompt playback. False otherwise.
  • MaxRetryCount: Counts the unique number of retry attempts for invalid or no input.
  • Timeout: The time to wait for user input in seconds, before playing the timeout prompt(s).
  • RepeatOption: The digit that the user must press in order to repeat the menu prompt.
  • IsValidOption_N: Specify if a key (N) pressed by the user is a valid or an invalid option. Valid options appear as branches in the designer.
  • InitialPrompts: The list of prompts to play when the menu is executed the first time.
  • SubsequentPrompts: The list of prompts to play subsequently, after a timeout or an invalid option.
  • TimeoutPrompts: The list of prompts to play on no user input. After playing the timeout prompts, the subsequent prompts are played.
  • InvalidDigitPrompts: The list of prompts to play on invalid user input. After playing the invalid digit prompts, the subsequent prompts are played.

Each menu option is represented by a branch. You can specify a friendly name for each branch, so you can easily spot what each option means.

Specifying a friendly name for each branch

When the menu ends, the execution continues on one of its branches, i.e. a valid option branch, the timeout or invalid option branch. The “Μenu” component exposes the following output properties after execution:

  • Result: the result of menu execution can be one of these constant values:
    MenuResult.Timeout
    ,
    MenuResult.InvalidOption
    or
    MenuResult.ValidOption
    .
  • SelectedOption: the option selected as a char value after menu execution, when the
    Result
    parameter is set to
    MenuResult.ValidOption
    , i.e. one of these constant values: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '#'.

User Input

User Input component options in 3CX Call Flow Designer

This component collects DTMF digits from the caller, handling the retry logic on invalid or no input, or invalid digit input length. The execution finalizes when a valid input is entered by the caller or the number of retries is exhausted. Its input properties are:

  • AcceptDtmfInput: True to accept DTMF input during prompt playback. False otherwise.
  • MaxRetryCount: Counts the unique number of retry attempts for invalid or no input.
  • InitialPrompts: The list of prompts to play the first time the component is executed.
  • SubsequentPrompts: The list of prompts to play subsequently after a timeout or invalid input.
  • TimeoutPrompts: The list of prompts to play on no user input. After playing the timeout prompts, the subsequent prompts are played.
  • InvalidDigitPrompts: The list of prompts to play on invalid user input. After playing the invalid digit prompts, the subsequent prompts are played.
  • FirstDigitTimeout: The time to wait for the first digit in seconds, before playing the timeout prompt(s).
  • InterDigitTimeout: The time to wait for subsequent digits in seconds, before playing the invalid digits prompt(s).
  • FinalDigitTimeout: The time to wait for digits in seconds, after
    MinDigits
    has been reached, before returning the entered data.
  • MinDigits: The minimum digit length that can be entered by the user.
  • MaxDigits: The maximum digit length that can be entered by the user.
  • StopDigit: Specifies the digit that the user needs to enter to finalize the data entry.
  • IsValidDigit_N: Specify if a key (N) pressed by the user is a valid or an invalid digit.

When the user input ends, execution continues on one of its branches, i.e. “Valid Input” or “Invalid Input”. After execution, the “User Input” component exposes these output properties:

  • Result: one of the following values:
  • UserInputResult.Timeout: the user didn’t enter any digit in the last attempt.
  • UserInputResult.InvalidDigits: the user entered an invalid digit or less than
    MinDigits
    in the last attempt.
  • UserInputResult.ValidDigits: the user entered valid digits between
    MinDigits
    and
    MaxDigits
    , optionally terminating the input with the
    StopDigit
    .
  • Buffer: the digits entered by the user, not including the
    StopDigit
    if it was entered by the user.

Voice Input

Configure the Voice Input component

To use this component, you need to configure Online Services for Speech to Text. Please follow this guide for instructions on how to configure Google Cloud Speech to Text.

This component recognizes the caller’s speech and converts it to text, also accepting DTMF digits as an alternative input method. After playing the “Initial Prompts”, the component starts listening to the caller’s speech and streams the audio in real time to the Speech to Text engine. The speech recognition is received back in real time, so the component can validate the input.

Configure Online Services for Speech to Text

In some cases you want to provide hints to the Speech to Text engine, so it knows what the user might say, and improve the recognition of specific words or phrases. For example, suppose that your audio data often includes the word “weather”. When Speech-to-Text encounters the word “weather”, you want it to transcribe the word as “weather” more often than “whether”. Also, in some cases you might want to recognize numbers or spelled letters, so you can provide known tokens for this. The Hint Builder is a dialog similar to the Expression Editor that you are already familiar with, which is very helpful to create hints concatenating constant text with tokens. Please note that available tokens are different for each language, so refer to the Speech to Text engine documentation for updated information on this.

When the input should be limited to specific options, for example “Yes” or “No”, or the name of a department within your company (“Sales”, “Support”, “Marketing”, and so on), you can specify a

Dictionary
with the values that you expect to recognize. When you do this, the input will be considered valid when the caller says any of the entries from the dictionary. Dictionary entries are evaluated from top to bottom, so if the recognized text has the words “Yes” and “No”, but “Yes” is specified first in the dictionary, then that word will be considered the matched entry. When the Dictionary is empty, any response will be considered valid.

The input is considered complete when:

  1. The user has entered valid DTMF input, or
  2. The component matches an entry from the dictionary in the recognized text, or
  3. The caller remains in silence during the
    InputTimeout
    .

It’s important to mention that when DTMF input is also enabled, any DTMF digit received will automatically stop the speech recognition, and the component will continue waiting for the remaining DTMF digits, if any.

The fully recognized text or DTMF digits received are returned as an output property, along with the matched entry from the dictionary, if any.

In addition, the audio received from the caller can be saved to a WAV file, in case you need to perform speech recognition but also keep the audio to manually listen to when the recognition is not accurate. You can use the

SaveToFile
and
FileName
properties for this. The
FileName
can be a full path in the 3CX server, or a relative path, in which case the file will be saved in the CFD project audio folder. The project audio folders are:

  • Windows: “C:\ProgramData\3CX\Instance1\Data\Ivr\Prompts\Callflows\project\”
  • Linux: “/var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/project/”

This component handles the retry logic on invalid or no input. The execution finalizes when a valid input is detected or the number of retries is exhausted.

The input properties are:

  • InputTimeout: The time to wait after the caller has finished speaking, to consider the input finalized, in seconds.
  • MaxRetryCount: Counts the unique number of retry attempts for invalid or no input.
  • LanguageCode: The language to recognize as a BCP-47 language tag. Example: "en-US".
  • AcceptDtmfInput: True to accept DTMF input in addition to speech. False otherwise.
  • DtmfTimeout: The number of seconds to wait for DTMF digits once the first digit has been received, before playing the specified timeout prompts.
  • MinDigits: The minimum digit length that can be entered by the user.
  • MaxDigits: The maximum digit length that can be entered by the user.
  • StopDigit: Specifies the digit that the user needs to enter to finalize the data entry.
  • IsValidDigit_N: Specify if a key (N) pressed by the user is a valid or an invalid digit.
  • InitialPrompts: The list of prompts to play the first time the component is executed.
  • SubsequentPrompts: The list of prompts to play subsequently after a timeout or invalid input.
  • TimeoutPrompts: The list of prompts to play on no user input. After playing the timeout prompts, the subsequent prompts are played.
  • InvalidInputPrompts: The list of prompts to play on invalid input. After playing the invalid input prompts, the subsequent prompts are played.
  • Hints: A list of hints, composed by constant text or tokens, that help the speech recognition engine to properly understand what the user should say.
  • Dictionary: A list of expected inputs to recognize.

When the voice input ends, execution continues on one of its branches, i.e. “Valid Input” or “Invalid Input”. After execution, the “Voice Input” component exposes these output properties:

  • Result: one of the following values:
  • VoiceInputResult.Timeout: during the last attempt the user didn’t provide any voice input.
  • VoiceInputResult.InvalidInput: during the last attempt the user provided voice input, but none of the dictionary entries could be matched to a part of the recognized text.
  • VoiceInputResult.ValidInput: the user provided voice input, which was matched to an entry from the dictionary, or the dictionary was empty so any input is considered valid.
  • VoiceInputResult.ValidDtmfInput: the user provided valid DTMF input.
  • RecognizedText: the full text recognized by the Speech to Text engine.
  • DictionaryMatch: the dictionary entry found in the recognized text.
  • DtmfInput: The DTMF digits entered by the user, not including the Stop Digit (if any).

Authentication

Authentication component options in 3CX Call Flow Designer

This component collects an ID and a PIN from the caller as DTMF digits, handling the retry logic when the user enters invalid digits, fewer digits than expected or no input. The execution finalizes when a valid ID and PIN input is entered by the caller, or the number of retries is exhausted. Its input properties are these:

  • MaxRetryCount: Number of retry attempts to enter a valid ID and PIN.
  • IsPinRequired: Set to
    True
    for the component to also request a PIN code.
  • RequestIdAcceptDtmfInput:
    True
    to accept DTMF input during prompt playback when entering the ID. False otherwise.
  • RequestIdMaxRetryCount: When entering the ID, number of retry attempts for invalid input or timeout. The retry counter is unique, and counts invalid inputs or no inputs using the same counter.
  • RequestIdInitialPrompts: When entering the ID, the list of prompts to play the first time the menu is executed.
  • RequestIdSubsequentPrompts: When entering the ID, the list of prompts to play subsequent times (after a timeout or invalid digit).
  • RequestIdTimeoutPrompts: When entering the ID, the list of prompts to play when the user does not enter any digits. After playing the timeout prompts, the subsequent prompts are played.
  • RequestIdInvalidDigitPrompts: When entering the ID, the list of prompts to play when the user enters invalid digits. After playing the invalid digit prompts, the subsequent prompts are played.
  • RequestIdFirstDigitTimeout: When entering the ID, the time to wait for the first digit, before playing the specified timeout prompts, in seconds.
  • RequestIdInterDigitTimeout: When entering the ID, the time to wait for subsequent digits, before playing the specified invalid digits prompts, in seconds.
  • RequestIdFinalDigitTimeout: When entering the ID, the time to wait for digits after MinDigits has been reached, before returning the entered data, in seconds.
  • RequestIdMinDigits: When entering the ID, the minimum quantity of digits that must be entered by the user.
  • RequestIdMaxDigits: When entering the ID, the maximum quantity of digits that can be entered by the user.
  • RequestIdStopDigit: When entering the ID, specifies the digit that the user needs to enter to finalize the data entry.
  • RequestIdIsValidDigit_N: When entering the ID, specifies what happens when the user presses N. It could be a valid or an invalid digit.
  • RequestPinAcceptDtmfInput: When entering the PIN, true to accept DTMF input during prompt playback. False otherwise.
  • RequestPinMaxRetryCount: When entering the PIN, number of retry attempts for invalid input or timeout. The retry counter is unique, and counts invalid inputs or no inputs using the same counter.
  • RequestPinInitialPrompts: When entering the PIN, the list of prompts to play the first time the menu is executed.
  • RequestPinSubsequentPrompts: When entering the PIN, the list of prompts to play subsequent times (after a timeout or invalid digit).
  • RequestPinTimeoutPrompts: When entering the PIN, the list of prompts to play when the user does not enter any digits. After playing the timeout prompts, the subsequent prompts are played.
  • RequestPinInvalidDigitPrompts: When entering the PIN, the list of prompts to play when the user enters invalid digits. After playing the invalid digit prompts, the subsequent prompts are played.
  • RequestPinFirstDigitTimeout: When entering the PIN, the time to wait for the first digit, before playing the specified timeout prompts, in seconds.
  • RequestPinInterDigitTimeout: When entering the PIN, the time to wait for subsequent digits, before playing the specified invalid digits prompts, in seconds.
  • RequestPinFinalDigitTimeout: When entering the PIN, the time to wait for digits after MinDigits has been reached, before returning the entered data, in seconds.
  • RequestPinMinDigits: When entering the PIN, the minimum quantity of digits that must be entered by the user.
  • RequestPinMaxDigits: When entering the PIN, the maximum quantity of digits that can be entered by the user.
  • RequestPinStopDigit: When entering the PIN, specifies the digit that the user must pressto finalize the data entry.
  • RequestPinIsValidDigit_N: When entering the PIN, specifies what happens when the user presses N. It could be a valid or an invalid digit.

When the Authentication component collects the ID and PIN, the execution continues on the “Valid Input” branch, and the component exposes the following output properties:

  • ID: the digits entered by the user for the ID (not including the StopDigit if it was entered by the user).
  • PIN: the digits entered by the user for the PIN (not including the StopDigit if it was entered by the user).
  • Validated: a boolean property that must be set to true for notifying the “Authentication” component that the ID and PIN are valid, so it avoids asking again for this information.

On the other hand, when the “Authentication” component can’t collect the ID or PIN, the execution continues on the “Invalid Input” branch, where you can play a message for example, and then the component retries asking for the ID and PIN, until the

MaxRetryCount
is reached.

Credit Card

Credit Card component options in 3CX Call Flow Designer

This component collects a credit card number, expiration date and security code from the caller in the form of DTMF digits. It handles the retry logic when the user enters invalid digits, fewer digits than expected or does not enter anything at all. The execution finalizes when a valid input is entered by the caller for the credit card number, expiration date and security code, or all the retries have been attempted. The input properties are the following:

  • MaxRetryCount: Number of retry attempts to enter a valid combination of credit card number, expiration date and security code.
  • IsExpirationRequired: Specifies if the component should request only the credit card number, or the expiration date as well.
  • IsSecurityCodeRequired: Specifies if the component should request only the credit card number and expiration date, or the security code as well.
  • RequestNumberAcceptDtmfInput: When entering the credit card number, true to accept DTMF input during prompt playback. False otherwise.
  • RequestNumberMaxRetryCount: When entering the credit card number, number of retry attempts for invalid input or timeout. The retry counter is unique, and counts invalid inputs or no inputs using the same counter.
  • RequestNumberInitialPrompts: When entering the credit card number, the list of prompts to play the first time the menu is executed.
  • RequestNumberSubsequentPrompts: When entering the credit card number, the list of prompts to play subsequent times (after a timeout or invalid digit).
  • RequestNumberTimeoutPrompts: When entering the credit card number, the list of prompts to play when the user does not enter any digits. After playing the timeout prompts, the subsequent prompts are played.
  • RequestNumberInvalidDigitPrompts: When entering the credit card number, the list of prompts to play when the user enters invalid digits. After playing the invalid digit prompts, the subsequent prompts are played.
  • RequestNumberFirstDigitTimeout: When entering the credit card number, the time to wait for the first digit, before playing the specified timeout prompts, in seconds.
  • RequestNumberInterDigitTimeout: When entering the credit card number, the time to wait for subsequent digits, before playing the specified invalid digits prompts, in seconds.
  • RequestNumberFinalDigitTimeout: When entering the credit card number, the time to wait for digits after MinDigits has been reached, before returning the entered data, in seconds.
  • RequestNumberMinDigits: When entering the credit card number, the minimum quantity of digits that must be entered by the user.
  • RequestNumberMaxDigits: When entering the credit card number, the maximum quantity of digits that can be entered by the user.
  • RequestNumberStopDigit: When entering the credit card number, specifies the digit that the user needs to enter to finalize the data entry.
  • RequestNumberIsValidDigit_N: When entering the credit card number, specifies what happens when the user presses N. It could be a valid or an invalid digit.
  • RequestExpirationAcceptDtmfInput: When entering the expiration date, true to accept DTMF input during prompt playback. False otherwise.
  • RequestExpirationMaxRetryCount: When entering the expiration date, number of retry attempts for invalid input or timeout. The retry counter is unique, and counts invalid inputs or no inputs using the same counter.
  • RequestExpirationInitialPrompts: When entering the expiration date, the list of prompts to play the first time the menu is executed.
  • RequestExpirationSubsequentPrompts: When entering the expiration date, the list of prompts to play subsequent times (after a timeout or invalid digit).
  • RequestExpirationTimeoutPrompts: When entering the expiration date, the list of prompts to play when the user does not enter any digits. After playing the timeout prompts, the subsequent prompts are played.
  • RequestExpirationInvalidDigitPrompts: When entering the expiration date, the list of prompts to play when the user enters invalid digits. After playing the invalid digit prompts, the subsequent prompts are played.
  • RequestExpirationFirstDigitTimeout: When entering the expiration date, the time to wait for the first digit, before playing the specified timeout prompts, in seconds.
  • RequestExpirationInterDigitTimeout: When entering the expiration date, the time to wait for subsequent digits, before playing the specified invalid digits prompts, in seconds.
  • RequestExpirationFinalDigitTimeout: When entering the expiration date, the time to wait for digits after MinDigits has been reached, before returning the entered data, in seconds.
  • RequestExpirationMinDigits: When entering the expiration date, the minimum quantity of digits that must be entered by the user.
  • RequestExpirationMaxDigits: When entering the expiration date, the maximum quantity of digits that can be entered by the user.
  • RequestExpirationStopDigit: When entering the expiration date, specifies the digit that the user needs to enter to finalize the data entry.
  • RequestExpirationIsValidDigit_N: When entering the expiration date, specifies what happens when the user presses N. It could be a valid or an invalid digit.
  • RequestSecurityCodeAcceptDtmfInput: When entering the security code, true to accept DTMF input during prompt playback. False otherwise.
  • RequestSecurityCodeMaxRetryCount: When entering the security code, number of retry attempts for invalid input or timeout. The retry counter is unique, and counts invalid inputs or no inputs using the same counter.
  • RequestSecurityCodeInitialPrompts: When entering the security code, the list of prompts to play the first time the menu is executed.
  • RequestSecurityCodeSubsequentPrompts: When entering the security code, the list of prompts to play subsequent times (after a timeout or invalid digit).
  • RequestSecurityCodeTimeoutPrompts: When entering the security code, the list of prompts to play when the user does not enter any digits. After playing the timeout prompts, the subsequent prompts are played.
  • RequestSecurityCodeInvalidDigitPrompts: When entering the security code, the list of prompts to play when the user enters invalid digits. After playing the invalid digit prompts, the subsequent prompts are played.
  • RequestSecurityCodeFirstDigitTimeout: When entering the security code, the time to wait for the first digit, before playing the specified timeout prompts, in seconds.
  • RequestSecurityCodeInterDigitTimeout: When entering the security code, the time to wait for subsequent digits, before playing the specified invalid digits prompts, in seconds.
  • RequestSecurityCodeFinalDigitTimeout: When entering the security code, the time to wait for digits after MinDigits has been reached, before returning the entered data, in seconds.
  • RequestSecurityCodeMinDigits: When entering the security code, the minimum quantity of digits that must be entered by the user.
  • RequestSecurityCodeMaxDigits: When entering the security code, the maximum quantity of digits that can be entered by the user.
  • RequestSecurityCodeStopDigit: When entering the security code, specifies the digit that the user needs to enter to finalize the data entry.
  • RequestSecurityCodeIsValidDigit_N: When entering the security code, specifies what happens when the user presses N. It could be a valid or an invalid digit.

When the “Credit Card” component collects the

Number
,
Expiration Date
and
Security Code
, the execution continues on the “Valid Input” branch, and the component exposes the following output properties:

  • Number: the digits entered by the user for the credit card number, not including the
    StopDigit
    if it was entered.
  • Expiration: the digits entered by the user for the expiration date, not including the
    StopDigit
    if it was entered.
  • SecurityCode: the digits entered by the user for the security code, not including the
    StopDigit
    if it was entered.
  • Validated: a boolean property that must be set to true for notifying the Credit Card component that the Number, Expiration Date and Security Code are valid, so it avoids asking again for this information.

When the “Credit Card” component cannot collect the

Number
,
Expiration Date
or
Security Code
, the execution continues on the “Invalid Input” branch, where, for example, you can play a message. Then the component retries the credit card info collection until the
MaxRetryCount
is reached.

Survey

Survey component options in 3CX Call Flow Designer

This component enables asking questions and collecting the caller’s answers in a CSV file. The answers are also provided as an output property for alternate processing, e.g. sending via email, saving to a database, etc.

When the component starts executing, it plays the “Introductory Prompts”, then plays the prompts for the first question and waits for an answer. It plays questions and collects answers until all questions are answered, and then plays the “Goodbye Prompts”. When the user does not provide any answer, or enters an invalid DTMF digit, the “Timeout” or “Invalid Digit” prompts are played respectively, and the question is repeated until “Max Retries” is reached.

When the

Allow Partial Answer
option is set, if a user hangs up before answering all the questions, the answers provided until then will be written to the results file. Otherwise, partial answers will be discarded.

You can use these types of questions:

  1. “Yes / No”: the user can choose the “YES” and “NO” valid options, based on the configured  DTMF code for each one.
  2. “Range”: the user can answer with a DTMF code within the configured range of valid options, denoted by the start and end of the range.
  3. “Recording”: the caller can provide a recorded answer, to be optionally played back to confirm, or discard and repeat recording. Recorded answers are saved in the folder specified by the property “RecordingsPath”, with random file names and an embedded timestamp. E.g.
    SurveyRecording_20190909130306_1157558616.wav
    , or in a default folder if this property is not set.

Questions are labelled with a “Tag” value, included as a header in the generated CSV output to help map questions to answers. Depending on the value of the

Allow Partial Answer
option, the CSV file output is written only when all questions are answered (discarding incomplete surveys), or written as soon as one question has an answer.

💡 Tip: This component also accepts output fields, i.e. values collected in a different part of the app that can be included in the generated output. For example, caller input from a previously defined step in the Call Flow app, or info retrieved from a database prior to calling the “Survey” component.

The component’s input properties are:

  • AcceptDtmfInput: True to accept DTMF input during prompt playback. False otherwise.
  • MaxRetryCount: Counts the unique number of retry attempts for invalid or no input. This is a single counter for all the questions, e.g. setting the value to 3 while the caller provides an invalid answer for 3 different questions, the survey is aborted.
  • Timeout: The time to wait for user input in seconds, before playing the timeout prompt(s).
  • AllowPartialAnswers: When the value is set to true, the component will save the results to the CSV file even when the user hangs up before answering all the questions. As long as there is 1 question answered, results will be saved.
  • IntroductoryPrompts: The list of prompts to play when the survey starts.
  • GoodbyePrompts: The list of prompts to play when the survey ends.
  • TimeoutPrompts: The list of prompts to play on no user input. After playing the timeout prompts, if there are still retries available, the question prompts are played again.
  • InvalidDigitPrompts: The list of prompts to play on invalid user input. After playing the invalid digit prompts, if there are still retries available, the question prompts are played again.
  • ExportToCSVFile: The relative or full path to the file for saving the results. The value is an expression. If a relative path is provided, results are written in this folder:
  • Windows:
    C:\ProgramData\3CX\Instance1\Data\Callflows\Surveys\project
  • Linux:
    /var/lib/3cxpbx/Instance1/Data/Callflows/Surveys/project
  • RecordingsPath: The relative or full path to the recordings folder, used when recording question(s) are configured. The value is an expression. If a relative path is used, or the property is not set at all, recordings are saved in this folder:
  • Windows:
    C:\ProgramData\3CX\Instance1\Data\Ivr\Prompts\Callflows\project\Surveys
  • Linux:
    /var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/project/Surveys
  • OutputFields: The list of output fields to include in the generated CSV file output, with the name included as column title, and the corresponding value as data entry.
  • SurveyQuestions: The list of questions to ask the caller, with questions having some common properties, and specific properties per type. The common properties are:
  • Tag: a question identifier, included in the generated output as column title for the CSV file to map questions to answers.
  • Prompts: the list of prompts to play for the question.

The specific properties for each question type are:

  • “Yes / No” questions:
  • Yes Answer: the DTMF code for YES.
  • No Answer: the DTMF code for NO.
  • “Range” questions:
  • Range Initial Answer: the DTMF code for the start of the valid options range.
  • Range Final Answer: the DTMF code for the end of the valid options range.
  • “Recording” questions:
  • Offer Playback: when enabled, the recording is played back to callers to confirm or discard.
  • Max Duration (seconds): the maximum duration to record.
  • Pre Recording Prompts: the list of prompts to play before playing the recording back to the user, e.g. “This is the audio you just recorded”.
  • Post Recording Prompts: the list of prompts to play after playing the recording back to the user, e.g. “To save, press 1, to discard and record again, press 2”.
  • Keep Recording Answer: the DTMF code for keeping the recording.
  • Record Again Answer: the DTMF code for discarding the recording and recording again.

The “Survey” component exposes these output properties after execution:

  • Result: the survey results in CSV (Comma Separated Values) format, i.e. the output written to the CSV file and also exposed as an output property for alternate processing by the app.
  • ResultHeaders: the list of column titles in CSV format, including the output field names followed by the question tags.

Prompt Playback

This component allows playing a list of prompts. The input properties are the following:

  • AcceptDtmfInput: True to accept DTMF input during prompt playback. False otherwise.
  • Prompts: The list of prompts to play when the component is executed.

Record

Record component configuration in 3CX CFD

This component records audio from the caller. Before recording, the list of prompts specified is played. If the Beep property is set, a beep is played to the caller after the prompts and before starting recording. The recording finishes when the seconds specified in MaxTime are reached, the caller presses a DTMF key when the TerminateByDtmf property is set, or when the caller hangs up. The recorded audio can be automatically saved to a file. The input properties are the following:

  • Beep: If true, a tone is emitted just before recording starts.
  • Prompts: The list of prompts to play before recording (available prompt types are described in Prompt Types).
  • MaxTime: The maximum duration to record, in seconds.
  • TerminateByDtmf: If true, any DTMF key entered stops the recording.
  • SaveToFile: If true, the recorded audio is saved to the file specified by FileName. The value is an expression.
  • FileName: The name of the file where the recording must be saved. Only valid when SaveToFile evaluates to true. The value is an expression.

When the recording ends, execution continues on one of its branches (“Audio Recorded” or “Nothing “Recorded”). If the recording ends because the caller hangs up, the recording file will be saved in the specified location, but the execution will continue in the Disconnect Handler flow. As a consequence, you should consider adding logic to the Disconnect Handler flow in order to deal with this case.

The “Record” component exposes the following output properties after execution:

  • Result: the recording result:
  • RecordResult.NothingRecorded: no audio recorded.
  • RecordResult.StopDigit: recording was stopped by a DTMF key press.
  • RecordResult.Completed: recording was stopped by reaching the maximum audio length.
  • Duration: the duration of the recorded audio in seconds.
  • StopDigit: the DTMF digit pressed by the user when Result = RecordResult.StopDigit.
  • AudioId: a variable containing the audio file where the recording is located, which can be used to play it back to the user.

Record and Email

Record and Email component configuration in 3CX CFD

This component records audio from the caller and sends it attached to an email message. Before recording, the list of prompts specified is played. If the Beep property is set, a beep is played to the caller after the prompts and before starting recording. The recording finishes when the seconds specified in MaxTime are reached, the caller presses a DTMF key when the TerminateByDtmf property is set, or when the caller hangs up. The input properties are the following:

  • Beep: If true, a tone is emitted just before recording starts.
  • Prompts: The list of prompts to play before recording (available prompt types are described in Prompt Types).
  • MaxTime: The maximum duration to record, in seconds.
  • TerminateByDtmf: If true, any DTMF key entered stops the recording.
  • Use 3CX Server connection settings: check this option to use the 3CX server mail settings, or leave it unchecked to enter the connection information here.
  • SMTP Server: The SMTP Server name or IP address. The value is an expression.
  • Server Port: The port number where the connection to the SMTP server must be established. The value is an expression.
  • EnableSSL: Specify if the connection to the SMTP Server must be done using SSL or not. The value is an expression.
  • UserName: The username to use when connecting to the SMTP Server. The value is an expression.
  • Password: The password to use when connecting to the SMTP Server. The value is an expression.
  • From: The email address to use in the 'from' field of the message. The value is an expression.
  • To: The email addresses to use in the 'to' field of the message, separated by comma in case of being more than one. The value is an expression.
  • CC: The email addresses to use in the 'cc' field of the message, separated by comma in case of being more than one. The value is an expression.
  • BCC: The email addresses to use in the 'bcc' field of the message, separated by comma in case of being more than one. The value is an expression.
  • Subject: The subject of the email message. The value is an expression.
  • Body Is HTML: Indicates if the body text is HTML or plain text.
  • Body: The body of the email message. The value is an expression.
  • Priority: The priority of the email message.

Transfer

Transfer component configuration in 3CX CFD

Use this component to perform a blind transfer for the call, i.e. disconnect the call from the CFD application and transfer it to the specified destination. Its input properties are:

  • Destination: The destination number to transfer the call to, as an expression.
  • TransferToVoicemail: Enable to transfer the call to the specified extension’s voicemail.
  • Delay: Enter a delay of up to 2000 milliseconds, after which the call is transferred.

When the transfer is completed, the execution continues on the disconnect handler flow, as the call is disconnected from the application. If the transfer operation fails, the next component after this “Transfer” component is executed.

Attach Call Data

Attach Call Data component configuration in 3CX CFD

This component allows attaching data to the current call, so it can later be retrieved by other participants. The data remains attached to the call when it is transferred, so for example another CFD app processing the call at a later stage can read this information. The input properties are the following:

  • DataName: The key of the data to set. CFD apps can only attach data with keys starting with “public_”. The value is an expression.
  • DataValue: The value of the data to set. The value is an expression.

The “Attach Call Data” component doesn’t expose any output property after execution.

Get Attached Call Data

Get Attached Call Data component configuration in 3CX CFD

This component allows getting data attached to the current call with this input property:

  • DataName: The key of the data to read. The value is an expression.

The “Get Attached Call Data” component exposes this output property after execution:

  • DataValue: contains the value of the data read.

Disconnect Call

This component disconnects the current call. It has no special input properties and does not expose any output property after its execution. When this component execution ends, the execution continues on the Disconnect handler flow.

Make Call

Make Call component configuration in 3CX CFD

This component allows making an outbound call between two parties. The call made is not handled by this voice application. The component instructs 3CX to call the number specified in Origin, put it on hold and then make a call to the number specified as Destination. When both parties are connected to 3CX, they are joined in a call. This component is useful for example to make a call from an internal extension to an external number. The input properties are the following:

  • Origin: The number of the first party of the call. The value is an expression, so you may for example get the number from a database.
  • Destination: The number of the second party of the call. The value is an expression, so you may for example get the number from a database.
  • Timeout: The number of seconds to wait for the call to be established. The application monitors if the call is established after this time, and provide the result afterwards. The application does not move to the next component while the call is being monitored.

When the component execution ends, the following output properties are exposed:

  • Result: a boolean value - true when the call is established between the 2 numbers, false otherwise.

3CX Internal Properties

Get DN Property

Get DN Property component configuration in 3CX CFD

This component allows reading a property value for a specific Dialed Number (DN). The input properties are the following:

  • Extension: The extension number of the DN from which we are reading the property. The value is an expression.
  • PropertyName: The name of the property to read. The value is an expression. Use a property name in upper case.

The “Get DN Property” component exposes the following output properties after execution:

  • PropertyValue: contains the value of the property.

Set DN Property

Set DN Property component configuration in 3CX CFD

This component allows setting a property value for a specific DN. The input properties are the following:

  • Extension: The extension number of the DN to which we are setting the property value. The value is an expression.
  • PropertyName: The name of the property to set. The value is an expression. Use a property name in upper case.
  • PropertyValue: The value of the property to set. The value is an expression.

The “Set DN Property” component doesn’t expose any output property after execution.

Important note: property names must be upper case.

Get Global Property

Get Global Property component configuration in 3CX CFD

This component allows reading a global property value. Its input properties are:

  • PropertyName: The name of the property to read. The value is an expression. Use a property name in upper case.

The “Get Global Property” component exposes the following output properties after execution:

  • PropertyValue: contains the value of the property.

Set Global Property

Set Global Property component configuration in 3CX CFD

This component allows setting a global property value. Its input properties are:

  • PropertyName: The value is an expression. Use a property name in upper case.
  • PropertyValue: The value of the property to set. The value is an expression.

The “Set Global Property” component does not expose any output property after execution.

Get Extension Status

Get Extension Status component configuration in 3CX CFD

This component allows getting the status of a specific extension. It just needs the extension number as input to indicate if the extension is in a call or not, and the current profile considering overrides. The input properties are the following:

  • Extension: The extension number from which we want to get the status. The value is an expression.

The “Get Extension Status” component exposes the following output properties after execution:

  • IsInCall: contains a boolean indicating if the extension is currently handling a call or not.
  • CurrentProfile: a FwdProfile object with the information of the current profile, considering overrides.
  • CurrentProfileName: a string with the current profile name, considering overrides.

Set Extension Status

Set Extension Status component configuration in 3CX CFD

This component allows setting the status of a specific extension. The input properties are the following:

  • Extension: The extension number that we want to set the status to. The value is an expression.
  • Status: the status to set.

The “Set Extension Status” component doesn’t expose any output property after execution.

Get Queue Extensions

Get Queue Extensions component configuration in 3CX CFD

This component allows getting the extensions / agents for a queue. We can configure it to return all the extensions for the queue, only the ones that are logged in, or the ones that are logged out. The input properties are the following:

  • Queue Extension: The extension number of the queue from which we want to get the list of extensions. The value is an expression.
  • Query Type: the type of query we want to do. Select “All” to return all the extensions for this queue, select “LoggedIn” to return the extensions that are logged in to this queue, or select “LoggedOut” to return the extensions that are logged out from this queue.

The “Get Queue Extensions” component exposes the following output properties after execution:

  • ExtensionList: a list of Extension objects containing all the extensions that satisfy the type of query performed.
  • ExtensionNumberList: a list of strings with the extension numbers that satisfy the type of query performed.

To get the values from the resulting lists, we need to use the following CFD Functions:

  • GET_LIST_ITEM_COUNT: this function provides the number of items in the list.
  • GET_LIST_ITEM: this function returns the item at a specific index.

Get Queue Status

Get Queue Status component configuration in 3CX CFD

This component allows getting the status for a queue, returning the number of calls waiting to be served, the number of calls actually being served, and the number of available agents. The input properties are the following:

  • Queue Extension: The extension number of the queue from which we want to get the status. The value is an expression.

The “Get Queue Status” component exposes the following output properties after execution:

  • CallsWaiting: the number of calls waiting on the queue, i.e. listening to music on hold until an agent gets free.
  • BusyAgents: the number of busy agents, i.e. logged out of the queue, not registered with 3CX or with an active call.
  • AvailableAgents: the number of free agents ready to take a call, i.e. logged in to the queue, registered with 3CX and without an active call.

Set Queue Extension Status

Set Queue Status component configuration in 3CX CFD

This component allows setting the queue status of a specific extension. It’s possible to set the global queue status (login or logout from all queues), or for a specific queue. The input properties are the following:

  • Mode: Set it to “Global” in order to set the queue status for all queues. Set it to “SpecificQueue” to apply the change only for a specific queue.
  • Extension: The extension number that we want to set the status to. The value is an expression.
  • Queue Extension: The extension number of the queue to which the extension will be logged in or out. Only valid when Mode is “SpecificQueue”. The value is an expression.
  • Status: the status to set.

The “Set Queue Extension Status” component doesn’t expose any output property after execution.

💡 Tip: When the extension has a global queue logout status, changing the status for a specific queue will not be considered, because the global status prevails. In that case, change the global status to login, and then you can login or logout from specific queues.

Application Tools

Encryption

Encryption component configuration in 3CX CFD

This component enables to encrypt and decrypt data and perform hash calculations on a text expression, returning a string. The supported algorithms are:

  • TripleDES to encrypt and decrypt text using a known key. When the TripleDES algorithm is used, the key must be a 24-character string.
  • MD5 for performing one-way hash calculation, i.e. the original value cannot be obtained back from the computed hash.

The result of the encryption and the MD5 hash calculation is an array of bytes. The CFD needs to encode the array of bytes to store them as a string in two encoding formats:

  • hexadecimal - consists of the representation of each byte as two characters that represent the byte value in hexadecimal, i.e. from 00 to FF.
  • Base64 - encode the bytes according to this industry standard format.

The input properties for the “Encryption” component are:

  • Algorithm: The algorithm to use, i.e. TripleDES or HashMD5.
  • Format: The encoding format to use for transforming the encrypted Hexadecimal or Base64 stream into text. When encrypting data, this is how the result is codified. When decrypting data, this is how the input text arrives.
  • Action: The action to perform when algorithm is TripleDES, i.e. “Encrypt” or “Decrypt”.
  • Key: The 24-character long secret key used by the TripleDES algorithm.
  • Text: The expression value text to encrypt, decrypt or compute hash.

The “Encryption” component exposes these output properties after execution:

  • Result: Contains the encryption, decryption or MD5 hash result, encoded according to the specified algorithm.

CRM Lookup

CRM Lookup component options in 3CX Call Flow Designer

This component enables executing queries on the CRM configured in the 3CX Management Console. This component requires:

  • A configured “CRM Integration” in 3CX Management Console,
  • 3CX v16 Update 3 or later.

 

You can execute queries on Contacts, Leads or Accounts, as supported by the CRM entity to be used, with the “Lookup By” parameter set to either:

  • “Entity Number” - the component returns the details of the entity with the specified phone number. The
    Lookup Input Parameter
    property needs to be set to an expression returning the number to search, usually the variable
    session.ani
    .
  • “Entity ID” - the component returns the details of the entity with the specified CRM entity ID. The
    Lookup Input Parameter
    property needs to be set to an expression returning the ID of the Contact, Lead or Account to search.
  • “Custom Query” - execute any syntax-dependent CRM query, compliant with the REST API of the specific CRM.

The “CRM Lookup” component exposes these output properties after execution:

  • Result: the full response returned by the CRM, in JSON or XML format depending on the CRM used. You can use this property to pass the response to a C# script and execute your custom parsing logic. Or, you can use the
    Response Mappings
    section to perform a basic mapping from JSON/XML nodes to variables.
     Consider this example for Salesforce:

{

   "attributes":{

      "type":"Contact",

      "url":"/services/data/v37.0/sobjects/Contact/0038000002MFHAECAV"

   },

   "Id":"0038000002MFHAECAV",

   "IsDeleted":false,

   "AccountId":null,

   "LastName":"Doe",

   "FirstName":"John",

   "Phone":"1155550001",

   "Fax":"1155550002",

   "MobilePhone":"1155550003",

   "HomePhone":"1155550004",

   "OtherPhone":"1155550005",

   "AssistantPhone":"1155550006",

   "Email":"[email protected]",

   "AssistantName":"Jane Doe",

   "OwnerId":"00580000001fxBEFAI"

}

Database Access

Database Access with 3CX CFD

This component allows performing operations on Microsoft SQL Server, PostgreSQL and MySQL databases. You can execute these statement types:

  • Query  - statements return a list of records, e.g. “SELECT * FROM TABLE”.
  • NonQuery - statements perform an insert or modification, and return the quantity of affected records. For example, “INSERT VALUES (VALUE1) INTO TABLE”.
  • Scalar - statements perform data search but return a unique value. For example, “SELECT COUNT(*) FROM TABLE”.

This component has the following input properties:

  • DatabaseType: The type of the database, i.e. SqlServer, PostgreSQL or MySQL.
  • UseConnectionString: True to set a connection string, or False to set each property separately.
  • ConnectionString: The database connection string. Only valid when UseConnectionString is set to True. The value is an expression.
  • Server: The database server name or IP address. Only valid when UseConnectionString is set to False. The value is an expression.
  • Port: The port number where the connection must be established. Only valid when UseConnectionString is set to False. The value is an expression.
  • Database: The database to use when connecting to the Server. Only valid when UseConnectionString is set to False. The value is an expression.
  • UserName: The username to use when connecting to the database. Only valid when UseConnectionString is set to False. The value is an expression.
  • Password: The password to use when connecting to the database. Only valid when UseConnectionString is set to False. The value is an expression.
  • StatementType: The type of the statement. Use Query to execute a SQL statement that returns rows (for example, SELECT). Use NonQuery to execute a SQL statement that doesn't return rows (for example, INSERT, DELETE, UPDATE). Use Scalar to execute a SQL statement that returns a single value (for example, SUM, COUNT).
  • Timeout: The time to wait in seconds before terminating the attempt to execute a SQL statement and generating an error. A value of 0 indicates no limit, and should be avoided because an attempt to execute a SQL statement could wait indefinitely.
  • SqlStatement: An expression returning the SQL statement to execute.

In some cases, setting the server, port, database, username and password separately is not enough, as some special property might be needed to connect to the database. In those cases, it is possible to set the connection string directly for SQL Server, PostgreSQL or MySQL.

The “Database Access” component exposes these output properties after execution, containing the processing result according to the type of the selected statement:

  • QueryResult: a table containing every row returned from the database. The expression editor functions GET_TABLE_ROW_COUNT and GET_TABLE_CELL_VALUE allow reading the whole table. The first function returns the quantity of records in the table, so it can be stepped through with the Loop component. The second function allows obtaining the cell value specifying the row and column numbers. Indexes start from zero.
  • NonQueryResult: the number of rows affected by the statement as an integer value.
  • ScalarResult: the single value returned by the database.

📄 Note: When building expressions the result property available is based on the type of the selected statement. If you change the statement type, you need to update the result property used in other components, otherwise an “invalid expression” compilation error occurs when building the app.

EMail Sender

EMail Sender component configuration in 3CX CFD

This component allows sending email messages, including attachments. You can use authenticated connections with username and password, specify the sender and recipient addresses (To, CC or BCC), set the subject, message body and file attachments. The input properties are the following:

  • Use 3CX Server connection settings: check this option to use the 3CX server mail settings, or leave it unchecked to enter the connection information here.
  • SMTP Server: The SMTP Server name or IP address. The value is an expression.
  • Server Port: The SMTP server port number to establish the connection. The value is an expression.
  • EnableSSL: Specify if the connection to the SMTP Server must be done using SSL or not. The value is an expression.
  • UserName: The username to use when connecting to the SMTP Server. The value is an expression.
  • Password: The password to use when connecting to the SMTP Server. The value is an expression.
  • From: The email address to use in the 'from' field of the message. The value is an expression.
  • To: The email addresses to use in the 'to' field of the message, separated by comma in case of being more than one. The value is an expression.
  • CC: The email addresses to use in the 'cc' field of the message, separated by comma in case of being more than one. The value is an expression.
  • BCC: The email addresses to use in the 'bcc' field of the message, separated by comma in case of being more than one. The value is an expression.
  • Subject: The subject of the email message. The value is an expression.
  • Body Is HTML: Indicates if the message body type is HTML or plain text.
  • Body: The body of the email message. The value is an expression.
  • Priority: The priority of the email message.
  • Ignore Missing Attachments: If a missing file attachment(s) event occurs on runtime,
    True
    silently ignores this event, “False” throws a runtime error.
  • Attachments: The list of attachments to send with the email message. When sending attachments, the attachment name is a constant string value and does not require quotes. Attachment files are set using an expression that returns the path to the file on the 3CX server. To create the expression for the attachment file on the server, click on the ellipsis button at the end of each grid row.

Execute C# File

Execute C# File component configuration in 3CX CFD.

This component allows executing C# code (.NET Core 2.1) from a C# file in the “Libraries” folder of the project. You need to specify the class name and the method name. The application creates an instance of the specified object and invokes the specified method on that instance, using the list of parameters provided. As a result, the method must NOT be a static method. Its input properties are the following:

  • C# File: The C# file containing the code to execute. Please note that you must use .NET Core 2.1 code. Also, it is important that your C# script doesn’t include any namespace declaration. You just need to provide the class to be included in the app namespace.
  • ClassName: The class name of the object to create, not including any namespace.
  • MethodName: The name of the method to execute. An object of type
    ClassName
    is created and the method is executed on that object instance.
  • ReturnsValue:
    True
    if the method returns a value, or
    False
    otherwise.
  • Parameters: An ordered list of parameters used when invoking the method. The order is important, and must be aligned with the method signature. For each parameter, you need to specify the name (which is just for your information and is not used to validate against the method to call), the type, and the value which can be an expression.

The C# File is selected from a dropdown list, which contains every C# file from the “Libraries” folder of the project. You can browse for the C# file in your file system if it is not listed. When a file is selected, the “C# Code” field of the component configuration dialog, shows the file content as read-only.

Parameter names are constant string values and do not require quotes. Parameter values are set using an expression. To create a parameter expression, click on the ellipsis button at the end of each grid row.

The “Execute C# File” component exposes the following output properties after execution:

  • ReturnValue: contains the value returned by the method called.

Execute C# Code

Execute C# Code component configuration in 3CX CFD.

This component allows executing C# code (.NET Core 2.1), edited via the component configuration dialog. This is very useful for simple C# expressions, as everything you need is included in the component configuration and a separate C# file is not needed. You just specify the method name, the code and the parameters. The application invokes the specified method, using the list of parameters provided. The input properties are the following:

  • MethodName: The name of the method to execute.
  • ReturnsValue:
    True
    if the method returns a value, or
    False
    otherwise.
  • Parameters: A list of parameters used when invoking the method. For each parameter, you need to specify the name, the type, and the value which can be an expression. This information is used along with the method name to create the method signature.
  • Code: The C# code to use as the method body. This code must not have the method signature, because that is automatically created from the method name and the list of parameters.

Parameter names are constant string values and do not require quotes. Parameter values are set using an expression, created by clicking on the ellipsis button at the end of each grid row.

The “Execute C# Code” component exposes these output properties after execution:

  • ReturnValue: contains the value returned by the method called.

Read / Write to File

Read / Write to File component configuration in 3CX CFD.

This component enables reading and writing text files:

  • Read - performed line by line, with options to specify the index of the first line (0) to be read, the number of lines to read and if to enable reading the entire file at once.
  • Write - allows opening the file in different modes: “Append”, “Create”, “CreateNew”, “Open”, “OpenOrCreate” and “Truncate”. The “Append” mode adds the text at the end of the file. The “Create” mode creates the file if it does not exist, or truncates it if it already exists, so it always starts with an empty file. For the “CreateNew” to succeed, the file must not exist. The “Open” mode opens the file as it is, and writes to it from the beginning, overriding what was in it, while the “OpenOrCreate” is almost the same but if the file doesn’t exist, it creates it. Finally the “Truncate” mode opens an existing file and truncates it. The data to be written is the information in the “Content” property. If the “AppendFinalCrLf” property is set,
    Carriage Return
    and
    Line Feed
    characters are added at the end of the line.

The component has these input properties:

  • FileName: The expression value for the absolute path to the file to read or write.
  • OpenMode: Use “Append”, “Create”, “CreateNew”, “Open”, “OpenOrCreate” or “Truncate” when
    Action
    is “Write”. Use “Open” or “OpenOrCreate” when
    Action
    is “Read”.
  • Action: The action to perform, i.e. “Read” or “Write”.
  • Content: The text to write to the file. Only valid when
    Action
    is “Write”. The value is an expression.
  • AppendFinalCrLf:
    True
    to append a final
    CR LF
    after writing to the file, when
    Action
    is “Write”.
  • LinesToRead: The number of lines to read from the file, when
    Action
    is “Read”. The value is an expression.
  • FirstLineToRead: The zero-based index of the first line to read from the file, when
    Action
    is “Read”. The value is an expression.
  • ReadToEnd: Overrides “LinesToRead”, reading until the end of file is reached, when
    Action
    is “Read”. The value is an expression.

The “Read / Write to File” component exposes these output properties after execution:

  • EofReached: indicates if the end of the file has been reached when
    Action
    is “Read”.
  • Result: contains the text that has been read from the file when
    Action
    is “Read”.

Open a Socket

Open a Socket component configuration in 3CX CFD.

This component allows sending and receiving data using TCP or UDP protocols. You need to specify the destination server and port, along with the information to be sent. If the property “WaitForResponse” is set, it waits for a response from the server, otherwise it closes the socket immediately after the information is sent. Its input properties are:

  • ConnectionType: The type of the connection to establish, i.e. TCP or UDP.
  • Server Host: The server host name or IP address. The value is an expression.
  • Port: The port number where the server is listening for incoming connections. The value is an expression.
  • Data: The data to send to the server. The value is an expression.
  • WaitForResponse:
    True
    to wait for a response after sending the data. False otherwise.

This component exposes the following output properties after execution:

  • Response: contains the server response if the “WaitForResponse” property was set.

HTTP Requests

HTTP Request component configuration in 3CX CFD.

This component sends HTTP requests to a web server. You can use all the methods available (DELETE, GET, HEAD, OPTIONS, POST, PUT, TRACE). Its input properties are:

  • URI: The URI where the request must be sent. The value is an expression.
  • RequestType: The type of the HTTP request. Available values are DELETE, GET, HEAD, OPTIONS, POST, PUT, TRACE.
  • Content-Type: When the HTTP request needs to send content to the server, this property specifies the content type.
  • Content: When the HTTP request needs to send content to the server, this property specifies the actual content. The value is an expression.
  • Timeout: The time to wait for the HTTP request to complete, in seconds. Zero means to wait forever.
  • Headers: A list of headers to send in the request. Each header can be set using an expression. The Header names are constant string values and do not require quotes. The header values are expressions. To create an expression for a header value, click on the ellipsis button at the end of each grid row.

The “HTTP Requests” component exposes these output properties after execution:

  • ResponseStatusCode: contains the HTTP status code returned by the web server, e.g. 200 (OK) means that the request was processed successfully.
  • ResponseContent: this property contains the response from the web server.

Web Service REST

Web Service REST component configuration in 3CX CFD.

This component allows executing REST web services, sending HTTP requests to the server using all the methods available (DELETE, GET, HEAD, OPTIONS, POST, PUT, TRACE), and supporting different types of authentication out of the box. Its input properties are:

  • URI: The URI where the request must be sent. The value is an expression.
  • RequestType: The type of the HTTP Request. Available values are DELETE, GET, HEAD, OPTIONS, POST, PUT, TRACE.
  • Content-Type: When the HTTP request needs to send content to the server, this property specifies the content type.
  • Content: When the HTTP request needs to send content to the server, this property specifies the actual content. The value is an expression.
  • Timeout: The time to wait for the HTTP request to complete, in seconds. Zero means to wait forever.
  • Authentication: The type of authentication used by the REST web service. You can use:
  • None - no authentication.
  • Basic - Username and Password: authentication via username and  password.
  • Basic - API Key: use basic authentication via an API Key.
  • OAuth2: use OAuth2 via an Access Token.
  • Headers: A list of headers to send in the request. Each header can be set using an expression. The header names are constant string values and do not require quotes. The header values are expressions. To create an expression for a header value, click on the ellipsis button at the end of each grid row.

The “Web Service REST” component exposes these output properties after execution:

  • ResponseStatusCode: contains the HTTP status code returned by the web server, e.g. 200 (OK) means that the request was processed successfully.
  • ResponseContent: this property contains the response from the web server.

JSON / XML  Parser

JSON / XML Parser Wizard in 3CX CFD

This component allows parsing JSON and XML, mapping nodes to variables. Its input properties are:

  • Text Type: The type of text to parse: JSON or XML.
  • Input: The text to parse. This can be taken from a variable, or the output of existing components. In this way, for example, you can assign this property to:
  • Response Mappings: How to map JSON or XML nodes to variables with:
  • “Path” - specifies what to search for in the response: a JPath expression for JSON, or an XPath expression for XML.
  • “Variable” - the name of the variable where this value is saved.

To simplify the task of configuring this component, use the provided wizard, to choose the input type, i.e., JSON or XML. and then select the input source:

  • “Invoke web request component from project” - This option is only enabled if there are “HTTP Request” or “Web Service REST” components in the callflow.
  1. Selecting this option, you need to specify values for the variables used for the HTTP request invocation, to evaluate expressions at design time and send a real HTTP request to the server. The real JSON or XML response received back will be used in the next step.

JSON / XML Parser Wizard in 3CX CFD

  1. When the component is being configured performing a real HTTP request, the JSON or XML response is automatically converted to a tree view. You can easily drag nodes from the tree view, and drop them on the right side panel, to add a response mapping row. Then select the variable where you want to store this value.
  • “Use component output or variable” - This option lets you select a component output or variable as input source.
  1. The selected component or variable will not be evaluated at design time, so you will need to enter a sample JSON or XML in the next step, in case you want to easily create the response mapping paths.

JSON / XML Parser Wizard in 3CX CFD.

  1. When the configuration is done by selecting a component output or variable, you can click the “Start Now” button on the left-hand side of the wizard and paste a sample JSON or XML. The sample is then converted to a tree view, so you can operate in the same way as before. In addition, you can manually add the response mapping rows on the right.

The “JSON / XML Parser” component stores the result into variables according to the configured response mappings, so it does not expose any output property after its execution.

CSV Parser

CSV Parser component configuration in 3CX CFD

This component allows parsing CSV text, converting it into a table. Then, you can use the

GET_TABLE_CELL_VALUE
function to retrieve a value from a specific cell in this table.

This component has the following input properties:

  • Text: The CSV text to parse. This will usually be the result of reading a CSV file, but you can also provide text obtained from another source.

The “CSV Parser” component exposes these output properties after execution, containing the parsing result:

  • Result: a table containing rows and columns with the CSV parsing result. Each row will be a line in the provided CSV text. Each column will be a value from this line, considering the comma as the value separator. The expression editor functions GET_TABLE_ROW_COUNT and GET_TABLE_CELL_VALUE allow reading the whole table. The first function returns the quantity of records in the table, so it can be stepped through with the Loop component. The second function allows obtaining the cell value specifying the row and column numbers. Indexes start from zero.

Transcribe Audio

Transcribe Audio component configuration in 3CX CFD

To use this component, you need to configure Online Services for Speech to Text. Please follow this guide for instructions on how to configure Google Cloud Speech to Text.

This component allows converting speech to text, taking the audio from a WAV file. There is no need to do this having an established call, the audio file can be taken from a different source, and not be related to a phone call.

In some cases you want to provide hints to the Speech to Text engine, so it knows what the user might say, and improve the recognition of specific words or phrases. For example, suppose that your audio data often includes the word “weather”. When Speech-to-Text encounters the word “weather”, you want it to transcribe the word as “weather” more often than “whether”. Also, in some cases you might want to recognize numbers or spelled letters, so you can provide known tokens for this. The Hint Builder is a dialog similar to the Expression Editor that you are already familiar with, which is very helpful to create hints concatenating constant text with tokens. Please note that available tokens are different for each language, so refer to the Speech to Text engine documentation for updated information on this.

This component has the following input properties:

  • LanguageCode: The language to recognize as a BCP-47 language tag. Example: "en-US".
  • FileName: The name of the file from which the audio will be transcribed. The
    FileName
    can be a full path in the 3CX server, or a relative path, in which case the file will be read from the CFD audio folder. The audio folders are:
  • Windows: “C:\ProgramData\3CX\Instance1\Data\Ivr\Prompts\Callflows\”
  • Linux: “/var/lib/3cxpbx/Instance1/Data/Ivr/Prompts/Callflows/”
  • Hints: A list of hints, composed by constant text or tokens, that help the speech recognition engine to properly understand what the recording contains.

The “Transcribe Audio” component exposes these output properties after execution:

  • RecognizedText: the full text recognized by the Speech to Text engine.

User Defined Components

User-defined components are automatically added to the toolbox. They can be used to group common functionality, reduce diagram complexity and as a localized error handler or disconnect handler.

Public properties exposed by these components are automatically shown in the “Properties” panel. The user can set an expression to those properties to customize the component behaviour.

A component can internally update property values, so they can be used as component output as well.

See Also

Last Updated

This document was last updated on 12th December 2023

https://www.3cx.com/docs/manual/cfd-components/