Skip to content

Flow Designer Activities ​

Below is the list of activities you can use to build telephony flows, IVRs, bots, webhooks, the blacklist and much more. Each activity shows the types of flow where it is available. Let's get started!

How values and variables are written ​

The same activity name can behave differently depending on the type of flow, because there are two engines behind the Flow Designer:

  • Bots, bot functions, webhooks, events, channel providers and the blacklist run in uContact. The text of every property is evaluated as a JavaScript template string, so you insert a variable with ${NAME} (for example Hello ${CLIENT_NAME}). Variables are JavaScript variables: you can read them in Evaluate and Procedure with their plain name (CLIENT_NAME), and access JSON fields with dot notation (ORDER.status).
  • Telephony flows, IVRs and IVR functions are converted into Asterisk dialplan. Variables are channel variables (${option}), you can use Asterisk functions (${JSON_DECODE(response,status)}, ${CALLERID(num)}) and expressions are written as $[...] ($["${option}" = "2"]). See Asterisk for the syntax.

Some telephony activities ask for the name of a variable (write phone), while others ask for a value (write ${phone}). Each property says which one it expects.

Bot start Bot ​

This activity is the mandatory starting node in every bot flow. When it runs, it initializes the context variables with the information of the incoming interaction.

Properties ​

  • Timeout: minutes the bot waits for a message from the customer. The counter restarts every time the bot reads a message (Read message, Read file message) or a Wait bot is resumed with Resume. If it is empty or 0, it waits 30 minutes. When the time runs out, the interaction is finished.
  • Timeout message: message sent to the customer when the timeout expires, right before the interaction is finished. It can include flow variables. If it is empty, the interaction is finished without sending a message.

Available variables ​

The following variables are initialized at the start of the flow, whatever the channel:

  • CHANNEL: channel through which the interaction arrives (e.g. webchat, sms, whatsapp, email, messenger, instagram).
  • GUID: unique identifier of the interaction.
  • CAMPAIGN: campaign the interaction belongs to.
  • VARIABLES: JSON object with the data of the interaction. When the bot ends or transfers the interaction, the content of VARIABLES is saved back into the interaction, so whatever you add to it (for example with Procedure: VARIABLES.orderId = "A-1029") can be read later in forms and in the interaction details. The Data activity writes into its automation section (data.data.automation in the interaction record).

Additionally, depending on the channel, the following variables are initialized:

WebChat ​

  • CLIENT_ID: customer identifier.
  • PHONE_NUMBER: customer's phone number.
  • CLIENT_NAME: customer's name.
  • INITIAL_MESSAGE: first message sent by the customer.

SMS ​

  • CLIENT_ID: customer identifier.
  • SMS_PROVIDER_TYPE: SMS provider type.
  • INITIAL_MESSAGE: first message received.
  • CLIENT_NAME: customer's name.

Messenger ​

  • CLIENT_ID: customer identifier.
  • CLIENT_NAME: customer's name.
  • PAGE_NAME: name of the page that received the message.
  • INITIAL_MESSAGE: first message received.

Email ​

  • EMAIL_BODY: body of the last email received in the interaction.
  • EMAIL_SUBJECT: email subject.
  • CLIENT_NAME: sender's name.
  • CLIENT_ID: sender's email address.

WhatsApp ​

  • CLIENT_ID: customer identifier.
  • PROVIDER: configured WhatsApp provider.
  • INITIAL_MESSAGE: first message received.
  • CLIENT_NAME: customer's name.

Instagram ​

  • CLIENT_ID: customer identifier.
  • INITIAL_MESSAGE: first message received.
  • CLIENT_NAME: customer's name.

What happens if an activity fails ​

If an activity throws an error (for example, a Procedure with invalid JavaScript or a Data with invalid JSON), the flow stops and the interaction is finished. The error is shown in the flow console and written to the flow log.

Function start IVR Bot ​

This is the starting node of a function. A function is a reusable piece of flow that you call from another flow with the Function activity. There are two kinds, and each one has its own starting node; neither has properties.

Looking for the activity that calls a function?

This section describes the node a function starts with. To run a function from a bot, an IVR or another function, and to pass it parameters, use the Function activity.

Bot functions ​

A bot function is created in Automations → Bots, with type Function, and is called from a bot (or from another bot function) with the Function activity.

  • The function runs with the same variables as the bot that called it: it can read them and the changes it makes are visible to the bot when it returns.
  • When the function reaches an activity with no next activity, the bot continues with the activity connected after Function.
  • If no function with that name is deployed, the flow stops and the interaction is finished.

IVR functions ​

An IVR function is created in Automations → IVRs, with type IVR function. It is deployed in the ivrFunction context, with the name of the function as the extension, and is called from an IVR or a telephony flow with the Function activity (it runs as an Asterisk GoSub).

  • The parameters sent by Function arrive as ${ARG1}, ${ARG2}, etc., in the same order.
  • End the function with a Return activity so the call goes back to the flow that called it. The value of Return is available in that flow as ${GOSUB_RETVAL}.

Channel provider start Channel provider ​

This activity is the mandatory starting node in every channel provider flow (the flow of a connector with the Flow provider, for SMS or WhatsApp). The flow runs every time uContact has to send a message through that connector, so it is where you call the provider's API. It has no properties.

Available variables ​

  • AGENT: name of the agent who sends the message.
  • MESSAGE: text of the message to send.
  • TO: destination number or address.
  • ATTACHMENTS: JSON array with the attachments of the message.
  • CAMPAIGN: campaign of the interaction.
  • GUID: unique identifier of the interaction.

Additionally, depending on the channel:

  • SMS_GUID: uContact identifier of the message (SMS channel only).
  • WHATSAPP_GUID: uContact identifier of the message (WhatsApp channel only).

After sending the message, use Message result to store the provider's message ID and result. Learn more in Flows.

IVR start IVR ​

This is the starting node of an IVR, created in Automations → IVRs with type IVR. It has no properties.

The IVR is deployed in the Asterisk dialplan, in its context and with the name of the IVR as the extension. Each activity connected after this node becomes one or more steps (priorities) of that extension, in order. A call reaches the IVR when a campaign or another flow sends it there (for example with Goto).

Telephony start Telephony ​

This is the starting node of a telephony flow. It has no properties: the context and the extension of the flow are shown in the information panel of the designer.

The flow is converted into Asterisk dialplan for that context and extension, and each activity connected after this node becomes one or more steps (priorities), in order. Telephony flows have some activities that IVRs don't (for example Queue, Goto, Attended transfer and Stats).

Blacklist start Blacklist ​

This activity is the mandatory starting node of the blacklist flow. uContact runs that flow before contacting a customer, or when a customer contacts a campaign, if the campaign channel has the inbound or outbound blacklist enabled.

Properties ​

  • Channel: type of interaction the flow is meant for: blacklist or telephony. It is informative: the engine doesn't read it when it runs the flow.

Available variables ​

  • CALL: JSON object with the data to evaluate:
    • CALL.clientId: number or address of the customer.
    • CALL.campaign: campaign.
    • CALL.direction: in (the customer contacts the campaign) or out (the campaign contacts the customer).

The flow must end in a Result activity: Call lets the interaction continue; any other result blocks it and saves the attempt in the blacklist history. If the flow ends without Result, the interaction is allowed.

Webhook start Webhook ​

This activity is the mandatory starting node of a webhook, created in Automations → Functions with type Webhook. It runs every time the webhook URL (https://<instance>/api/webhook/<name>) receives a request, and initializes the context variables with its data. It has no properties.

Available variables ​

  • HEADERS: JSON object with the headers of the request.
  • BODY: JSON object with the body of the request (only if the request has a body).
  • METHOD: HTTP method of the request (GET, POST, PUT, etc.).
  • FORM_PARAMS: JSON object with the form parameters sent in the body (if any).
  • QUERY_PARAMS: JSON object with the query string parameters of the URL (if any).

Use Webhook response to decide what the webhook answers.

Event start Event ​

This activity is the mandatory starting node of an event function, created in Automations → Functions with type Event. It runs every time the selected event occurs. It has no properties.

Available variables ​

  • BODY: JavaScript object with the information of the event. See Webhooks for event notification for the content of each event.
  • URL: URL configured in the event function.

Receive message Webhook Blacklist Channel provider Event ​

This activity injects an incoming message into uContact, as if it had been received from the customer. It is used in webhooks that receive messages from an SMS or WhatsApp provider: the webhook reads the provider's payload and passes the values to this activity, which creates or continues the interaction.

Properties ​

  • From: number or address of the customer who sent the message.
  • Did: number (DID) that received the message. When the flow has no channel of its own (for example, a webhook), uContact uses it to find the connector and decide if the message is SMS or WhatsApp.
  • Id: provider's identifier of the message.
  • Client name: customer's name, if the provider sends it.
  • Attachment: attachments of the message, if any.
  • Message: text of the message.

Example ​

A webhook receives this JSON:

json
{"from":"59899123456","to":"59821234567","id":"wamid.HBg...","text":"Hi!"}

Configuration ​

  • From: ${BODY.from}
  • Did: ${BODY.to}
  • Id: ${BODY.id}
  • Message: ${BODY.text}

The message enters the WhatsApp campaign of the connector with DID 59821234567.

Message result Webhook Blacklist Channel provider Event ​

This activity saves the result of sending a message through a channel provider: the provider's message ID and the result it returned. It is used in the channel provider flow, after calling the provider's API.

  • SMS: the message is saved in the SMS history with that result and ID, so later status updates can find it.
  • WhatsApp: the result is saved as the status description of the message with that ID.

Properties ​

  • Id: provider's identifier of the message.
  • Result: result of the sending, as the provider returns it (for example sent or an error description).

Example ​

After a WebService that stores the provider's answer in SEND_RESPONSE:

  • Id: ${SEND_RESPONSE.messageId}
  • Result: ${SEND_RESPONSE.status}

Message status Webhook Blacklist Channel provider Event ​

This activity updates the status of a message already sent (for example, delivered or read), identified by the provider's message ID. It is used in the webhook that receives the status notifications of an SMS or WhatsApp provider.

Properties ​

  • Id: provider's identifier of the message.
  • Status: new status of the message, for example delivered or read.

Example ​

The provider calls the webhook with {"messageId":"wamid.HBg...","status":"read"}:

  • Id: ${BODY.messageId}
  • Status: ${BODY.status}

Read message Bot ​

This activity waits for the customer's next message and stores its text in a variable. The flow doesn't continue until the message arrives or the time runs out.

  • In SMS, WhatsApp, Instagram and email the text of the message is stored. If the customer shares a location, the location is stored as a JSON string.
  • If the time runs out, the variable is left empty ("") and the flow continues.

Properties ​

  • Variable: name of the variable where the message is stored (for example ANSWER).
  • Timeout: seconds to wait. If it is empty or 0, it waits with no limit of its own (the Timeout of Bot start still applies).

Example ​

Send message asks "What is your order number?", then Read message with Variable ORDER_NUMBER and Timeout 120. Next, an Evaluate with ORDER_NUMBER != "" separates the customers who answered from the ones who didn't.

Read file message Bot ​

This activity waits for the customer's next message and stores its attachments (images, documents, audio) in a variable. It works like Read message, but saves the attachments instead of the text.

Properties ​

  • Variable: name of the variable where the attachments are stored, as a text list. If the message has no attachments or the time runs out, the variable is left empty.
  • Timeout: seconds to wait. If it is empty or 0, it waits with no limit of its own.

Send message Bot ​

This activity sends a message to the customer in the current interaction.

Properties ​

  • Message: text to send. It can include variables, for example Hello ${CLIENT_NAME}, your order ${ORDER.id} is on its way.

Send attachment Bot ​

This activity sends a file (image, video, audio or document) to the customer in the current interaction.

Properties ​

  • Filename (required): name the customer will see. The extension of the URL is added to it (invoice + .pdf).
  • Type: type of attachment: image, video, audio or document.
  • Url (required): public URL of the file. It can be fixed or built with variables, for example https://files.example.com/invoices/${INVOICE_ID}.pdf.
Heads up!
The URL must be public: uContact downloads the file from there to send it.

Send email Telephony IVR Bot ​

There are two Send email activities, one for bots and one for telephony flows and IVRs.

In bots ​

It sends the text of a template as a message in the current interaction. In an email bot, this is the reply email to the customer. The template is looked up by name; if it belongs to another campaign, an empty message is sent.

Properties ​

  • Template: name of the template.
  • Variables: one line per template placeholder, in the form placeholder:VARIABLE. Each ${placeholder} of the template is replaced by the value of the flow variable VARIABLE; if no variable has that name, the text after the colon is used as it is.

Example ​

Template text: Hello ${name}, your ticket ${ticket} was created.

Variables:

txt
name:CLIENT_NAME
ticket:TICKET_ID

In telephony flows and IVRs ​

It sends an email through uContact (with the email account configured in the instance), for example to notify a supervisor about a call.

Properties ​

  • From name: name shown as the sender.
  • Direction: recipient's address.
  • CC: addresses that receive a copy.
  • BCC: addresses that receive a hidden copy.
  • Subject: subject of the email.
  • Body: body of the email, in plain text or HTML. It can include channel variables, for example Missed call from ${CALLERID(num)}. Avoid double quotes (") in the subject and the body.
  • Attachments: files attached to the email.

Is on time Bot Webhook Blacklist Channel provider Event ​

This activity checks if the current date and time are within a schedule. It has two outputs: the first one is followed when it is on time, the second one when it isn't.

Properties ​

  • Schedule: schedule to check (see the format below). If it is empty, the service hours of the interaction's campaign are used.
  • Timezone: timezone used to evaluate the schedule, for example America/Montevideo. If it is empty, the server's timezone is used.

Schedule format ​

  • A period is written as days;hours.
  • Days: lowercase abbreviations separated by commas: sun, mon, tue, wed, thu, fri, sat.
  • Hours: a range HH:mm-HH:mm in 24-hour format. The start is included and the end isn't: 09:00-18:00 is on time until 17:59.
  • Several periods are joined with &. It is on time if any of them matches.
  • A range can't cross midnight: for a night shift, write two periods (mon;22:00-24:00&tue;00:00-06:00).

Example ​

mon,tue,wed,thu,fri;09:00-18:00&sat;09:00-13:00 with Timezone America/Montevideo: on time from Monday to Friday from 9:00 to 18:00 and on Saturday from 9:00 to 13:00. Connect the second output to a Send message that says "We are closed, our hours are…" and then a Finish interaction.

Transfer bot Bot ​

This activity transfers the interaction from the bot to a campaign, optionally to a specific agent. Before transferring, the bot saves VARIABLES into the interaction. It is the last activity of the bot.

Properties ​

  • Destination (required): name of the destination campaign, without the channel suffix: uContact adds the same suffix as the current campaign (the part after the last -). If it is empty, the interaction is queued again in the current campaign.
  • User: username of the agent who should receive the interaction. It is offered to that agent only if they are a member of the destination campaign; otherwise, the interaction goes to the campaign queue.
  • Timeout for agent: seconds the agent has to take the interaction.

Example ​

The current campaign is Support-whatsapp. With Destination Sales and User jperez, the interaction is offered to jperez in Sales-whatsapp if they are a member of that campaign; if not, it enters the queue of Sales-whatsapp.

Wait bot Bot ​

This activity pauses the bot until another flow resumes it with the Resume activity. Messages from the customer don't resume it. While it waits, the Timeout of Bot start still applies, counting from the last message the bot read.

It is useful when the bot needs an external confirmation: for example, it sends a payment link, waits, and a webhook that receives the payment notification runs Resume with the GUID of the interaction.

Properties ​

This activity has no properties.

Finish interaction Bot ​

This activity ends the bot and finishes the interaction.

Properties ​

This activity has no properties.

Result Webhook Blacklist Channel provider Event ​

This activity sets the result of the flow. It is the last activity of the flow.

  • In the blacklist flow, Call lets the interaction continue; Do not call and Respool alternative block it.
  • In other flows, the result is returned to whoever ran the flow.

Properties ​

  • Result: Call, Do not call or Respool alternative.

Example ​

Blacklist flow: Query JSON with SELECT COUNT(*) AS total FROM my_blocked_numbers WHERE number = '${CALL.clientId}' in BLOCKED, then Evaluate with BLOCKED[0].total > 0. The first output goes to Result Do not call and the second one to Result Call.

Disposition Telephony IVR Bot Webhook Blacklist Channel provider Event ​

This activity dispositions the interaction from the flow, as an agent would do from the inbox. Select the disposition level by level and, optionally, write a comment.

  • Bots and channel flows: it dispositions the interaction that runs the flow, so it needs one: in webhooks, events, channel providers and the blacklist there is no interaction and the flow fails. Only dispositions enabled for all channels can be selected.
  • Telephony flows and IVRs: it dispositions the current call (${guid}) in the campaign of the call. Only dispositions enabled for telephony can be selected.

Properties ​

  • Level 1, Level 2…: disposition levels. Select down to a final disposition. Only dispositions that are not assigned to a campaign are listed.
  • Comment: comment saved with the disposition.

Client name Bot ​

This activity sets the customer's name in the interaction and in the CLIENT_NAME variable.

Properties ​

  • Client name: name to set. It can be a variable, for example ${FULL_NAME}.

Example ​

After a Read message that stores the answer to "What is your name?" in NAME, set Client name to ${NAME}. Agents will see that name in the inbox.

Webhook response Webhook Blacklist Channel provider Event ​

This activity defines the HTTP response of the webhook. It is the last activity of the flow.

Properties ​

  • Status: HTTP status code, for example 200 or 404. It must be a number; otherwise, the flow fails.
  • Headers: headers of the response, one per line (Name: value). At the moment they are not applied to the response.
  • Body: body of the response, usually JSON. It is returned wrapped in the standard API response (see Functions).

Example ​

  • Status: 200
  • Body: {"received": true, "order": "${BODY.orderId}"}

Resume Webhook Blacklist Channel provider Event ​

This activity resumes a bot that is paused in a Wait bot activity, identified by the GUID of its interaction. If there is no interaction with that GUID, the flow writes it to the log and continues.

Properties ​

  • Interaction guid: GUID of the interaction whose bot should continue, for example ${BODY.guid}.

Data Bot Webhook Blacklist Channel provider Event ​

This activity saves data into the interaction identified by a GUID, in its automation section, and refreshes the VARIABLES of the bot that runs that interaction. It is useful to pass data to a bot from another flow, for example from a webhook before running Resume.

Properties ​

  • Interaction guid: GUID of the interaction, for example ${GUID} for the current one or ${BODY.guid} in a webhook.
  • Data: JSON object with the data to save. It must be valid JSON; otherwise, the flow fails.

Example ​

A payment webhook receives {"guid":"6f1c...","status":"approved"}:

  • Interaction guid: ${BODY.guid}
  • Data: {"paymentStatus": "${BODY.status}"}

Then Resume with the same GUID. The bot continues and reads VARIABLES.automation.paymentStatus.

Evaluate Telephony IVR Bot Webhook Blacklist Channel provider Event ​

This activity evaluates conditions and sends the flow down different paths.

In bots and channel flows ​

It evaluates one JavaScript condition. If it is true, the flow follows the first output; if it is false, the second one.

Properties ​

  • Condition: JavaScript expression. Variables are written with their plain name, without ${}.

Example ​

js
ANSWER.toLowerCase() == "yes" && CHANNEL == "whatsapp"

In telephony flows and IVRs ​

You can add several conditions, written as Asterisk expressions. Each condition has its own output: they are checked in order and the call follows the output of the first true one. If none is true, it follows the last output.

Properties ​

  • Condition: Asterisk expression. Add as many as you need.

Example ​

  • Condition 1: $["${CALLERID(num)}" = "59899123456"] → VIP path.
  • Condition 2: $[${attempts} >= 3] → Hangup.
  • No condition true → last output, back to the menu.

Command Telephony IVR Bot Webhook Blacklist Channel provider Event ​

This activity runs a command on the server's operating system.

In bots and channel flows ​

It runs the command and stores its output in a variable.

Properties ​

  • Variable: name of the variable for the output. The command runs only if Variable has a value.
  • Command: command to run. It can include variables, for example curl -s https://api.example.com/status.

In telephony flows and IVRs ​

It runs the command with Asterisk SHELL and stores its output in the ${result} channel variable.

Properties ​

  • Command: command to run, for example date +%H.

Function Telephony IVR Bot ​

This activity calls a function. There is one for bots and one for IVRs and telephony flows. Learn how functions start and end in Function start.

In bots ​

It runs a bot function. The function uses the same variables as the bot; when it ends, the bot continues with the activity connected after Function. If the function doesn't exist, the flow stops and the interaction is finished.

Properties ​

  • Function name: bot function to run.

In IVRs and telephony flows ​

It runs an IVR function (Asterisk GoSub to the ivrFunction context) and sends it parameters. When the function runs Return, the call continues with the next activity, and the returned value is available as ${GOSUB_RETVAL}.

Properties ​

  • Function name: IVR function to run.
  • Parameter: values sent to the function, in order. Inside the function they are ${ARG1}, ${ARG2}, etc.

Example ​

A function validateCustomer called with these parameters:

  • Parameter 1: ${CALLERID(num)}
  • Parameter 2: ${documentId}

Inside the function, ${ARG1} is the caller's number and ${ARG2} the document entered. The function ends with Return ${status}, and the IVR evaluates $["${GOSUB_RETVAL}" = "OK"].

Webchat event Bot ​

This activity is meant to send a custom event to the customer's webchat.

Heads up!
In the current version the activity has no effect: the flow continues without sending anything to the webchat.

Properties ​

  • Data: JSON object with the data of the event.

This activity compares a text with a list of options and returns the options sorted by similarity. It is useful to understand what the customer meant even with typos.

Properties ​

  • Variable: name of the variable for the result: an array of objects, from the most to the least similar, each one with string (the option), score (similarity from 0 to 100) and index (position in the list).
  • Word: text to look for, for example ${ANSWER}.
  • List: JavaScript array of strings, or the name of a variable that holds one. For example ["Sales", "Support", "Billing"].

Example ​

The customer writes suport. With Word ${ANSWER}, List ["Sales", "Support", "Billing"] and Variable MATCH, MATCH[0].string is Support. An Evaluate with MATCH[0].score > 80 decides whether to trust it.

Procedure Bot Webhook Blacklist Channel provider Event ​

This activity runs JavaScript code inside the flow. The code shares the variables of the flow: it can read them, change them and create new ones.

Properties ​

  • Procedure code: JavaScript code to run. If it throws an error, the flow stops (in bots, the interaction is finished).

Example ​

js
// Normalize the document number and remember it in the interaction data
DOCUMENT = ANSWER.replace(/[^0-9]/g, "");
VARIABLES.document = DOCUMENT;
IS_VALID = DOCUMENT.length == 8;

WebService Bot Webhook Blacklist Channel provider Event ​

This activity sends an HTTP request and stores the response in a variable. It waits up to 60 seconds for the response.

Properties ​

  • Variable: name of the variable for the response.
    • If the status is 200 and the response is JSON, the variable holds the parsed object (RESPONSE.status).
    • If the status is 200 and the Content type (or a header) is XML, the response is converted to a JSON string.
    • Otherwise (another status or another format), the variable holds the response as text.
    • If the request can't be made (timeout, wrong URL), the variable is left empty and the error is written to the log.
  • Service url: URL of the service. It can include variables.
  • Method: GET, POST, PUT, DELETE or PATCH.
  • Content type: type of the body: text/plain, text/xml, application/json, application/xml or x-www-form-urlencoded.
  • Headers: one header per line, in the form Name: value. A line with more than one colon is ignored, so a value can't contain :.
  • Body: body of the request (not sent with GET). With x-www-form-urlencoded, write key=value&key2=value2.

Example ​

  • Variable: CUSTOMER
  • Service url: https://crm.example.com/api/customers?phone=${CLIENT_ID}
  • Method: GET
  • Headers: Authorization: Bearer ${CRM_TOKEN}

If the CRM answers {"name":"Ana Gómez","vip":true}, an Evaluate with CUSTOMER.vip == true sends VIP customers to a priority campaign.

Query Bot Webhook Blacklist Channel provider Event ​

This activity runs an SQL statement against the Data database and stores the result in a variable.

  • If the statement starts with SELECT or select (without leading spaces), the rows are stored as an array: each row is an array of values in the order of the columns (with a single column, an array of values).
  • Any other statement (INSERT, UPDATE…) is run without results; if Variable has a value, it stores true or false.
  • If the query fails, the error is written to the flow log and the variable doesn't change.

Properties ​

  • Variable: name of the variable for the result.
  • Query: SQL statement. It can include variables, for example '${CLIENT_ID}'.

Example ​

sql
SELECT name, balance FROM my_customers WHERE phone = '${CLIENT_ID}'

With Variable CUSTOMER, the name is CUSTOMER[0][0] and the balance CUSTOMER[0][1]. To work with column names, use Query JSON.

Row limit ​

If the query returns more than 10000 rows, the results are not stored. The variable gets this object instead:

json
{
  "error": "row_limit_exceeded",
  "limit": 10000,
  "message": "Query returned more than 10000 rows. Please add a LIMIT clause or filter your data."
}

To handle it, use an Evaluate with:

js
CUSTOMER.error == "row_limit_exceeded"

Query JSON Bot Webhook Event ​

This activity runs an SQL statement against the Repo database and stores the result as an array of JSON objects, one per row, with the column names as keys. Columns that hold JSON objects are parsed too, so you can access their fields directly.

Statements that don't start with SELECT or select are run without results in the Data database (not in Repo), as in Query.

Properties ​

  • Variable: name of the variable for the result.
  • Query: SQL statement. It can include variables.

Example ​

sql
SELECT guid, campaign, agent FROM interactions_repo WHERE clientId = '${CLIENT_ID}' ORDER BY id DESC LIMIT 1

With Variable LAST, the agent of the last interaction is LAST[0].agent. If there are no rows, LAST.length is 0.

Row limit ​

If the query returns more than 10000 rows, the variable gets the same error object as in Query:

json
{
  "error": "row_limit_exceeded",
  "limit": 10000,
  "message": "Query returned more than 10000 rows. Please add a LIMIT clause or filter your data."
}

LogOp Bot Webhook Blacklist Channel provider Event ​

This activity writes a line to the flow log with the values of its property, already evaluated. It is useful to follow the flow in the console while you test it.

Properties ​

  • LOG: text to write. It can include variables, for example Customer ${CLIENT_ID} chose ${ANSWER}.

XML JSON Bot Webhook Blacklist Channel provider Event ​

This activity converts an XML text into a JSON object.

Properties ​

  • Variable: name of the variable for the JSON object.
  • Xml: XML text, or a variable that holds it, for example ${XML_RESPONSE}.

Example ​

With Xml <customer><name>Ana</name><vip>true</vip></customer> and Variable DATA, DATA.customer.name is Ana.

Set Data Telephony IVR ​

This activity saves data into the current call, in the automation section of the interaction, so it can be read later in forms and in the interaction details. Each row saves one key.

Properties ​

  • Variable: name of the key to save.
  • Value: value to save. It can include channel variables. Avoid double quotes (").

Example ​

  • Variable: menuOption — Value: ${option}
  • Variable: document — Value: ${documentId}

The agent's form can then read menuOption and document from the interaction data.

SIP Message Telephony IVR ​

This activity sends a SIP text message (Asterisk MessageSend). The text is taken from the MESSAGE(body) channel variable, so set it first with Variables.

Properties ​

  • To: destination, for example pjsip:1001.
  • From: sender (optional).

Example ​

Variables with MESSAGE(body) = Incoming call from ${CALLERID(num)}, then SIP Message with To pjsip:1001.

AMD Telephony IVR ​

This activity analyzes the beginning of the call to detect if a person or an answering machine answered (Asterisk AMD). It stores the result in ${AMDSTATUS} (HUMAN, MACHINE, NOTSURE or HANGUP) and the reason in ${AMDCAUSE}. Times are in milliseconds; empty fields use the values of the server.

Properties ​

  • Greeting: maximum length of a greeting. Longer greetings are considered a machine.
  • Initial silence: maximum silence before the greeting. Longer silences are considered a machine.
  • After greeting silence: silence after the greeting that means a person answered.
  • Total analysis time: maximum time of the analysis.
  • Minimum word length: minimum duration of a sound to count it as a word.
  • Between words silence: minimum silence between words.
  • Maximum number of words: words in the greeting from which it is considered a machine.
  • Silence threshold: level below which audio is considered silence (0 to 32767).

Example ​

AMD with the default values, then Evaluate with $["${AMDSTATUS}" = "MACHINE"]: if it's a machine, Playback of a message and Hangup; if not, Transfer queue.

Asterisk docs

Answer Telephony IVR ​

This activity answers the call. Add it before playing audio or reading digits.

Properties ​

  • Delay (s): time Asterisk waits after answering before continuing. Despite the label, Asterisk reads this value in milliseconds. It is optional.

Asterisk docs

Hangup Telephony IVR ​

This activity ends the call.

Properties ​

  • Hangup cause: cause reported when hanging up:
    • 16: Normal call clearing
    • 17: Busy
    • 19: No answer
    • 21: Rejected
    • 34: Congestion

Asterisk docs

Attended transfer Telephony ​

This activity starts an attended transfer of the other party of the call to an extension (Asterisk AttendedTransfer): the channel that runs it talks to the destination before completing the transfer. The call must be connected to another party. The result is stored in ${ATTENDEDTRANSFERSTATUS}.

Properties ​

  • Extension: destination extension.

Asterisk docs

Blind transfer Telephony ​

This activity transfers the other party of the call to an extension and context without consultation (Asterisk BlindTransfer). The call must be connected to another party. The result is stored in ${BLINDTRANSFERSTATUS}.

Properties ​

  • Extension: destination extension.
  • Context: context of the extension.

Asterisk docs

Set to busy Telephony IVR ​

This activity signals the caller that the line is busy and waits until the caller hangs up (Asterisk Busy). The activities after it don't run.

Properties ​

This activity has no properties.

Asterisk docs

Redirect Telephony IVR ​

This activity sends another channel (not the current one) to a context, extension and step of the dialplan (Asterisk ChannelRedirect).

Properties ​

  • Channel: name of the channel to redirect, for example PJSIP/1001-0000002a.
  • Context: destination context.
  • Extension: destination extension.
  • Step: destination step (priority).

Asterisk docs

Conference Telephony IVR ​

This activity puts the call in a conference room (Asterisk ConfBridge). All the calls that enter the same number talk to each other.

Properties ​

  • Conference number: name or number of the room, for example ${guid} or sales-meeting.
  • Bridge profile: bridge profile of confbridge.conf (optional).
  • User profile: user profile of confbridge.conf (optional).
  • Menu: DTMF menu of confbridge.conf (optional).

Asterisk docs

Dial Telephony IVR ​

This activity makes a call and connects it with the current one (Asterisk Dial). The result is stored in ${DIALSTATUS} (ANSWER, BUSY, NOANSWER, CANCEL, CONGESTION, CHANUNAVAIL).

Properties ​

  • Type: technology of the destination, for example PJSIP or Local. If it is empty, Identifier is used as it is.
  • Identifier: destination: an extension, or a number and the trunk, for example 1001 or 0991234567@my-trunk.
  • Timeout: seconds to wait for an answer.
  • Options: options of Dial:
    • A(x): plays the file x to the called party when they answer.
    • a: answers the calling channel as soon as the called channel answers.
    • B(...): before dialing, runs a GoSub to the given location on the current channel.
    • b(...): before dialing, runs a GoSub to the given location on each new channel.
    • C: resets the call detail record (CDR) of the call.
    • c: if Dial cancels the call, sets ${HANGUPCAUSE} to "answered elsewhere".
    • F(...): when the caller hangs up, sends the called party to the given location.
    • g: continues the flow if the called party hangs up.
    • K / k: lets the caller / the called party park the call with the DTMF sequence of features.conf.
    • L(x[:y[😒]]): limits the call to x milliseconds, warning when y milliseconds are left and repeating every z.
    • m: plays music on hold to the caller until the called party answers.
    • R: indicates ringing to the caller even if the called party isn't ringing.
    • T / t: lets the caller / the called party transfer the call.
    • U(x[^arg]): runs the subroutine x on the called channel before connecting it.
  • Url: optional. URL that Asterisk sends to the called party, if its device supports it. It is not a webhook: uContact doesn't call this URL.

Example ​

  • Type: PJSIP
  • Identifier: ${number}@my-trunk
  • Timeout: 30
  • Options: m, g

If nobody answers in 30 seconds, the flow continues, and an Evaluate with $["${DIALSTATUS}" != "ANSWER"] can leave a message or try another number.

Asterisk docs

Progress Telephony IVR ​

This activity indicates progress to the caller (early media) without answering the call, so audio can be played before answering (Asterisk Progress).

Properties ​

This activity has no properties.

Queue Telephony ​

This activity puts the call in the queue of a campaign so an agent answers it (Asterisk Queue). The fields are passed to Queue in order. When the call leaves the queue without being answered (for example, because of the Timeout), the flow continues with the next activity.

Properties ​

  • Campaign: campaign (queue) where the call waits.
  • Url: URL sent to the agent's device when the call is connected (optional).
  • Options:
    • b(...) / B(...): runs a GoSub before calling each agent / before the call is connected.
    • c: continues the flow if the agent hangs up.
    • F(...): when the caller hangs up, sends the agent to the given location.
    • n: no retries: leaves the queue at the first timeout.
    • R: rings instead of playing music when an agent's phone is ringing.
    • r: rings instead of playing music on hold.
    • T / t: lets the caller / the agent transfer the call.
    • K / k: lets the caller / the agent park the call.
  • Announce override: audio played to the agent instead of the queue's announcement.
  • Timeout: maximum seconds the call waits in the queue.
  • AGI: AGI script run on the agent's channel when they answer.
  • Macro: macro run on the agent's channel when they answer.
  • Go sub: subroutine run on the agent's channel when they answer.
  • Rule: penalty rule of the queue.
  • Position: position where the call enters the queue.

Example ​

Queue with Campaign Support, Timeout 120 and Options n. After two minutes without an agent, the flow continues: connect a Playback that offers a callback and a Virtual hold.

Asterisk docs

Transfer queue Telephony IVR ​

This activity transfers the call to a campaign so it is answered by an agent. The call goes through the inbound logic of that campaign (service hours, queue, etc.) as if it had arrived there. It is the last activity of the flow.

Properties ​

  • Campaign: destination campaign. You can choose it from the list or write a variable that holds its name, for example ${destinationCampaign}.

Example ​

In a Menu, option 1 goes to Transfer queue Sales and option 2 to Transfer queue Support.

Queue update Telephony IVR ​

This activity updates the statistics of a queue with the result of a call made outside it, for example an outbound call made with Dial (Asterisk QueueUpdate). It sends the unique ID of the call, the agent, ${DIALSTATUS}, ${ANSWEREDTIME} and ${DIALEDTIME}, plus the fields below.

Properties ​

  • Queue: queue (campaign) to update.
  • Dialed number: number that was called.
  • Guid: GUID of the interaction.

Read Telephony IVR ​

This activity plays an audio and stores the digits the caller presses in a variable (Asterisk Read). It is used to ask for an option, a document number, a PIN, etc.

Properties ​

  • Variable: name of the variable where the digits are stored (without ${}).
  • Audio: audio of the flow to play.
  • Options:
    • s: returns immediately if the call is not answered.
    • i: plays the audio as an indication tone of indications.conf.
    • n: reads digits even if the call is not answered.
  • Max digits: maximum number of digits. Reading ends when they are reached, when the caller presses # or when the time runs out.
  • Attempts: times the audio is played if the caller doesn't press anything.
  • Timeout: seconds to wait for the digits.

Example ​

  • Variable: documentId
  • Audio: enter-document
  • Max digits: 8
  • Attempts: 2
  • Timeout: 10

Then a Web service can validate ${documentId}.

Asterisk docs

Ringing Telephony IVR ​

This activity indicates ringing to the caller without answering (Asterisk Ringing).

Properties ​

This activity has no properties.

Send DTMF Telephony IVR ​

This activity sends DTMF digits on the call (Asterisk SendDTMF), for example to navigate another company's IVR.

Properties ​

  • Digits: digits to send: 0-9, *, #, A-D. A w adds a pause of half a second.
  • Timeout: milliseconds between digits.
  • Duration: duration of each digit, in milliseconds.
  • Channel: channel where the digits are sent (optional; by default, the current one).

Asterisk docs

Set caller id Telephony IVR ​

This activity changes the caller ID of the call (CALLERID function), for example the number shown on an outbound call.

Properties ​

  • Variable: part of the caller ID to change: num, name, all, ANY, DNID or RDNIS.
  • Value: new value.

Example ​

Before a Dial, Variable num and Value 59821234567 make the customer see the company's number.

Asterisk docs

Sip add Telephony IVR ​

This activity adds SIP headers to the calls made later with Dial (PJSIP_HEADER(add,...)). Add one row per header.

Properties ​

  • Header: name of the header, for example X-Customer-Id.
  • Content: value of the header, for example ${customerId}.

Asterisk docs

Sip remove Telephony IVR ​

This activity removes SIP headers added before with Sip add (PJSIP_HEADER(remove,...)). Add one row per header.

Properties ​

  • Header: name of the header to remove.

Asterisk docs

Virtual hold Telephony IVR ​

This activity schedules a callback to the customer (Virtual hold): uContact creates a call file that Asterisk dials later. The call is retried up to 3 times, every 60 seconds; when it is answered, it continues in the given context, extension and step, with the GUID of the original call.

Properties ​

  • Channel (required): channel to dial, for example Local/${CALLERID(num)}@outbound.
  • Context (required): context where the callback continues when it is answered.
  • Extension (required): extension where the callback continues. It is also the number shown in the caller ID.
  • Step (required): step (priority) where the callback continues.
  • Cid text (required): text added to the caller ID (VH <text>).
  • Schedule: when to call, in the touch -t format [[CC]YY]MMDDhhmm[.ss]. If it is empty, the call is made right away.

Volume Telephony IVR ​

This activity changes the volume of the call (VOLUME function).

Properties ​

  • TX volume: volume of what the caller hears, from -4 to 4.
  • RX volume: volume of what the caller says, from -4 to 4.

Asterisk docs

Scramble Telephony IVR ​

This activity scrambles the audio of the call in the given direction (Asterisk Scramble), so it can't be understood.

Properties ​

  • Direction: direction to scramble, for example TX, RX or both.

DSP detect Telephony IVR ​

This activity analyzes the early media of an outbound call before it is answered, to detect tones such as busy or no answer. It runs the Asterisk application AMDEarlyMedia with the fields below.

Properties ​

  • Timeout: seconds to analyze.
  • Prog zone: call progress zone used to recognize the tones (country code, for example us or uk).

Echo Telephony IVR ​

This activity plays back to the caller everything they say, until they press # or hang up (Asterisk Echo). It is useful to test the audio of a line.

Properties ​

This activity has no properties.

Parked call Telephony IVR ​

This activity retrieves a parked call and connects it with the current one (Asterisk ParkedCall).

Properties ​

  • Parking lot: parking lot.
  • Parking space: space where the call is parked, for example 701.

Asterisk docs

Park Telephony IVR ​

This activity parks the call so it can be retrieved later with Parked call (Asterisk Park).

Properties ​

  • Parking lot: parking lot (optional; by default, the default one).
  • Options:
    • r: plays ringing instead of music on hold to the parked call.
    • R: chooses a random parking space.
    • s: doesn't announce the parking space.

Asterisk docs

Bridge Telephony IVR ​

This activity connects the current call with another existing channel (Asterisk Bridge).

Properties ​

  • Channel: channel to connect, for example PJSIP/1001-0000002a.
  • Options: options of Bridge, for example F(...) (continue in another location when the other party hangs up), h/H (hang up with DTMF), k/K (park), L(x[:y][:z]) (time limit), S(x) (hang up after x seconds), t/T (transfer), w/W (record), p (courtesy tone), n (don't answer the call), x.

Asterisk docs

Bridge add Telephony IVR ​

This activity adds another channel to the bridge where the current call is (Asterisk BridgeAdd).

Properties ​

  • Channel: channel to add.

Asterisk docs

Bridge wait Telephony IVR ​

This activity puts the call in a holding bridge, where it waits until it is connected to another call (Asterisk BridgeWait).

Properties ​

  • Name: name of the holding bridge. Calls with the same name share it.
  • Role: participant (waits with music or ringing) or announcer (its audio is heard by all the participants).
  • Options: m (music on hold), e (what the participant hears while waiting), S (leave the bridge after a time), n (don't answer the call).

Asterisk docs

Broadcast Telephony IVR ​

This activity sends the audio of the current call to other channels (Asterisk Broadcast).

Properties ​

  • Channels: channels that receive the audio, separated by &.
  • Options: options of Broadcast (b, l, o, r, s, w), for example to send only to bridged channels or to whisper.

Asterisk docs

ToneScan Telephony IVR ​

This activity listens to the call during a time to detect what is on the other side: fax, modem, voice, dial tone, busy signal, etc. (Asterisk ToneScan). The result is stored in ${TONESCANSTATUS}.

Properties ​

  • Timeout: seconds to listen.
  • Threshold: number of matches needed to report a tone.
  • Zone: country zone used to recognize the tones, for example us.
  • Options: options passed to ToneScan.

Asterisk docs

Hook on Telephony IVR ​

This activity starts a periodic action: every interval, Asterisk runs the given context and extension on the call, in parallel with the flow (PERIODIC_HOOK function). The ID of the hook is stored in ${BEEPID}, which Hook off uses to stop it.

Properties ​

  • Context: context to run.
  • Extension: extension to run.
  • Interval: seconds between runs.

Example ​

To warn that the call is being recorded: a context beep with an extension s that plays a beep, and Hook on with Context beep, Extension s and Interval 15. The beep sounds every 15 seconds until Hook off.

Asterisk docs

Hook off Telephony IVR ​

This activity stops the periodic action started with Hook on (the one stored in ${BEEPID}).

Properties ​

This activity has no properties.

User event Telephony IVR ​

This activity sends a custom event (Asterisk UserEvent). uContact listens to these events: if the name is one it knows (the same ones that Stats offers), it processes the body as a JSON object. Other names are ignored by uContact, but any AMI client can listen to them.

Properties ​

  • Event: name of the event.
  • Body: body of the event, as a JSON object.

Example ​

  • Event: survey
  • Body: {"guid":"${guid}","score":"${score}"}

Variables Telephony IVR ​

This activity creates or changes channel variables (Asterisk Set). Add one row per variable; they are set in order.

Properties ​

  • Variable: name of the variable, without ${}. A name starting with __ (for example __customerId) is inherited by the channels created later, such as the agent's call.
  • Value: value to assign. It can include variables, functions and expressions.

Example ​

VariableValue
attempts$[${attempts} + 1]
customerType${JSON_DECODE(customer,type)}
__ticket${ticketId}

This activity plays an audio, stores the digits the caller presses in a variable (like Read) and sends the call down a different path for each condition. It also records the option chosen in the IVR statistics.

Properties ​

  • Variable: name of the variable where the digits are stored (without ${}).
  • Audio: audio of the flow to play. It is replaced by Filename when that checkbox is checked.
  • Filename: check it to play a file by its path on the server instead of an audio of the flow, and write the path without the extension (for example custom/main-menu).
  • Option: options of Asterisk Read, for example s (return immediately if the call is not answered) or n (read digits even if the call is not answered).
  • Max digits: maximum number of digits.
  • Attempts: times the audio is played if the caller doesn't press anything.
  • Timeout: seconds to wait for the digits. If it is empty, there is no limit.
  • Condition: Asterisk expressions, one per path. Each condition has its own output.

Output connections ​

Each condition has its own output (blue circle) on the node: connect it to the activity of that path. The conditions are checked in order and the call follows the first true one. If none is true (for example, the caller pressed an invalid digit or nothing), it follows the last output.

Example ​

  • Variable: option — Audio: main-menu ("Press 1 for sales, 2 for support") — Max digits: 1 — Attempts: 3 — Timeout: 5
  • Condition 1: $["${option}" = "1"] → Transfer queue Sales
  • Condition 2: $["${option}" = "2"] → Transfer queue Support
  • Last output → Playback "Invalid option" and back to the menu.

If Time Telephony IVR ​

This activity checks if the current date and time are within a schedule and sends the call down one of its two outputs: the first one when it is on time, the second one when it isn't. uContact evaluates the schedule.

Properties ​

  • Schedule: schedule to check, in the same format as Is on time.
  • Timezone: timezone, for example America/Montevideo. If it is empty, the server's timezone is used.

Schedule format ​

  • A period is written as days;hours.
  • Days: lowercase abbreviations separated by commas: sun, mon, tue, wed, thu, fri, sat.
  • Hours: a range HH:mm-HH:mm in 24-hour format. The start is included and the end isn't.
  • Several periods are joined with &. It is on time if any of them matches.
  • A range can't cross midnight: write two periods instead.
Heads up!
If the Schedule is empty, the service hours of the campaign of the call are used.

Example ​

mon,tue,wed,thu,fri;08:00-20:00&sat;09:00-13:00: on time, connect Transfer queue; out of time, Playback of the hours message and Hangup.

SQL query Telephony IVR ​

This activity runs an SQL query and stores the result in a channel variable (ODBC_Data, ODBC_Repo or ODBC_Custom functions). The variable gets the first row, with the values of the columns separated by commas.

Properties ​

  • Source: database: Data, Repo or Custom.
  • Variable: name of the variable for the result (without ${}).
  • Query: SQL statement. It can include channel variables. A final ; is removed.
Heads up!
Commas inside the query must be escaped as \, because Asterisk uses the comma to separate arguments. Without it, the query is cut at the first comma.

Example ​

  • Source: Data
  • Variable: customerName
  • Query: SELECT name FROM my_customers WHERE phone = '${CALLERID(num)}' LIMIT 1

To read two columns, escape the comma: SELECT name\, segment FROM my_customers WHERE .... The variable is then Ana,VIP; split it with Cut.

Goto Telephony ​

This activity sends the call to another place of the dialplan (Asterisk Goto) and doesn't come back. It is the last activity of the flow.

Properties ​

  • Context: destination context.
  • Extension: destination extension (for an IVR, its name; for a telephony flow, its extension).
  • Step: step (priority) where execution continues. Use 1 to start from the beginning.

Example ​

Context ivr, Extension main-menu, Step 1 sends the call to the start of the IVR main-menu.

Wait Telephony IVR ​

This activity pauses the flow. Wait Type defines what it waits for, and the fields change with it:

  • Seconds: waits the given time (Asterisk Wait).
    • Seconds: seconds to wait, for example 3 or ${waitTime}.
  • Until: waits until a date (WaitUntil).
    • Epoch date: date in epoch format (seconds).
  • For noise: waits until there is noise on the line (WaitForNoise).
    • Noise required: milliseconds of continuous noise.
    • Iterations: times the noise must be detected.
    • Timeout: maximum seconds to wait.
  • For silence: waits until there is silence (WaitForSilence), for example before playing a message on an answering machine.
    • Silence required: milliseconds of continuous silence.
    • Iterations: times the silence must be detected.
    • Timeout: maximum seconds to wait.
  • For extension: waits for the caller to dial an extension of the context (WaitExten).
    • Seconds: seconds to wait.
    • Options: m (music on hold while waiting), d (dial tone while waiting).
  • For digit: waits for the caller to press a key (WaitDigit). The digit is stored in ${WAITDIGITRESULT}.
    • Seconds: maximum seconds to wait.
    • Digits: digits that are accepted, for example 123#. Other digits are ignored.
  • For ring: waits for a ring (WaitForRing).
    • Timeout: maximum seconds to wait.
  • For tone: waits for a tone of a given frequency (WaitForTone).
    • Timeout: maximum seconds to wait.
    • Tone frequency: frequency in Hz.
    • Options: d (custom decibel threshold, 16 by default), s (squelch the tone).
  • For signal: waits for a signal sent from another channel (WaitForSignal).
    • Timeout: maximum seconds to wait.
    • Signal name: name of the signal.
  • For condition: waits until an expression is true (WaitForCondition).
    • Timeout: maximum seconds to wait.
    • Replacement char: character written instead of $ in the expression, so it is evaluated on each check and not only once.
    • Expression: condition, written with the replacement character.
    • Interval: seconds between checks.

Example ​

Wait for a variable set by another channel: Wait Type For condition, Replacement char #, Expression #[#{SHARED(approved)} = 1], Timeout 30, Interval 1.

SMS Queue Telephony IVR ​

This activity has no properties. It writes the application SMSQueue to the dialplan, with no arguments.

Heads up!
The Asterisk server of uContact doesn't include an SMSQueue application, so the call can't continue past this step. Don't use it in production flows.

Stats Telephony ​

This activity sends an event to uContact to update the statistics of the interaction (it uses Asterisk UserEvent). It is how a telephony flow tells uContact, for example, that the call entered the queue, that a survey was answered or that the call is out of hours.

Properties ​

  • Event: event to send, for example enterQueue, outOfTime, survey, setDisposition, transferredToExternal or ivrStart.
  • Json: body of the event, as a JSON object with the data that event needs. Almost every event needs guid.

Example ​

To save the score of a post-call survey:

  • Event: survey
  • Json: {"guid":"${guid}","score":"${score}"}

AGI Telephony IVR ​

This activity runs an AGI script on the call (Asterisk AGI).

Properties ​

  • Command: script and its arguments, for example validate.php,${documentId} or agi://10.0.0.5/validate.

Asterisk docs

Filter Telephony IVR ​

This activity keeps only the allowed characters of a text (FILTER function).

Properties ​

  • Result variable: name of the variable for the filtered text.
  • Allowed characters: characters to keep, for example 0123456789 or a range such as 0-9.
  • Input variable: text to filter. Write it as a value, for example ${CALLERID(num)}.

Example ​

Allowed characters 0123456789 and Input variable ${CALLERID(num)} turn +598 99 123 456 into 59899123456.

Include Telephony IVR ​

This activity includes another context in the context of the flow (include =>), so its extensions can be dialed from there. The include applies to the whole context, not only to this flow, whatever the position of the activity.

Properties ​

  • Context: context to include.

XML Telephony IVR ​

This activity reads an XML text and creates one channel variable per element, with the name of the element as the variable and its text as the value (Asterisk ParseXML).

Properties ​

  • XML: XML text, or a channel variable that holds it (for example ${xmlResponse}).

How it works ​

For example, given this XML:

xml
<res>
  <body>
    <msgtype>12</msgtype>
    <langflag>zh_CN</langflag>
    <tokensn>1000000001</tokensn>
  </body>
</res>

The activity sets these variables:

  • ${msgtype} → 12
  • ${langflag} → zh_CN
  • ${tokensn} → 1000000001

If two elements have the same name at different levels, the last one processed overwrites the previous value.

Limitations ​

The XML is written as the argument of an Asterisk application, so some characters can break it, whether typed directly or inside the variable that holds it. Avoid them when possible:

  • Commas (,): Asterisk may split the argument at the first comma, so the XML can arrive cut and fail to parse.
  • Double quotes ("): Asterisk may remove them, so attributes like id="1" can leave the XML invalid. Prefer single quotes (id='1').
  • Semicolons (;): they may be read as the start of a dialplan comment, cutting the rest of the XML.
  • Attributes: they are ignored. Only the text of the elements becomes a variable.

If the XML can't be parsed, the activity sets no variables and the flow continues with the next activity.

In uContact v6 the activity stored the values as ${HASH(arrayN,element)} together with ${ARRAYELEMENTS}. In uContactX each value is a plain channel variable named after its element, so flows migrated from v6 must read ${element} instead.

Json decode Telephony IVR ​

This activity reads a value from a JSON stored in a channel variable and saves it in another variable (JSON_DECODE function).

Properties ​

  • Result: name of the variable for the value.
  • Variable: name of the variable that holds the JSON (without ${}).
  • Item: key or path of the value, for example status or customer.name. For arrays, use the position: orders.0.id.
  • Separator: character that separates the levels of Item. Write . for the usual notation.
  • Options: c returns the number of elements of an array instead of a value.

Example ​

A Web service stores {"customer":{"name":"Ana","debt":1500}} in response. Json decode with Result debt, Variable response, Item customer.debt and Separator . leaves ${debt} = 1500.

Using Json decode as a function ​

You can also use the function directly in other activities, such as Evaluate or Variables, without this activity:

txt
${JSON_DECODE(VARIABLE,key)}

Example in Evaluate:

txt
$["${JSON_DECODE(CAMPAIGN,autoAnswer)}"=="1"]

Asterisk docs

Language Telephony IVR ​

This activity sets the language of the call (CHANNEL(language)). Audios and the Say activity use the files of that language.

Properties ​

  • Language: es, en, pt, it or default. default uses the default language configured in uContact.

MoH Telephony IVR ​

This activity sets the music on hold class of the call (CHANNEL(musicclass)). It is used, for example, while the call waits in a queue or with the m option of Dial.

Properties ​

  • Music on hold: music on hold class, for example default.

While Telephony IVR ​

This activity repeats a block of activities while a condition is true (Asterisk While). The condition is checked before each round. The block ends at a Stop While activity; when the condition is false, the call continues after Stop While.

Properties ​

  • Condition: Asterisk expression.

Example ​

Ask for the document up to three times:

  1. Variables: attempts = 0.
  2. While with $[${attempts} < 3 & "${valid}" != "1"].
  3. Read the document, Web service to validate it (sets valid), Variables: attempts = $[${attempts} + 1].
  4. Stop While.

Stop While Telephony IVR ​

This activity closes the block of a While. When the call reaches it, it goes back to the While to check the condition again. Every While needs its Stop While.

Properties ​

This activity has no properties.

Shared Telephony IVR ​

This activity sets a variable that can be read from other channels (SHARED function), for example from the agent's call.

Properties ​

  • Variable: name of the shared variable.
  • Channel: channel where it is set (optional; by default, the current one).
  • Value: value to assign.

Go sub Telephony IVR ​

This activity runs a subroutine: it jumps to a context, extension and step, and when the subroutine runs Return, the call comes back to the next activity (Asterisk GoSub).

Properties ​

  • Context: context of the subroutine.
  • Extension: extension of the subroutine.
  • Step: step (priority) where it starts.

Return Telephony IVR ​

This activity ends a subroutine or an IVR function and goes back to the flow that called it (Asterisk Return).

Properties ​

  • Value: value returned. The flow that called the subroutine reads it as ${GOSUB_RETVAL}.

Push Telephony IVR ​

This activity is meant to add a value at the end of a list of values separated by a delimiter.

Heads up!

The activity has no field for the value to add, so it doesn't add anything to the list. To add a value, use the Variables activity, for example my_list = ${my_list}|new_value.

Properties ​

  • Variable: name of the variable that holds the list.
  • Delimiter: character that separates the elements, for example |.

Pop Telephony IVR ​

This activity takes the last element out of a list of values separated by a delimiter, and stores it in ${result} (POP function). The element is removed from the list.

Properties ​

  • Variable: name of the variable that holds the list (without ${}).
  • Delimiter: character that separates the elements, for example |.

Example ​

If ${pending} is 1001|1002|1003, Pop with Variable pending and Delimiter | leaves ${result} = 1003 and ${pending} = 1001|1002.

Stasis Telephony IVR ​

This activity hands the call to an external ARI application (Asterisk Stasis). uContact doesn't use ARI, so the application must be your own.

Properties ​

  • Application name: name of the ARI application.
  • Arguments: arguments for the application.

Log Telephony IVR ​

This activity writes a message to the Asterisk log (Asterisk Log). It is useful to follow the flow in the console.

Properties ​

  • Level: ERROR, WARNING, NOTICE, DEBUG, VERBOSE or DTMF.
  • Message: text to write. It can include variables, for example Option ${option} for ${CALLERID(num)}.

No operation Telephony IVR ​

This activity does nothing, but the Asterisk console shows its content with the variables already replaced (Asterisk NoOp). It is useful to check values while you test.

Properties ​

  • Variable: text to show, for example Response: ${response}.

Web service Telephony IVR ​

This activity sends an HTTP request and stores the response in a channel variable (CURL function). It uses GET, or POST if Post is checked. The response is stored as text: if it is JSON, read it with Json decode.

Properties ​

  • Header: HTTP headers, one per row, in the form Name: value.
  • Variable: name of the variable for the response.
  • Url: URL of the service. It can include variables.
  • Post: if checked, the request is sent with POST.
  • Post data: body of the POST.

Example ​

  • Header: Content-Type: application/json
  • Variable: response
  • Url: https://crm.example.com/api/validate
  • Post: checked
  • Post data: {"document":"${documentId}"}

Then Json decode with Result valid, Variable response and Item valid, and an Evaluate with $["${valid}" = "true"].

Channel monitor Telephony IVR ​

This activity listens to other calls (Asterisk ChanSpy), for example for a supervisor.

Properties ​

  • Scan spec: prefix of the channels to listen to, for example PJSIP/1001. If it is empty, all channels.
  • Options:
    • b: only channels in a bridged call.
    • B: barge in on both channels of the call.
    • d: change mode with DTMF: 4 listen, 5 whisper, 6 barge.
    • E: exit when the monitored channel hangs up.
    • q: don't play a beep or announce the channel.
    • s: don't announce the channel type.
    • v([value]): initial volume, from -4 to 4.

Asterisk docs

Record Telephony IVR ​

This activity starts recording the call audio (Asterisk MixMonitor), and marks the call as recorded in the call detail record.

Properties ​

  • Filename: name of the file, for example ${guid}.mp3.
  • Options: several can be combined:
    • a: appends to the file instead of overwriting it.
    • b: records only while the call is bridged.
    • B([interval]): plays a beep every interval seconds (15 by default) while recording.
    • d: deletes the file as soon as the recording ends.
    • v / V / W: adjusts the volume heard / spoken / both, from -4 to 4.
    • r(file) / t(file): also records the received / transmitted audio in another file.
    • i(variable): stores the ID of the recording in a variable, to stop it with Stop record.
    • p / P: plays a beep on the channel that starts / stops the recording.
  • Command: command run when the recording ends.
  • Stereo: if checked, the other fields are hidden and uContact records each side of the call separately and then mixes them into one file with one side on each channel, saved in /var/spool/asterisk/records/<YYYYMMDD>/${guid}.mp3.

Asterisk docs

Stop record Telephony IVR ​

This activity stops a recording started with Record (Asterisk StopMixMonitor).

Properties ​

  • Mix monitor id: ID of the recording, stored with the i(variable) option of Record, for example ${recordingId}. If it is empty, the recording of the current channel is stopped.

Playback Telephony IVR ​

This activity plays an audio to the caller.

Properties ​

  • Audio: audio of the flow to play.
  • Filename: check it to play a file by its path on the server instead of an audio of the flow, and write the path without the extension, for example custom/welcome.
  • Background: if checked, the audio stops when the caller presses a key, and the digit is handled by the dialplan (Asterisk Background). If not, the audio is always played to the end (Asterisk Playback).
  • Options: they depend on Background:
    • Without Background: skip (don't play if the call is not answered) and noanswer (play without answering the call).
    • With Background: s (skip if the call is not answered), n (don't answer the call before playing) and m (only stop if the digit matches a one-digit extension of the context).
  • Language override: with Background, language of the audio files for this playback, different from the one of Language.

Asterisk docs

Play tones Telephony IVR ​

This activity plays a tone of indications.conf (Asterisk PlayTones). The tone keeps playing while the flow continues, until Stop tones, so it is usually followed by a Wait.

Properties ​

  • Tone: dial, busy, ring, congestion, callwaiting, dialrecall, record, info or name.

Stop tones Telephony IVR ​

This activity stops the tone started with Play tones (Asterisk StopPlayTones).

Properties ​

This activity has no properties.

Say Telephony IVR ​

This activity reads a value to the caller with the voice files of the language of the call. Type defines how it is read, and the fields change with it:

  • Alpha: spells a text letter by letter (SayAlpha). Field Alpha.
  • Digits: reads digit by digit (SayDigits). Field Digits: 1234 is read "one, two, three, four".
  • Number: reads a whole number (SayNumber). Fields Number and Gender (f, m, c or n, for languages that need it).
  • Phonetic: spells a text with the phonetic alphabet (SayPhonetic). Field Text.
  • UnixTime: reads a date and time (SayUnixTime). Fields Unix time (epoch), Timezone and Format (parts to read: a day of the week, b month, d day, Y year, H/k hour in 24 h, i hour in 12 h, M minutes, P AM/PM, Q/q "today" or "yesterday", R hour and minutes, j allow jumping with a digit).
  • Alpha case: spells a text with or without upper/lowercase (SayAlphaCase). Fields Case type (a announces whether each letter is upper or lowercase, l announces only lowercase letters, u announces only uppercase letters, n ignores case) and Text.
  • Money: reads an amount of money (SayMoney). Field Number, for example 1500.50.
  • Ordinal: reads an ordinal number, "first", "second"… (SayOrdinal). Fields Digits and Gender.

Example ​

To tell the customer their debt: Type Number, Number ${debt}. To read their account: Type Digits, Digits ${account}.

Start MoH Telephony IVR ​

This activity starts playing music on hold to the caller (Asterisk StartMusicOnHold). The music keeps playing while the flow continues, until Stop MoH or the end of the call.

Properties ​

  • Music on hold: music on hold class, for example default.

Stop MoH Telephony IVR ​

This activity stops the music started with Start MoH (Asterisk StopMusicOnHold).

Properties ​

This activity has no properties.

AES decrypt Telephony IVR ​

This activity decrypts a text encrypted with AES encrypt (AES_DECRYPT function), using the same key.

Properties ​

  • Variable: name of the variable for the decrypted text.
  • Key: the same key used to encrypt: exactly 16 characters.
  • Decrypt: encrypted text (base64), for example ${cardToken}.

AES encrypt Telephony IVR ​

This activity encrypts a text with AES (AES_ENCRYPT function). The result is in base64.

Properties ​

  • Variable: name of the variable for the encrypted text.
  • Key: secret key of exactly 16 characters.
  • Encrypt: text to encrypt, for example ${pin}.

Example ​

Variable pinEncrypted, Key Kx7pQ2mW9sT4vB1n and Encrypt ${pin}. To get the PIN back, AES decrypt with the same key and Decrypt ${pinEncrypted}.

Cut Telephony IVR ​

This activity takes one or more fields of a text separated by a delimiter (CUT function). Add one row per cut.

Properties ​

  • Result: name of the variable for the result.
  • Variable: name of the variable that holds the text (without ${}).
  • Delimiter: character that separates the fields, for example | or -.
  • Field spec: field or fields to take, starting at 1: 2, 1-3 or 1&3.

Example ​

If ${customer} is Ana|VIP|Montevideo, Result segment, Variable customer, Delimiter | and Field spec 2 leave ${segment} = VIP.

Count fields Telephony IVR ​

This activity counts how many fields a text separated by a delimiter has (FIELDQTY function).

Properties ​

  • Result: name of the variable for the count.
  • Variable: name of the variable that holds the text (without ${}).
  • Delimiter: character that separates the fields.

Example ​

If ${options} is 1|2|5, with Delimiter | the result is 3.

Length Telephony IVR ​

This activity stores the number of characters of a text (LEN function).

Properties ​

  • Result: name of the variable for the length.
  • Variable: text to measure. Write it as a value, for example ${documentId}.

Example ​

Result size and Variable ${documentId}, then an Evaluate with $[${size} != 8] to ask for the document again.

Math Telephony IVR ​

This activity does a math or logic operation between two values and stores the result. Add one row per operation.

Properties ​

  • Result: name of the variable for the result.
  • Result type: Float (decimal), Integer, Hex (hexadecimal) or Char (the character of that code). Not shown with MIN, MAX and ABS.
  • Left: first value. It can be a number or a variable, for example ${total}.
  • Operation: +, -, *, /, %, ^, <, >, >=, <=, AND, OR, XOR, >>, <<, MIN, MAX or ABS. Comparisons return 1 (true) or 0 (false).
  • Right: second value. Not shown with ABS, which uses only Left.

Example ​

Result withTax, Left ${amount}, Operation *, Right 1.22, Result type Float.

Regex Telephony IVR ​

This activity checks if a text matches a regular expression (REGEX function), and stores 1 if it matches or 0 if it doesn't.

Properties ​

  • Result: name of the variable for the result.
  • Regex: regular expression, between double quotes as Asterisk expects it, for example "[0-9]{8}". The activity passes the text after a comma, so an expression anchored to the start (^) may not match.
  • Data: text to check, for example ${documentId}.

Random number Telephony IVR ​

This activity generates a random whole number between a minimum and a maximum. It writes ${RANDOM(min,max)} to the dialplan.

Properties ​

  • Result: name of the variable for the number.
  • Minimum: smallest possible value.
  • Maximum: largest possible value.
Heads up!
The Asterisk function that returns a random number is RAND, not RANDOM. If the result is empty, use Variables with the value ${RAND(1,100)} instead.

Example ​

To send half of the calls to a survey: Result draw, Minimum 1, Maximum 100, then an Evaluate with $[${draw} <= 50].

Check file Telephony IVR ​

This activity checks information about a file of the server (STAT function).

Properties ​

  • Result: name of the variable for the result.
  • Filename: full path of the file.
  • Flag: what to check: e exists (1/0), f is a regular file, d is a folder, s size in bytes, m permissions, A last access, C last status change, M last modification (dates in epoch).

Example ​

Before playing a personalized audio: Filename /var/lib/asterisk/sounds/custom/${campaignName}.wav, Flag e. If the result is 1, play it; if not, play the generic one.

Format date Telephony IVR ​

This activity formats a date (STRFTIME function).

Properties ​

  • Result: name of the variable for the formatted date.
  • Variable: date in epoch format. Write it as a value, for example ${EPOCH} (now).
  • Timezone: timezone, for example America/Montevideo.
  • Format: strftime format, for example %d/%m/%Y %H:%M or %A.

Example ​

Variable ${EPOCH}, Timezone America/Montevideo, Format %H stores the current hour, useful to say "good morning" or "good afternoon".

Index of Telephony IVR ​

This activity tells the position of a value in a text separated by a delimiter (FIELDNUM function). Positions start at 1; if the value is not found, the result is 0.

Properties ​

  • Result: name of the variable for the position.
  • Variable: name of the variable that holds the text (without ${}).
  • Value: value to look for.
  • Delimiter: character that separates the fields, for example |.

Example ​

If ${vipNumbers} is 59899111111|59899222222, with Value ${CALLERID(num)} and Delimiter |, a result greater than 0 means the caller is VIP.

Replace Telephony IVR ​

This activity replaces every occurrence of a text inside a variable (STRREPLACE function). Add one row per replacement.

Properties ​

  • Result: name of the variable for the new text.
  • Variable: name of the variable that holds the original text (without ${}).
  • Find: text to look for.
  • Replace: text to put instead.
Heads up!
In the current version the activity adds an extra ) at the end of the result. Use the function directly in Variables if you need the exact text: ${STRREPLACE(variable,find,replace)}.

Lower case Telephony IVR ​

This activity converts a text to lowercase (TOLOWER function).

Properties ​

  • Result: name of the variable for the result.
  • String: text to convert, for example ${answer}.

Upper case Telephony IVR ​

This activity converts a text to uppercase (TOUPPER function).

Properties ​

  • Result: name of the variable for the result.
  • String: text to convert, for example ${plate}.

Clear hash Telephony IVR ​

This activity deletes all the variables of a hash (Asterisk ClearHash).

Properties ​

  • Hash: name of the hash.

Lock Telephony IVR ​

This activity takes a lock with a name (LOCK function), so that only one call at a time runs the activities that follow, until Unlock. If another call has the lock, it waits up to 3 seconds. ${result} is 1 if the lock was taken and 0 if not.

Properties ​

  • Lock: name of the lock, for example customer-${customerId}.

Example ​

Lock quota, an Evaluate with $[${result} = 1], then the activities that read and update the shared value, and finally Unlock quota.

Unlock Telephony IVR ​

This activity releases a lock taken with Lock (UNLOCK function). ${result} is 1 if it was released.

Properties ​

  • Lock: name of the lock.

Trim Telephony IVR ​

This activity removes the spaces at the beginning, at the end, or at both ends of a text (LTRIM, RTRIM and TRIM functions).

Properties ​

  • Type: Left (beginning), Right (end) or Both.
  • Variable: name of the variable for the result.
  • Value to trim: text to clean, for example ${documentId}.

String between Telephony IVR ​

This activity inserts a text between each character of a value (STRBETWEEN function).

Properties ​

  • Variable: name of the variable for the result.
  • Value: name of the variable that holds the original text (without ${}).
  • String: text to insert between the characters.

Example ​

If ${code} is 1234, Value code and String - give 1-2-3-4.

Comment Telephony IVR Bot Webhook Blacklist Channel provider Event ​

A comment is a note on the canvas. It is not connected to other activities and doesn't run: use it to explain parts of the flow to whoever maintains it. You can resize it.