Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can test API methods on the interactive API browser page and without writing code
Some of the resources described on the page may not be available by default due to the type of application (see Creating and authorizing applications).

Internal numbers of the IVR type (interactive voice menu) are used to configure the routing of calls inside the PBX using the information entered by the client on the phone keyboard using tone dialing.

To configure the voice menu, you must create an internal number by specifying the ivr value as the type. After that, it becomes possible to configure the voice menu via the API. The audio files that are required to configure the voice greeting are uploaded to the “Sound Sound Files (/sound/)”resource.

Table of Contents

The context is a pre-formed set of rules that can be referenced in the settings. Each context contains the following options:

  • start - describes the actions when entering the context;

  • timeout - describes the actions when a timeout occurs (the client did not make any choice during the specified period of time);

  • invalid – actions that occur when the client selects an option that is not configured.

In addition to the required context options, additional ones can be added (for example, what happens when you type the sequence "100"). All options perform the hangup (hang up) action by default, and this action must be overridden to set the required logic.
The so-called "entry_context" is assigned to the IVR - it gets a call after coming to the voice menu. It can also be called the main context.

The type of voice greeting can be 'background' or 'foreground'. In the case of "background", the system is ready to accept the tone set at any time, and "foreground" obliges the user to listen to the recording until the end and only then make a choice (if the possibility of such a choice is configured).

Description of data structures

Expand
titleBasic parameters (ivr)

Name

Type

Mandatory

Default value

Description

entry_context

long

none

0

ID of the main context

lifetime

long

none

0

The time (in seconds) after which the forced exit from the IVR occurs

lifetime_exp_action

string

none

 

Actions when exiting the IVR on the onset of lifetime:

  • 'transfer' - transfer of the call (lifetime_exp_transfer_dst parameter);

  • 'hangup' - hang up the phone

lifetime_exp_transfer_dst

string

none

Forwards to the specified number when the lifetime expires and lifetime_exp_action= 'transfer'

sleep_time

long

none

0

Time (in milliseconds) to start performing any actions after the call hits the IVR (it can be useful to avoid dropping the first words in the voice greeting after the connection is established)

vm_enabled 

boolean

none

true

This option activates voice mail

vm_greeting 

long

none

0

ID of the audio file that sounds like a voicemail greeting (relevant for vm_enabled)

vm_attach_file 

boolean

none

true

A parameter that specifies whether to attach a file with a voice message when sending a receipt notification (relevant for vm_enabled)

vm_mailto 

string

none

E-mail address for receiving notifications about a new voice message (multiple addresses separated by commas are possible; relevant for vm_enabled)

Expand
titleContext (context)

Name

Type

Mandatory

Default value

Description

timeout

long

none

0

The time (in milliseconds) to wait for the start of the set after executing the last rule in the context option. When the time expires, go to the timeout option

allow_any_dial

boolean

none

true

This parameter determines whether any internal client number can be pre-dialed.

inter_digit_timeout

long

none

0

The time (in milliseconds) to wait for the next digit to be dialed. Upon expiration, the set is considered completed.  For example, with "digit_len": 3, the set "30" will be accepted after inter_digit_timeout

name

string

none

Context name

digit_len

long

none

0

Client internal number length: after entering the specified number of digits, the input is considered complete (without the need to wait for "inter_digit_timeout"). Also defines the maximum length of a possible set by the client. For example, "digit_len": 3 allows you to type "7", "22", "300", but it doesn't let you select "4000"

Expand
titleContext option (context_option)

Name

Type

Mandatory

Default value

Description

digits

string

none

 

Adds a custom option to the standard context options (start, timeout, invalid). For example, the value "2" will set the ability to process the input of the number "2" after entering the context

Expand
titleContext option rule (context_option_rule)

Name

Type

Mandatory

Default value

Description

action

string

none

Directly defines what needs to be done in this rule:

  • 'transfer' – transfer the call to the number (s) from transfer_dst. The maximum possible number of forwarding numbers is 10. To simultaneously forward to a larger number of numbers, use the simple_transfer action;

  • 'simple_transfer' - transfer the call (make a call forwarding) to the number (s) from the transfer_dst parameter. With this type of forwarding, the incoming call rules for the internal numbers listed in transfer_dst are not executed;

  • 'hangup' - hang up the phone;

  • 'play_sound' – play the greeting (sound and sound_type parameters);

  • 'play_silence' – silence in background format (silence_time parameter);

  • 'jump_to_context' – switch to another context (context and context_option parameters);

  • 'play_digits' – play digits (the digits and play_digits_method parameters);

  • 'play_digits_from_variable' – play the numbers contained in the variable (the play_digits_variable and play_digits_method parameters);

  • 'record_digits' - write a set of digits to a variable (record_digits_variable, record_digits_max, and record_digits_sound parameters);

  • 'set_variable' – set a variable in the channel (set_variable_name and set_variable_value parameters);

  • 'transfer_from_variable' - transfer the call to the number contained in the variable (transfer_variable parameter);

  • 'call_interactive' - Call Interactive function: make an HTTP request to a specific URL (call_interactive_url and call_interactive_method parameters);

  • 'set_caller_id_number' - set the caller number for further redirects from the IVR (caller_id_number parameter);

  • 'set_caller_id_name' - set the name of the caller for further forwarding from the IVR (caller_id_name parameter);

  • 'quality_rate' - set a rule for evaluating the quality of the conversation (the main parameters for this action are sound and max_rate);

  • 'voice_helper' - set the voice navigation rule (the main parameters for this action: sound, voice_helper_digits_max, voice_helper_rules, voice_helper_timeout). A description of the rule and parameters, as well as usage examples, are available on a separate page “Convert Convert speech to text”text

  • 'start_record' – start recording the caller. Recording will stop when recording is enabled on any other extension.

digits

string

none

Speak the specified numbers (using the play_digits_method method), required when action= 'play_digits'

sound

long

none

0

The ID of the audio sound file to play is required when action= 'play_sound'

sound_type

string

none

 

Required if the sound ID is present. It can take the following values:

  • 'background' – the user can make an additional set while the greeting sounds;

  • 'foreground' – the user must listen to the greeting until the end

play_digits_method

string

none

 

Required when the digits option is set. May be:

  • 'pronounced' – pronounce the digits as a single number;

  • 'iterated' – say the numbers sequentially one after the other

interval

long

none

0

The rule is executed only in this time interval

caller_id_action

string

none

 

Defines the method for analyzing the call source caller_id:

  • 'matches' – must match (caller_id must be set);

  • 'not_matches' – must not match (caller_id must be set);

  • 'anonymous' - the source is hidden;

  • 'any' – any source

caller_id

string

none

 

The rule will only work for calls whose source is determined by this field. The field is filled in as a PCRE regular expression. For example: "^(\+|)7812" will match all sources starting with "+7812" or "7812"

context_option

string

none

Defines the context option to go to when action= 'jump_to_context'

silence_time

long

none

0

The time (in milliseconds) when there are no sounds from the PBX, required when action= 'play_silence'

context

long

none

0

Specifies the ID of the other context to jump to, required when action= 'jump_to_context'

transfer_dst

string

none

 

Forwards to the specified number. If you need to forward to several numbers at the same time (simultaneous call), then these numbers are listed separated by a space (required for action= 'transfer')

set_variable_name

string

none

 

The name of the variable to be set. It must start with a Latin letter, and may contain Latin letters, numbers, and underscores. Required for action='set_variable'

set_variable_value

string

none

The value of the variable to be set. Required for action='set_variable'

match_variable_name

string

none

 

The name of the IVR variable whose value will be compared with the value specified by the match_variable_value parameter. If the values match, the rule is executed. The variable being compared can be set by the system (see the section "Preset variables in IVR"), or set by a context option rule of the set_variable type

match_variable_value

string

none

 

The value that will be compared with the value of the variable whose name is set by the match_variable_name parameter. If the values match, the rule is executed. Required if the match_variable_name parameter is set

transfer_variable

string

none

 

The name of the variable whose value will be used as the forwarding number. If the variable is not set, the action is not performed. The variable can be set using the set_variable, record_digits action, or using the Call Interactive function. Required when action='transfer_from_variable'

play_digits_variable

string

none

 

The name of the variable whose value will be used for playing numbers. If the variable is not set, the action is not performed. The variable can be set using the set_variable, record_digits action, or using the Call Interactive function. Required when action='play_digits_from_variable'

record_digits_variable

string

none

The name of the variable in which the entered digits will be written. Required when action='record_digits'

record_digits_max

string

none

 

The maximum number of entered digits to be written to the variable. Required when action='record_digits'

max_rate

long

none

5

Maximum conversation score (this parameter is only used for the quality_rate action)

record_digits_sound

long

none

0

ID of the audio sound file that can be played before writing the entered digits to the variable

call_interactive_url

string

none

 

The URL to which the HTTP request will be made by the Call Interactive function. Must start with http:// or https://. Required for action= 'call_interactive'

call_interactive_method

string

none

 

The method that will be used for the HTTP request by the Call Interactive function. It can take the value 'GET' or 'POST'. Required for action= 'call_interactive'

call_interactive_timeout

long

none

0

The time, in seconds, during which the system will wait for a response to the HTTP request of the Call Interactive function. If the called URL did not return a response after this time, the following rule is executed

caller_id_number

string

none

 

The number of the caller for further forwarding. This parameter can contain the names of variables previously set in other actions, as well as preset IVR variables (see the corresponding subsection). Variable names are specified in the format ${variable name}. Required when action='set_caller_id_number'

caller_id_name

string

none

 

The name of the caller for further forwarding. This parameter can contain the names of variables previously set in other actions, as well as preset IVR variables (see the corresponding subsection). Variable names are specified in the format ${variable name}. Required when action='set_caller_id_name'

id

long

none

0

Unique ID of the rule (within the internal number)

name

string

none

The name of the rule, not necessarily unique

final

boolean

none

true

This rule is the last one, and the subsequent ones do not need to be processed

hangup_cause

string

none

normal

The reason for the end of the call (the field can be ignored; present for backward compatibility)

record_digits_timeout

long

none

0

The time in seconds during which the entered digits will be recorded

transfer_timeout

long

none

0

The time in seconds during which the call will be transferred. If the time has elapsed and the transfer has not occurred, then the next rule is processed

call_status

string

none

any

The rule will work only if the status of the previous call (the innermost number or the previous forwarding rule) matches the value passed in this parameter:

  • no_answer'– there was no response (by timeout or some error occurred, except " SIP/2.0 486 Busy Here");

  • 'busy' - the number is busy (received by SIP/2.0 486 Busy Here);

  • 'any' – any result

play_sound_from_variable

boolean

none

false

The play_sound_from_variable parameter is available for the play_sound, quality_rate, and voice_helper rules. This system variable can store a greeting synthesized using the text_to_speech action in the "Call interactive" function. If there is no synthesized greeting, and the play_sound_from_variable parameter active, the default sound file specified in the sound parameter will be played

Expand
titlePreset variables in the IVR

Variable name

Description

called_did

The public number (DID) to which the call came to the system. If the call is local, the variable contains the IVR number without the client prefix.

caller_id_name

Caller Name

caller_id_number

Caller ID number

Examples

For a client with a unique ID 12, you need to create a voice menu (IVR) with the number "071", when entering which the following rules apply:

  • Play the foreground music file "advertising.wav" 1 time;

  • Play the background music file "hello.wav" and, if the client does not select it, automatically transfer it to the internal number 050;

  • When dialing "1", the call is transferred to the mobile phone +7(987)6543210;

  • When you dial "2", the call is transferred to the internal number 002;

  • Allow direct dialing of three-digit internal numbers.

1. Using the Sound Files resource (/sound/), you need to download the hello.wav and advertising.wav files:

System response:

Code Block
{
  "id": 51,
  "client_id": 12,
  "title": "my welcome file",
  "dealer_id": null,
  "filename": "hello.wav"
}
Code Block
{
  "id": 52,
  "client_id": 12,
  "title": "my ad file",
  "dealer_id": null,
  "filename": "advertising.wav"
}

IDs of new files: hello.wav "id": 51; advertising.wav "id": 52

2. Using the resource Internal number (/extension/), create an internal number of the type " IVR":

System response:

Code Block
{
  "status": "active",
  "domain": " ",
  "create_date": "2020-03-20 17:11:10",
  "name": "000*071",
  "dial_rule_limit": null,
  "extension_group_id": null,
  "label": "test IVR",
  "caller_id_name": null,
  "client_id": 12,
  "extra_params": null,
  "message_did": null,
  "dial_rule_id": null,
  "ani_rfc3325": false,
  "type": "ivr",
  "id": 204,
  "did_as_transfer_caller_id": null
}

ID of the new internal number "id": 204

3. Create a context that will be the main one (entry_context):

System response:

Code Block
{
  "name": "Main context",
  "inter_digit_timeout": 2000,
  "timeout": 5000,
  "extra_params": null,
  "allow_any_dial": true,
  "id": 1,
  "digit_len": 3,
  "description": null
}

Context ID "id": 1

4. Now you can bind this context as the main one to our IVR, at the same time we specify "sleep-time", which allows you to set a pause from the arrival of the call in the IVR before the start of any actions of the "entry_context" context":

System response:

Code Block
{
  "lifetime_exp_action": "hangup",
  "entry_context": 1,
  "lifetime_exp_transfer_dst": null,
  "vm_enabled": false,
  "vm_greeting": null,
  "lifetime": 1800,
  "vm_attach_file": true,
  "sleep_time": 5000,
  "vm_mailto": null
}

5. As noted earlier, each context already has a “start” option.  Let's configure it to play the foreground music file "advertising.wav":

Expand
titleSystem response:
Code Block
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 1,
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": 52,
    "sound_type": "foreground",
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": null,
    "context": null,
    "action": "play_sound",
    "set_variable_value": null,
    "call_interactive_timeout": null,
    "record_digits_sound": null
  }
]

6. Next, play the hello.wav file in the background by analogy:

… 

Expand
titleSystem response:
Code Block
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 2,
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": 51,
    "sound_type": "background",
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": null,
    "context": null,
    "action": "play_sound",
    "set_variable_value": null,
    "call_interactive_timeout": null,
    "record_digits_sound": null
  }
]

7. Now, in the "Main Context" context, we will add the ability to process the selection " 1":

… 

Expand
titleSystem response:
Code Block
{
  "digits": "1"
}

8. And we will indicate what action should be performed when selecting "1" - transfer to mobile +7(987)6543210:

… 

Expand
titleSystem response:
Code Block
Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"In the "},{"type":"text","text":"authentication ","marks":[{"type":"strong"}]},{"type":"text","text":"section enter the "},{"type":"text","text":"Application_ID","marks":[{"type":"strong"}]},{"type":"text","text":" and "},{"type":"text","text":"Application_Secret","marks":[{"type":"strong"}]},{"type":"text","text":" values obtained during the application registration in the "},{"type":"text","text":"client_id ","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{"type":"text","text":"client_secret","marks":[{"type":"strong"}]},{"type":"text","text":" fields, then click on the \""},{"type":"text","text":"Try it out!","marks":[{"type":"strong"}]},{"type":"text","text":"\" button. If the application data is correct, an access token ("},{"type":"text","text":"access_token","marks":[{"type":"strong"}]},{"type":"text","text":") will be returned in response. The received access token should be entered into the \""},{"type":"text","text":"Access Token Field","marks":[{"type":"strong"}]},{"type":"text","text":"\" at the top of the page and saved by clicking the \""},{"type":"text","text":"Set Token","marks":[{"type":"strong"}]},{"type":"text","text":"\" button."}]},{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/client/@me/sound/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"”file”: ”hello.wav“,"},{"type":"hardBreak"},{"type":"text","text":"”title”: “my greeting file“"},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/client/@me/sound/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"”file”: “advertising.wav“,"},{"type":"hardBreak"},{"type":"text","text":"”title”: “my advertising file“"},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"b222e13c-9680-46d4-8bfc-0c4690a68e26","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"To send requests using the cURL program, set the values of the "},{"type":"text","text":"url ","marks":[{"type":"strong"}]},{"type":"text","text":"and "},{"type":"text","text":"access_token","marks":[{"type":"strong"}]},{"type":"text","text":" variables:"}]},{"type":"paragraph","content":[{"type":"text","text":"export url=\"https://<hostname>/api/ver1.0\"","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"hardBreak"},{"type":"text","text":"(where the hostname — is the hostname of the API-server provider of IP-telephony),"}]},{"type":"paragraph","content":[{"type":"text","text":"export access_token=\"8SNsrS0jV35vfmKqKeKtRrHfpbg4UX\"","marks":[{"type":"code"}]},{"type":"text","text":" "},{"type":"hardBreak"},{"type":"text","text":"(the received access token)."}]},{"type":"paragraph","content":[{"type":"text","text":"Send a request:"}]},{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-F file=@hello.wav \\\n-F \"title=мой файл приветствия\" \\\n-X POST ${url}/client/@me/sound/"}]},{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-F file=@advertising.wav \\\n-F \"title=мой файл рекламы\" \\\n-X POST ${url}/client/@me/sound/"}]}]},"id":"cec048c8-e769-4ced-867b-e82e463821db","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"To send requests in Python, set the values of the variables URL and ACCESS_TOKEN:"}]},{"type":"paragraph","content":[{"type":"text","text":"URL = \"https://<hostname>/api/ver1.0\"","marks":[{"type":"code"}]},{"type":"hardBreak"},{"type":"text","text":"(where the hostname — is the hostname of the API-server provider of IP-telephony),"}]},{"type":"paragraph","content":[{"type":"text","text":"ACCESS_TOKEN = \"8SNsrS0jV35vfmKqKeKtRrHfpbg4UX\"","marks":[{"type":"code"}]},{"type":"hardBreak"},{"type":"text","text":"(the received access token)."}]},{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\nimport json\n\nurl = f'{URL}/client/@me/sound/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'content-type': 'application/json'\n}\nfiles = {'file': open('hello.wav', 'rb')}\ndata = {'title': 'мой файл приветствия'}\nresponse = requests.post(url, headers=headers, files=files, data=json.dumps(data))\nprint(response.text)"}]},{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\nimport json\n\nurl = f'{URL}/client/@me/sound/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'content-type': 'application/json'\n}\nfiles = {'file': open('advertising.wav', 'rb')}\ndata = {'title': 'мой файл рекламы'}\nresponse = requests.post(url, headers=headers, files=files, data=json.dumps(data))\nprint(response.text)"}]}]},"id":"b4d87dfd-9fde-4674-88c5-dc97daf4bf44","label":"In Python3","type":"tab"}]

System response:

Code Block
languagejson
{
  "id": 51,
  "client_id": 12,
  "title": "my welcome file",
  "dealer_id": null,
  "filename": "hello.wav"
}
Code Block
languagejson
{
  "id": 52,
  "client_id": 12,
  "title": "my ad file",
  "dealer_id": null,
  "filename": "advertising.wav"
}

IDs of new files: hello.wav "id": 51; advertising.wav "id": 52

2. Using the resource Internal number (/extension/), create an internal number of the type " IVR":

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/client/@me/extension/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"status\": \"active\","},{"type":"hardBreak"},{"type":"text","text":"\"name\": \"071\","},{"type":"hardBreak"},{"type":"text","text":"\"label\": \"test IVR\","},{"type":"hardBreak"},{"type":"text","text":"\"type\": \"ivr\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"02599fd0-9db5-4706-8f77-fe788de62d34","label":"Interactive API Browser ","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n    \"status\": \"active\",\n    \"name\": \"071\",\n    \"label\": \"test IVR\",\n    \"type\": \"ivr\"\n}' \\\n-X POST ${url}/client/@me/extension/"}]}]},"id":"74cfb074-4fb2-4a7a-8b3b-0e663c54ae96","label":"cURL Program ","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/client/@me/extension/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"status\": \"active\",\n    \"name\": \"071\",\n    \"label\": \"test IVR\",\n    \"type\": \"ivr\"\n}'''\nresponse = requests.post(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"557a5d5a-4a08-44cc-8efc-4edca4432414","label":"In Python3","type":"tab"}]

System response:

Code Block
languagejson
{
  "status": "active",
  "domain": "sip.ringme.ru",
  "create_date": "2020-03-20 17:11:10",
  "name": "000*071",
  "dial_rule_limit": null,
  "extension_group_id": null,
  "label": "test IVR",
  "caller_id_name": null,
  "client_id": 12,
  "extra_params": null,
  "message_did": null,
  "dial_rule_id": null,
  "ani_rfc3325": false,
  "type": "ivr",
  "id": 204,
  "did_as_transfer_caller_id": null
}

ID of the new internal number "id": 204

3. Create a context that will be the main one (entry_context):

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/context/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":" {"},{"type":"hardBreak"},{"type":"text","text":"\"digit_len\": 3,"},{"type":"hardBreak"},{"type":"text","text":"\"allow_any_dial\": true,"},{"type":"hardBreak"},{"type":"text","text":"\"inter_digit_timeout\": 2000,"},{"type":"hardBreak"},{"type":"text","text":"\"name\": \"Main context\","},{"type":"hardBreak"},{"type":"text","text":"\"timeout\": 5000"},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"a42a44b2-2e44-4f6e-8d18-2eb3c4007a88","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"digit_len\": 3,\n  \"allow_any_dial\": true,\n  \"inter_digit_timeout\": 2000,\n  \"name\": \"Main context\",\n  \"timeout\": 5000\n}' \\\n-X POST ${url}/extension/204/ivr/context/"}]}]},"id":"5b622b7d-a728-4041-94d3-0a8e00b24802","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/extension/204/ivr/context/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"digit_len\": 3,\n    \"allow_any_dial\": true,\n    \"inter_digit_timeout\": 2000,\n    \"name\": \"Main context\",\n    \"timeout\": 5000\n}'''\nresponse = requests.post(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"a1f4e027-932a-40f3-a003-2ed349f76b82","label":"In Python3","type":"tab"}]

System response:

Code Block
languagejson
{
  "name": "Main context",
  "inter_digit_timeout": 2000,
  "timeout": 5000,
  "extra_params": null,
  "allow_any_dial": true,
  "id": 1,
  "digit_len": 3,
  "description": null
}

Context ID "id": 1

4. Now you can bind this context as the main one to our IVR, at the same time we specify "sleep-time", which allows you to set a pause from the arrival of the call in the IVR before the start of any actions of the "entry_context" context":

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"PUT"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"sleep_time\": 5000,"},{"type":"hardBreak"},{"type":"text","text":"\"entry_context\": 1"},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"3c3c7601-c185-460b-8011-e1641d0af169","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"sleep_time\": 5000,\n  \"entry_context\": 1\n}' \\\n-X PUT ${url}/extension/204/ivr/"}]}]},"id":"b365bb01-85d0-4f3b-a56b-642729722981","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/extension/204/ivr/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"sleep_time\": 5000,\n    \"entry_context\": 1\n}'''\nresponse = requests.put(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"5e21f68b-6c2b-4229-9c93-ca59fb666435","label":"In Python3","type":"tab"}]

System response:

Code Block
languagejson
{
  "lifetime_exp_action": "hangup",
  "entry_context": 1,
  "lifetime_exp_transfer_dst": null,
  "vm_enabled": false,
  "vm_greeting": null,
  "lifetime": 1800,
  "vm_attach_file": true,
  "sleep_time": 5000,
  "vm_mailto": null
}

5. As noted earlier, each context already has a “start” option.  Let's configure it to play the foreground music file "advertising.wav":

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/context/1/options/start/rules/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"sound\": 52,"},{"type":"hardBreak"},{"type":"text","text":"\"sound_type\": \"foreground\","},{"type":"hardBreak"},{"type":"text","text":"\"action\": \"play_sound\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"f938a03f-261d-4c72-a55e-66a48756f517","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"sound\": 52,\n  \"sound_type\": \"foreground\",\n  \"action\": \"play_sound\"\n}' \\\n-X POST ${url}/extension/204/ivr/context/1/options/start/rules/"}]}]},"id":"566b075a-9d61-4d52-8733-04bc3befdcd1","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/extension/204/ivr/context/1/options/start/rules/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"sound\": 52,\n    \"sound_type\": \"foreground\",\n    \"action\": \"play_sound\"\n}'''\nresponse = requests.post(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"7532e223-a4df-4d1e-8c0a-1d6d7380d18e","label":"In Python3","type":"tab"}]

Expand
titleSystem response:
Code Block
languagejson
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 1,
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": 52,
    "sound_type": "foreground",
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": null,
    "context": null,
    "action": "play_sound",
    "set_variable_value": null,
    "call_interactive_timeout": null,
    "record_digits_sound": null
  }
]

6. Next, play the hello.wav file in the background by analogy:

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/context/1/options/start/rules/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"sound\": 51,"},{"type":"hardBreak"},{"type":"text","text":"\"sound_type\": \"background\","},{"type":"hardBreak"},{"type":"text","text":"\"action\": \"play_sound\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"88927b31-bc78-43c6-8ed2-0e186d20a0c4","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"sound\": 51,\n  \"sound_type\": \"background\",\n  \"action\": \"play_sound\"\n}' \\\n-X POST ${url}/extension/204/ivr/context/1/options/start/rules/"}]}]},"id":"05bf7b04-00c6-47b7-bdae-43224eb78c4a","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/extension/204/ivr/context/1/options/start/rules/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"sound\": 51,\n    \"sound_type\": \"background\",\n    \"action\": \"play_sound\"\n}'''\nresponse = requests.post(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"153c1a48-ceaf-43b4-bffc-e0e578ca1629","label":"In Python3","type":"tab"}]
Expand
titleSystem response:
Code Block
languagejson
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 2,
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": 51,
    "sound_type": "background",
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": null,
    "context": null,
    "action": "play_sound",
    "set_variable_value": null,
    "call_interactive_timeout": null,
    "record_digits_sound": null
  }
]

7. Now, in the "Main Context" context, we will add the ability to process the selection " 1":

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/context/1/options/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"digits\": \"1\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"ffa12515-fc08-4bed-a283-c252f5004d0b","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{digits\": \"1\"}' \\\n-X POST ${url}/extension/204/ivr/context/1/options/"}]}]},"id":"e7d90646-d38e-427d-8837-247305ee797e","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\nimport json\n\nurl = f'{URL}/extension/204/ivr/context/1/options/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'content-type': 'application/json'\n}\ndata = {\"digits\": \"1\"}\nresponse = requests.post(url, headers=headers, data=json.dumps(data))\nprint(response.text)"}]}]},"id":"a2baf9ed-37ab-49e9-8a8b-435a60377ae7","label":"In Python3","type":"tab"}]

Expand
titleSystem response:
Code Block
languagejson
{
  "digits": "1"
}

8. And we will indicate what action should be performed when selecting "1" - transfer to mobile +7(987)6543210:

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/context/1/options/1/rules/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"transfer_dst\": \"+7987654321\","},{"type":"hardBreak"},{"type":"text","text":"\"action\": \"transfer\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"6e294d41-41cb-40c5-932f-f732e35bede3","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"transfer_dst\": \"+7987654321\",\n  \"action\": \"transfer\"\n}' \\\n-X POST ${url}/extension/204/ivr/context/1/options/1/rules/"}]}]},"id":"17c661ac-d72a-47ec-84d4-61217563034b","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/extension/204/ivr/context/1/options/1/rules/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"transfer_dst\": \"+7987654321\",\n    \"action\": \"transfer\"\n}'''\nresponse = requests.post(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"c7e32cbb-ddc0-4a6f-b756-92bc283de1c3","label":"In Python3","type":"tab"}]
Expand
titleSystem response:
Code Block
languagejson
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 3,
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": null,
    "sound_type": null,
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": "+7987654321",
    "context": null,
    "action": "transfer",
    "set_variable_value": null,
    "call_interactive_timeout": null,
    "record_digits_sound": null
  }
]

9. By analogy, we will add a call to the internal number "002" by dialing "2":

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/context/1/options/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"digits\": \"2\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"766a4c8d-fd0c-4bba-8a27-f411843f2f74","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{digits\": \"2\"}' \\\n-X POST ${url}/extension/204/ivr/context/1/options/"}]}]},"id":"6154aae6-31a2-406d-aeab-88928233bf8d","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\nimport json\n\nurl = f'{URL}/extension/204/ivr/context/1/options/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'content-type': 'application/json'\n}\ndata = {\"digits\": \"2\"}\nresponse = requests.post(url, headers=headers, data=json.dumps(data))\nprint(response.text)"}]}]},"id":"be1ee04e-1a9b-46fe-b804-e314021537c7","label":"In Python3","type":"tab"}]
Expand
titleSystem response:
Code Block
languagejson
{
  "digits": "2"
}
Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/context/1/options/2/rules/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"transfer_dst\": \"002\","},{"type":"hardBreak"},{"type":"text","text":"\"action\": \"transfer\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"0d19e36e-0835-499f-a979-7fbb232531fd","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"transfer_dst\": \"002\",\n  \"action\": \"transfer\"\n}' \\\n-X POST ${url}/extension/204/ivr/context/1/options/2/rules/"}]}]},"id":"d070608a-f037-4de9-9a7d-da46316c72d6","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/extension/204/ivr/context/1/options/2/rules/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"transfer_dst\": \"002\",\n    \"action\": \"transfer\"\n}'''\nresponse = requests.post(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"1bf77555-dbc9-419e-8e41-67060b1040d5","label":"In Python3","type":"tab"}]
Expand
titleSystem response:
Code Block
languagejson
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 4,
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": null,
    "sound_type": null,
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": "002",
    "context": null,
    "action": "transfer",
    "set_variable_value": null,
    "call_interactive_timeout": null,
    "record_digits_sound": null
  }
]

10. If there is no choice, the call should be automatically transferred to the internal number "050". As already noted, there is a "timeout" option in the context, with which you can set this action:

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"POST"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/ivr/144/context/2/options/timeout/rules/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"{"},{"type":"hardBreak"},{"type":"text","text":"\"transfer_dst\": \"050\","},{"type":"hardBreak"},{"type":"text","text":"\"action\": \"transfer\""},{"type":"hardBreak"},{"type":"text","text":"}"}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"5f398732-8624-4c2e-b8f2-33c9e1b1b278","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"transfer_dst\": \"050\",\n  \"action\": \"transfer\"\n}' \\\n-X POST ${url}/ivr/144/context/2/options/timeout/rules/"}]}]},"id":"f2831969-bd3a-472f-ae7c-dab4872cec9f","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/ivr/144/context/2/options/timeout/rules/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}',\n    'Content-Type': 'application/json'\n}\ndata = '''{\n    \"transfer_dst\": \"050\",\n    \"action\": \"transfer\"\n}'''\nresponse = requests.post(url, headers=headers, data=data)\nprint(response.text)"}]}]},"id":"19cbffd1-e828-42c7-b89a-2aaf64bc6e9d","label":"In Python3","type":"tab"}]
Expand
titleSystem response:
Code Block
languagejson
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 
3
5,
   
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": null,
    "sound_type": null,
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": "
+7987654321
050",
    "context": null,
    "action": "transfer",
    "set_variable_value": null,
    "call_interactive_timeout": null,
 
    
  
"record_digits_sound": null
  }
]

9. By analogy, we will add a call to the internal number "002" by dialing "2":

… 

Expand
titleSystem response:
Code Block
{
  "digits": "2"
}

… 

Expand
titleSystem response:
Code Block
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 4,
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": null,
    "sound_type": null,
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": "002",
    "context": null,
    "action": "transfer",
    "set_variable_value": null,
    "call_interactive_timeout": null,
    "record_digits_sound": null
  }
]

10. If there is no choice, the call should be automatically transferred to the internal number "050". As already noted, there is a "timeout" option in the context, with which you can set this action:

… 

 

Expand
titleSystem response:
Code Block
[
  {
    "transfer_variable": null,
    "call_status": "any",
    "play_digits_method": null,
    "voice_helper_classic_term": true,
    "caller_id": null,
    "voice_helper_final_count": null,
    "match_variable_value": null,
    "play_digits_variable": null,
    "call_interactive_method": null,
    "voice_helper_timeout": null,
    "id": 5,
    "record_digits_max": null,
    "voice_helper_digits_max": null,
    "match_variable_name": null,
    "caller_id_action": "any",
    "context_option": null,
    "silence_time": null,
    "set_variable_name": null,
    "caller_id_number": null,
    "hangup_cause": "normal",
    "record_digits_timeout": null,
    "sound": null,
    "sound_type": null,
    "call_interactive_url": null,
    "max_rate": 5,
    "caller_id_name": null,
    "voice_helper_rules": null,
    "transfer_timeout": null,
    "digits": null,
    "name": null,
    "record_digits_variable": null,
    "interval": null,
    "final": true,
    "transfer_dst": "050",
    "context": null,
    "action": "transfer",
    "set_variable_value": null,
    "call_interactive_timeout": null,
    "record_digits_sound": null
  }
]

11. As a result, you can view all the available context options:

… 

System response:

code

11. As a result, you can view all the available context options:

Tabs
[{"content":{"version":1,"type":"doc","content":[{"type":"table","attrs":{"isNumberColumnEnabled":false,"layout":"default"},"content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Method","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Resource","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Data","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"GET"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"/extension/204/ivr/context/1/options/"}]}]},{"type":"tableCell","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":" "}]}]}]}]},{"type":"paragraph","content":[]}]},"id":"bf9f5935-be1d-4fa9-9f68-c3a0bba981f4","label":"Interactive API Browser","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"shell"},"content":[{"type":"text","text":"curl \\\n-H \"Authorization: Bearer ${access_token}\" \\\n-X GET ${url}/extension/204/ivr/context/1/options/"}]}]},"id":"005b5f67-e802-43e5-b482-b888f53846ed","label":"cURL Program","type":"tab"},{"content":{"version":1,"type":"doc","content":[{"type":"codeBlock","attrs":{"language":"python"},"content":[{"type":"text","text":"#!/usr/bin/python\n\nimport requests\n\nurl = f'{URL}/extension/204/ivr/context/1/options/'\nheaders = {\n    'Authorization': f'Bearer {ACCESS_TOKEN}'\n}\nresponse = requests.get(url, headers=headers)\nprint(response.text)"}]}]},"id":"b6536d49-1ddd-445f-b9f2-395c770bd748","label":"In Python3","type":"tab"}]

System response:

Code Block
languagejson
[
  {
    "digits": "start"
  },
  {
    "digits": "timeout"
  },
  {
    "digits": "invalid"
  },
  {
    "digits": "2"
  },
  {
    "digits": "1"
  }
]

Resources of the section "Voice menu (ivr)"

Expand
titlePUT /extension/{extension_id}/ivr/

PUT /extension/{extension_id}/ivr/

Update the voice menu configuration

URL Parameters

Name

Type

extension_id

string

JSON parameters

Name

Type

Mandatory

entry_context

long

none

lifetime

long

none

lifetime_exp_action

string

none

lifetime_exp_transfer_dst

string

none

sleep_time

long

none

vm_attach_file

boolean

none

vm_enabled

boolean

none

vm_greeting

long

none

vm_mailto

string

none

Response fields

Name

Type

entry_context

long

lifetime

long

lifetime_exp_action

string

lifetime_exp_transfer_dst

string

sleep_time

long

vm_enabled

boolean

vm_greeting

long

vm_attach_file

boolean

vm_mailto

string

Expand
titleGET /extension/{extension_id}/ivr/

GET /extension/{extension_id}/ivr/

Get the voice menu configuration

URL Parameters

Name

Type

extension_id

string

Response fields

Name

Type

entry_context

long

lifetime

long

lifetime_exp_action

string

lifetime_exp_transfer_dst

string

sleep_time

long

vm_attach_file

boolean

vm_enabled

boolean

vm_greeting

long

vm_mailto

string

Expand
titlePOST /extension/{extension_id}/ivr/context/

POST /extension/{extension_id}/ivr/context/

Add voice menu context

URL Parameters

Name

Type

extension_id

string

JSON parameters

Name

Type

Mandatory

timeout

long

none

allow_any_dial

boolean

none

inter_digit_timeout

long

none

name

string

yes

digit_len

long

none

Response fields

Name

Type

name

string

inter_digit_timeout

long

timeout

long

allow_any_dial

boolean

id

long

digit_len

long

Expand
titleGET /extension/{extension_id}/ivr/context/

GET /extension/{extension_id}/ivr/context/

Get a list of voice menu contexts

URL Parameters

Name

Type

extension_id

string

Response fields

Name

Type

name

string

inter_digit_timeout

long

timeout

long

allow_any_dial

boolean

id

long

digit_len

long

Expand
titlePUT /extension/{extension_id}/ivr/context/{context_id}

PUT /extension/{extension_id}/ivr/context/{context_id}

Update the voice menu context

URL Parameters

Name

Type

context_id

long

extension_id

string

JSON parameters

Name

Type

Mandatory

timeout

long

none

allow_any_dial

boolean

none

inter_digit_timeout

long

none

name

string

none

digit_len

long

none

Response fields

Name

Type

name

string

inter_digit_timeout

long

timeout

long

allow_any_dial

boolean

id

long

digit_len

long

Expand
titleGET /extension/{extension_id}/ivr/context/{context_id}

GET /extension/{extension_id}/ivr/context/{context_id}

Get the voice menu context

URL Parameters

Name

Type

context_id

integer

extension_id

string

Response fields

Name

Type

name

string

inter_digit_timeout

long

timeout

long

allow_any_dial

boolean

id

long

digit_len

long

Expand
titleDELETE /extension/{extension_id}/ivr/context/{context_id}

DELETE /extension/{extension_id}/ivr/context/{context_id}

Delete the voice menu context

URL Parameters

Name

Type

context_id

integer

extension_id

string

Expand
titlePOST /extension/{extension_id}/ivr/context/{context_id}/options/

POST /extension/{extension_id}/ivr/context/{context_id}/options/

Add a voice menu context option

URL Parameters

Name

Type

context_id

integer

extension_id

string

JSON parameters

Name

Type

Mandatory

digits

string

yes

Response fields

Name

Type

digits

string

Expand
titleGET /extension/{extension_id}/ivr/context/{context_id}/options/

GET /extension/{extension_id}/ivr/context/{context_id}/options/

Get a list of voice menu context options

URL Parameters

Name

Type

context_id

integer

extension_id

string

Response fields

Name

Type

digits

string

Expand
titleDELETE /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}

DELETE /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}

Remove the voice menu context option

URL Parameters

Name

Type

context_id

integer

extension_id

string

option_digits

string

Expand
titlePOST /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/

POST /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/

Add a voice menu context rule

URL Parameters

Name

Type

context_id

integer

extension_id

string

option_digits

string

JSON parameters

Name

Type

Mandatory

action

string

yes

call_interactive_method

string

none

call_interactive_timeout

long

none

call_interactive_url

string

none

call_status

string

none

caller_id

string

none

caller_id_action

string

none

caller_id_name

string

none

caller_id_number

string

none

context

long

none

context_option

string

none

digits

string

none

final

boolean

none

hangup_cause 

string

none

interval

long

none

match_variable_name

string

none

match_variable_value

string

none

max_rate

long

none

name

string

none

order_position

string

none

play_digits_method

string

none

play_digits_variable

string

none

record_digits_max

long

none

record_digits_sound

long

none

record_digits_timeout 

long

none

record_digits_variable

string

none

set_variable_name

string

none

set_variable_value

string

none

silence_time

long

none

sound

long

none

sound_type

string

none

transfer_dst

string

none

transfer_variable

string

none

Response fields

Name

Type

action

string

call_interactive_method

string

call_interactive_timeout

long

call_interactive_url

string

call_status

string

caller_id

string

caller_id_action

string

caller_id_name

string

caller_id_number

string

context

long

context_option

string

digits

string

final

boolean

hangup_cause 

string

id

long

interval

long

match_variable_name

string

match_variable_value

string

max_rate

long

name

string

play_digits_method

string

play_digits_variable

string

record_digits_max

long

record_digits_sound

long

record_digits_timeout 

long

record_digits_variable

string

set_variable_name

string

set_variable_value

string

silence_time

long

sound

long

sound_type

string

transfer_dst

string

transfer_timeout 

long

transfer_variable

string

Expand
titleGET /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/

GET /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/

Get a list of voice menu context rules

URL Parameters

Name

Type

context_id

integer

extension_id

string

option_digits

string

Response fields

Name

Type

action

string

call_interactive_method

string

call_interactive_timeout

long

call_interactive_url

string

call_status

string

caller_id

string

caller_id_action

string

caller_id_name

string

caller_id_number

string

context

long

context_option

string

digits

string

final

boolean

hangup_cause 

string

id

long

interval

long

match_variable_name

string

match_variable_value

string

max_rate

long

name

string

play_digits_method

string

play_digits_variable

string

record_digits_max

long

record_digits_sound

long

record_digits_timeout 

long

record_digits_variable

string

set_variable_name

string

set_variable_value

string

silence_time

long

sound

long

sound_type

string

transfer_dst

string

transfer_timeout 

long

transfer_variable

string

Expand
titlePUT /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/order/

PUT /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/order/

Update the order of the voice menu context options rules

URL Parameters

Name

Type

context_id

integer

extension_id

string

option_digits

string

JSON parameters

Name

Type

Mandatory

rules_ids

long

yes

Response fields

Name

Type

rules_ids

long

Expand
titleGET /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/order/

GET /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/order/

Get the order of the voice menu context options rules

URL Parameters

Name

Type

context_id

integer

extension_id

string

option_digits

string

Response fields

Name

Type

rules_ids

long

Expand
titlePUT /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/{rule_id}

PUT /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/{rule_id}

Update a voice menu context rule

URL Parameters

Name

Type

context_id

integer

option_digits

string

rule_id

integer

extension_id

string

JSON parameters

Name

Type

Mandatory

action

string

yes

call_interactive_method

string

none

call_interactive_timeout

long

none

call_interactive_url

string

none

call_status

string

none

caller_id

string

none

caller_id_action

string

none

caller_id_name

string

none

caller_id_number

string

none

context

long

none

context_option

string

none

digits

string

none

final

boolean

none

hangup_cause 

string

none

interval

long

none

match_variable_name

string

none

match_variable_value

string

none

max_rate

long

none

name

string

none

play_digits_method

string

none

play_digits_variable

string

none

record_digits_max

long

none

record_digits_sound

long

none

record_digits_timeout 

long

none

record_digits_variable

string

none

set_variable_name

string

none

set_variable_value

string

none

silence_time

long

none

sound

long

none

sound_type

string

none

transfer_dst

string

none

transfer_timeout 

long

none

transfer_variable

string

none

Response fields

Name

Type

action

string

call_interactive_method

string

call_interactive_timeout

long

call_interactive_url

string

call_status

string

caller_id

string

caller_id_action

string

caller_id_name

string

caller_id_number

string

context

long

context_option

string

digits

string

final

boolean

hangup_cause 

string

id

long

interval

long

match_variable_name

string

match_variable_value

string

max_rate

long

name

string

play_digits_method

string

play_digits_variable

string

record_digits_max

long

record_digits_sound

long

record_digits_timeout 

long

record_digits_variable

string

set_variable_name

string

set_variable_value

string

silence_time

long

sound

long

sound_type

string

transfer_dst

string

transfer_timeout 

long

transfer_variable

string

Expand
titleGET /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/{rule_id}

GET /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/{rule_id}

Get a voice menu context rule

URL Parameters

Name

Type

context_id

integer

option_digits

string

rule_id

integer

extension_id

string

Response fields

Name

Type

action

string

call_interactive_method

string

call_interactive_timeout

long

call_interactive_url

string

call_status

string

caller_id

string

caller_id_action

string

caller_id_name

string

caller_id_number

string

context

long

context_option

string

digits

string

final

boolean

hangup_cause 

string

id

long

interval

long

match_variable_name

string

match_variable_value

string

max_rate

long

name

string

play_digits_method

string

play_digits_variable

string

record_digits_max

long

record_digits_sound

long

record_digits_timeout 

long

record_digits_variable

string

set_variable_name

string

set_variable_value

string

silence_time

long

sound

long

sound_type

string

transfer_dst

string

transfer_timeout 

long

transfer_variable

string

 

Expand
titleDELETE /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/{rule_id}

DELETE /extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/{rule_id}

Delete a voice menu context rule

URL Parameters

Name

Type

context_id

integer

option_digits

string

rule_id

integer

extension_id

string