Axivox User guide
Back to the site

Variable

Stores a value under a name, to reuse it further on in the plan by writing that name between double braces. This is the foundation of the advanced modules.

In brief

Outputsone, with no label
FieldsName, Type, then Value or Items (one per line)
Types offeredText and Array, Text by default
Variables available by default8, with nothing to configure
Lifetimethe current call, and that alone
Name casedoes not matter: {{DATETIME}} and {{datetime}} refer to the same thing

The help text shown in the window is: "Defines a variable, reusable via {{name}} in other modules."

How it works

What a variable is

A variable is a label attached to a value. You give it a name, for example language, and a value, for example en. Anywhere else in the plan, writing {{language}} is the same as writing en.

The point is not to save typing: it's that the value can change from one call to the next. The caller's number, what they dialed on the keypad, the name found in your Odoo are all variables. You build a single plan that behaves differently depending on what it discovers along the way.

A variable lives for the duration of a call. Two simultaneous calls each have their own, without interfering with each other, and nothing is kept from one call to the next.

Where to write it

Anywhere a field accepts text: the URL and body of an API request, the Args of an Odoo request, the recipient and text of a Notification, the text of a Caller ID, the operands of a Condition (If), the expression of a Switch / Case, the message of a Debugging module, the destination of a Call. This module's own Value field also accepts it: a variable can be built from another one.

An unknown name is not flagged: it is replaced with blank, without the slightest warning. This is the most common explanation for a message that arrives half-written.

The variables available with nothing to configure

NameWhat it contains
callerthe caller's number, as passed to us
caller_namethe caller's name, when the carrier passes it
calleethe number dialed inside the installation
didthe number that received the call
tenantthe short name of your installation
domainthe SIP domain of your installation
datetimethe date and time, in your installation's time zone
datetime_utcthe same date and time, in universal time

Added to these, as the plan progresses: those you set with this module, the one from a DTMF entry, the six from Odoo, contact resolution, and the extractions from an API request or an Odoo request.

A ninth variable, caller_e164, contains the possible forms the caller's number can be written in. It is used by the filter of an Odoo request and has little use elsewhere.

What to fill in

FieldWhat is expectedIf you leave it empty
Namea short name, in unaccented letters, digits and underscoresthe variable is not created, the module does nothing and the call carries on
TypeText for a single value, Array for a listText
Valuethe content, which can itself contain {{another_one}}the variable exists, with an empty value
Items (one per line)one value per line, in Arraythe list is empty; blank lines are ignored

Steps

  1. Place the Variable module and connect the previous node to its input.
  2. Open it and enter the Name, for example language. Remember it exactly, you'll need it elsewhere.
  3. Choose the Type. Text in the vast majority of cases; Array if you want a list to be tested further on with the "is in (array)" operator of a Condition (If).
  4. Fill in the Value, or the Items, one per line.
  5. Click Save.
  6. Connect the module's output to the rest of the plan: an output that leads nowhere hangs up the call.
  7. Further on in the plan, insert {{language}} wherever you need it, preferably by copying it from the Available variables panel.
  8. Place a Debugging module right after, with the message language={{language}}. You'll read the actual value instead of assuming it.
  9. Click Save, then Apply changes in the top banner.
  10. Call your number, then open the plan's Debug log and check the value written.

If it doesn't work

My variable shows up blank further on in the plan. Two causes, in this order. The call did not pass through the module that sets it, because it took another branch. Or the name written between braces does not match the module's, even by one letter. An unknown name is replaced with blank, with no error.

I put an accent or a hyphen in the name, and nothing comes out. Only unaccented letters, digits and the underscore are recognized. Rename the variable, then fix every place that uses it.

My list shows up on one line, separated by commas. This is the expected behavior: an Array inserted into text is rendered with commas. An array is meant to be tested, with the "is in (array)" operator of a Condition (If), rather than displayed.

The call cuts off right after the module. Its single output is not connected to anything. A module whose sole output leads nowhere ends the call.

The value is correct on screen but not on the phone. The saved plan is not yet in service. Click Apply changes in the top banner, then call again.

How the call flow is built, explained in pictures

See the Dial plans page