/
Voice navigation

Voice navigation

 

Before using the voice navigation rule, the platform administrator must enable the use of the voice_helper rule; otherwise, the rule cannot be created, and if the functionality is disabled, the rule will be ignored in the IVR settings.

The API application permissions must be set to all (also enabled by the platform administrator, described in detail here: Creation and Authorization of Applications).

Voice Navigation - an IVR rule, the action description for voice_helper is available here: speech to text. This rule is set similarly to other IVR rules in the context options.

Below is the description of creating a rule, using examples of requests that can be performed on the interactive explorer page.

Creating a “voice_helper” voice assistant rule:

For example, a call reaches the extension id {extension_id} in the context {context_id}, on the option {option_digits} (usually, start). Also, for the sake of example, let's assume that the context is empty and there are no rules yet.

To add a rule, send the request

POST /api/ver1.0/extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/

with the body:

{ "action": "voice_helper", "voice_helper_classic_term": false, "voice_helper_digits_max": 1, "voice_helper_final_count": 1, "voice_helper_rules": [ { "to_option": 1, "transcription": "машина|техник" }, { "to_option": 2, "transcription": "косметика|косметолог" }, { "to_option": 3, "transcription": "гигиена|продукты" } ], "voice_helper_timeout": 12000 }

The response to the request will contain the id of the created rule, for example, "id": 1.

The to_option options, where calls will land upon saying words from transcription, must be created; they are not automatically created, in this example, they will be created later.

transcription can contain either an exact word or part of a word.

As a result of the above request, a voice navigation rule will be created, which will play a default melody.

If a specific sound greeting is required to inform the caller that a certain word is expected, a sound file needs to be prepared. The Sound Files resource (/sound/) will allow uploading a file and obtaining the file id.

To update any parameter of the rule, use the method

PUT /api/ver1.0/extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/{rule_id}

For example, to specify a current greeting with the required file id ID:

{"sound": __ID__}

Similarly, any parameter of the voice_helper rule can be updated, for example, replacing the voice_helper_rules

PUT /api/ver1.0/extension/{extension_id}/ivr/context/{context_id}/options/{option_digits}/rules/{rule_id}

It is not recommended to have a lot of logic in one voice_helper_rules, ideally no more than 500.

to_option are the context options. Start, invalid, timeout, 1, 2, 3, 4, etc., are the context options. The voice_helper rule is created in start, and voice navigation will be through options 1-10 (or 4-40, for example).

Creating options is performed with the request

POST /api/ver1.0/extension/{extension_id}/ivr/context/{context_id}/options/

 

where string are the context options start, invalid, timeout, 1, 2, 3, 4, etc.

Related content