Component External management via API

Table of Contents

Description

Moves the script during its activity under external control via API (HTTP/WebSocket). +

If the dialog is not yet established (in the `api_start` event, the `state` field has a value other than `dialog`), the control system is required to follow the SIP workflow. That is, the appropriate responses must be sent before the functionality can be utilized. playback, recording, transfers.
The `api_start` event can report the following states: `dialog`, `early`, `ringing`, `incoming`. According to them, and using the transmitted parameters, the external system can determine the current state and select the correct behavior.

Until the 2xx response is sent: a) The transfer (203, refer) should be replaced by sending the 3xx response (202, `answer`). b) Ending the call (201, bye) should be replaced by replying 4x-6xx (202, `answer`). c) Do not use transfer components. d) Do not use media traffic components (playback, recording, etc.), except when the current state of the dialog is when the current state of the dialog is `early', i.e. the last response sent was a reply `183 Session Progress`.

Events of `ivrevents.api_start` and `ivrevents.api_stop` types are generated about the start and end of the component operation. They are sent also by subscription to websocket connections (the `notify` message within the token-api `subscribe`).
Control can only be intercepted by one of the connected systems - the one that first sends the `"ivrapi_accept"` message within its websocket connection (token-api: `ivrapi`).
Further control is performed via websocket token-api `ivrapi`.

Table 1. System Characteristics

Index

224

Short title

api

Types of scenarios

IVR

Starter module

era_sip_ivr_script_component_api

Mode

Asynchronous

Icon

224

Branching pattern

Branching, closing

Properties

Table 2. Properties
Specification Description

Title: The Key
Code: key
Visibility: no
Default: — 

Argument containing the key. It is passed to the external system in the message about the component’s start (ivrevents.api_start event) and component’s termination (event ivrevents.api_stop).
The external system must specify this key next to the IVR Dialog ID in every request sent within the websocket token-api ivrapi in order to externally manage this component.

Title: Parameters
Code: params
Visibility: no
Default: — 

An argument containing additional parameters for the external system.
The specified parameters are passed in the message about the start of component operation (event ivrevents.api_start).

Title: Control takeover acknowledgement timeout, ms
Code: reportTimeoutMs
Visibility: no
Default: 3000

Argument defining the timeout for waiting for confirmation from one of the external systems connected via websocket token api, in milliseconds.

Title: Reason for variable output
Code: varReason
Visibility: no
Default: — 

Variable where the reason for component termination is stored.

Title: Transition
Code: transfer
Visibility: no
Default: — 

The component to which control is transferred after the component is terminated by disabling the external system.

Title: Transition, Time
Code: transferTimeout
Visibility: no
Default: — 

Component to which control is passed on timeout termination.

Title: Transition, Error
Code: transferError
Visibility: no
Default: — 

The component to which control is passed if an error occurs.

See also