Variables

At the current moment, the variables may be used in:

1

2

3 Static variables in the client /variables/

 

 

Dynamic variables passed when initiating callback

These variables, set at call initiation can be used:

  1. In ivr rule “check varaible”, or other IVR rules: match_variable_name, match_variable_value, play_digits_variable, play_sound_from_variable. Read more about IVR rules here: IVR (/ivr/)

  2. To get this variable in the request of (passed variable will be always shown as “cb_variable_” to avoid rewriting the standard call_interactive parameters)

You can also specify predefined variables through variables:

Name

Value

Description

Name

Value

Description

autoanswer

autoanswer_src

autoanswer_dst

integer range from 0 to 300

"autoanswer": "4" will add the sip header Call-Info for src and dst: 

Call-Info: <sip:anonymous@anonymous.invalid>;answer-after=4

autoanswer_src - add header to src only, autoanswer_dst - only to dst

When receiving a Call-Info header: sip:anonymous@anonymous.invalid;answer-after=X some equipment will automatically answers after X seconds

answering_machine

a string that is interpreted as a boolean type

If the variable is set and the call gets to ivr, where the action will be “play sound”, then it will be considered that the call was answered (bridged = yes).

In case of “answering_machine”=”false” the variable will be ignored.

tag

string

This parameter will be passed in events throughout the call as “Tag”.

For example, if certain calls need to be tracked, then you can set a tag (for example, ignore certain calls in the integration if a certain tag is received in the event)

An example of using callback with variables:

{ "dst_num": "000116644", "src_num": [ "341" ], "variables": {"autoanswer": "4", "testvar": "'testval"} }

 

Static variables in IVR

Variables in IVR can be used in context option rules such as: transfer_variable, match_variable_name, match_variable_value, play_digits_variable, play_sound_from_variable.

More about the rules here:

Most variables can be specified in one context and used in another context, but some variables will be used in the call:

Name

Value

Description

Name

Value

Description

answering_machine

a string that is interpreted as a boolean type

If the variable is set and the call gets to ivr, where the action will be “play sound”, then it will be considered that the call was answered (bridged = yes).

In case of “answering_machine”=”false” the variable will be ignored.

tag

string

This parameter will be passed in events throughout the call as IvrTag.

For example, if you need to track a certain scheme when passing a call through an IVR, then you can set a tag (for example, ignore certain calls in integration from a specific IVR scheme where the tag is set)

 

Static variables in the client /variables/

The resource is intended for pre-configuration and further use of variables.

Description of Data Structures 

Name 

Type 

Mandatory 

Description 

Name 

Type 

Mandatory 

Description 

var 

string 

yes

Variable name

value 

string 

yes

Variable value

Example 

Add variables: 

  • ext_id = 34535

  • caller_id_name = Ivan

"Client" Section Resources 

POST /client/{client_id}/variables/  

Add variables 

URL Options 

Name 

Type 

Name 

Type 

client_id 

string 

JSON Options 

Name 

Type 

Mandatory 

Name 

Type 

Mandatory 

variables 

list 

yes 

GET /client/{client_id}/variables/  

Get variables 

URL Options 

Name 

Type 

Name 

Type 

client_id 

string