The api_start event can report the following states: dialog, early, ringing, incoming. In accordance with them, as well as using \
With the passed parameters, the external system can determine the current state and select the correct behavior.
Control can only be intercepted by one of the connected systems - the one that first sends the message "ivrapi_accept" within its websocket connection (token-api: ivrapi). +\
Further management is carried out via websocket token-api ivrapi.
Component External control via API
:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:
Description
Transfers the script during its activity under external control via API (HTTP/WebSocket). +\
If the dialog has not yet been established (in the `api_start` event, the `state` field has a value different from `dialog`), then from the control the system requires compliance with SIP workflow. That is, it is necessary to send appropriate responses before using the functionality reproduction, recording, translation. +\
Before sending the response 2xx you should: a) Translation (203, refer) be replaced by sending the response 3xx (202, `answer`). b) Ending the conversation (201, bye) should be replaced by sending a response 4xx-6xx (202, `answer`). c) Do not use translation components. d) Do not use components for working with media traffic (playback, recording, etc.), except in the case of when the current state of the conversation is `early`, that is, the last response sent was `183 Session Progress`.
Events of types `ivrevents.api_start` and `ivrevents.api_stop` are generated about the start and completion of the component’s operation. They are also sent via subscription to websocket connections (message `notify` within the token-api `subscribe`). +\
Index |
|
Short name |
|
Script types |
|
Start module |
|
Mode |
Asynchronous |
Icon |
|
Branching type |
Branching, closing |
Properties
| Specification | Description |
|---|---|
Name: Key Code: Visibility condition: no Default: — |
Argument containing the key. It is transmitted to the external system in a message about the start of the component operation (event The external system must indicate this key next to the IVR dialogue identifier in each request sent within the websocket token-api |
Name: Parameters
Code: Default: — |
An argument containing additional parameters for the external system. The specified parameters are transmitted in the message about the start of the component operation (event |
Name: Control take confirmation timeout, ms Code: Visibility condition: no Default: 3000 |
Argument defining the timeout for waiting for confirmation from one of the external systems connected via websocket token api, in milliseconds. |
Name: Reason for exit to variable Code: Visibility condition: no Default: — |
Variable where the reason for the component’s shutdown is entered. |
Name: Transition
Code: Default: — |
The component to which control is transferred after the component is terminated by shutting down the external system. |
Name: Transition, time Code: Visibility condition: no Default: — |
The component to which control is transferred upon completion due to a timeout. |
Name: Transition, error Code: Visibility condition: no Default: — |
Component to which control is transferred in case of an error. |