Component Operation

:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:

Description

A multifunctional component that provides various utility methods for influencing the system.

Table 1. System characteristics

Index

145

Short name

operation

Script types

svc

Start module

r_script_component_operation_svc

Mode

Asynchronous

Icon

145

Branching type

Branching, closing

Limitations

  • Tokens integration channels (token_local) are issued in clear text only once - in the creation response; re-issuance of a token - only for a user session (not available to the script). Reading (methods “Get” and “Search by key”) returns the token encrypted (ha_v=5;…​, Encryption and keys) or a mask with a fingerprint (*****#<8 hex>); search and filter by token are not supported.

Properties

Table 2. Properties
Specification Description

Name: Operation type

Code: type

Visibility condition: no

Default: CRUD in the domain

Selecting a category of operations.

Possible values:

  • CRUD in domain (crud, 0) – Group of operations on entities of domains (reading, creating, modifying, deleting). The operation is only possible on classes managed by the domain center (roles mdc, sdc). Available in the API through endpoints other than /rest/v1/model/…​

  • Data model in the domain (dms, 8) – A group of operations on entities of the dynamic domain data model (reading, creating, modifying, deleting, clearing, working with attachments). The operation is only possible on classes managed by the data model server (dms role). Available in the API via endpoints /rest/v1/model/…​

  • Registrar (registrar,5) - Data from the registrar.

  • Call binding (bindings, 1) – Putting a label in the context of the specified call. The peculiarity of the tag is that it moves from one call to another when switching (SIP REFER).

  • Call control (callmanager, 3) – A group of operations for logical control of calls and conferences.

  • Sipuser control (sipuser, 6) – Sipuser control operation for setting a huntblock.

  • Download conversation recording (records, 4) - Downloads a conversation recording from the recording storage and places it in the script’s temporary directory, writing a special path to the file into the result variable.

  • Increase Stat Service Counter (statindicator, 9) - Increments the specified stat service counter (product layer) by placing data. Used, for example, to count the number of visits to a script branch.

Name: Domain

Code: crudDestTD

Visibility condition: yes

Default: Scenarios

Select the domain in which the operation is performed. Applies to CRUD operations in a domain.

Possible values:

  • Scenarios (same, 0) – Domain of the current scenario.

  • Other (specified, 1) – Specify the domain.

Name: Domain name Code: crudDomain Visibility condition: yes

Default: — 

An argument containing the name of the domain to perform the operation on entities. Only specifying domains from a child tree is allowed.

Applies to CRUD operations in a domain.

Name: User login

Code: crudUser

Visibility condition: yes Default: — 

Argument containing the user’s login in the domain.

Applies to CRUD operations in a domain.

The user must have suitable access rights (admin or crud* role to access domain center collections) and the 'allow_script_crud' option set.

Default user system is created in the domain with allowed access. If it is necessary to tighten policies, the rights of this user should be revoked.

To access a domain other than the script domain, the specified user account must be created in the script domain and in the target domain, and they have the same password. Rights may vary. This ensures that agreements between domains are synchronized.

Name: Entity type

Code: crudObject

Visibility condition: yes

Default: — 

An argument containing the name of the entity class.

Applies to CRUD operations in a domain.

Name: Method Code: crudOperation Visibility condition: yes

Default: Create

Select operation.

Possible values:

  • Create (create, 0) – Create an entity.

  • Get (read, 1) – Receive a set of entities.

  • Update (update, 2) – Change the entity.

  • Delete (delete, 3) – Delete an entity.

  • Search by key (lookup, 4) – Retrieving an entity by the value of the key field (identifier, code, etc.; argument crudKey). The entity is issued in the same way as when reading through the API: without service and hidden fields (t, checksum, hashes); fields that are masked by reading are the same (user password is *****, integration channel token is encrypted or a mask with a fingerprint); fields accessible only to administrators (user password) are issued only if the script user (caller) is an administrator or has the crud role; the rest of the fields are the same as when reading. Field mask - Fields, field names - as in the API.

Applies to CRUD operations in a domain.

Name: Data Code: crudData Visibility condition: yes

Default: — 

An argument containing either a json object with field values when creating or updating, or with an identifier when deleting.

Applies to CRUD operations in a domain.

For rules on forming expressions for JSON values, see JSON escaping and Templates.

Name: Filter Code: crudFilter Visibility condition: yes

Default: — 

Search filter for the operation of obtaining entities of the CRUD category in the domain.

Specified as a JSON structure containing an object. Order of indication and application (filter parameter).

Example 1 (general REST format)
["&&",["like",["property","phonenumber"],"1*"], ["like",["property","login"],"sip*"]]
Example 2 (domain center format)
{"phonenumber": "1%", "login": "sip%"}

Name: Sort

Code: crudSort

Visibility condition: yes

Default: — 

Sorting mode for the operation of obtaining entities of the CRUD category in the domain.

Specified as a JSON structure containing an array. Order of indication and application (order parameter).

Example 1
"phonenumber"
Example 2
["phonenumber", "login"]
Example 3
[{"phonenumber": "asc"}, {"login":"desc"}]

Name: Additional parameters

Code: crudParam

Visibility condition: yes

Default: — 

Additional parameters to the request to the domain center in JSON format to obtain entities of the CRUD category in the domain.

Example 1
{"offset": 3}
Example 2
[{"offset": 3}, {"limit": 2}, {"flat": true}]

Name: Fields

Code: crudFields

Visibility condition: yes

Default: — 

Mask for issuing objects (fields) for the operation of obtaining entities of the CRUD category in the domain. Indicated as a string listing the field names separated by commas. Order of indication and application (mask parameter).

Example
id, login, phonenumber, opts

Name: Domain

Code: dmsDestTD

Visibility condition: yes

Default: Scenarios

Select the domain in which the operation is performed. Applies to operations in the Data Model category in a domain.

Possible values:

  • Scenarios (same, 0) – Domain of the current scenario.

  • Other (specified, 1) – Specify the domain.

Name: Domain name Code: dmsDomain Visibility condition: yes

Default: — 

An argument containing the name of the domain to perform the operation on entities. Only specifying domains from a child tree is allowed.

Applies to operations in the Data Model category in a domain.

Name: User login

Code: dmsUser

Visibility condition: yes Default: — 

Argument containing the user’s login in the domain.

Applies to operations in the Data Model category in a domain.

The user must have suitable access rights (a role corresponding to the routes to the collection endpoints) and the 'allow_script_crud' option set.

Default user system is created in the domain with allowed access. If it is necessary to tighten policies, the rights of this user should be revoked.

To access a domain other than the script domain, the specified user account must be created in the script domain and in the target domain, and they have the same password. Rights may vary. This ensures that agreements between domains are synchronized.

Name: Class name

Code: dmsCN

Visibility condition: yes

Default: — 

An argument containing the name of the dynamic data model class (the classname field in instances of the classes collection).

Applies to operations in the Data Model category in a domain.

Examples
email/Accounts

rest/v1/model/email/Accounts

Name: Method

Code: dmsOperation

Visibility condition: yes

Default: Create

Select operation.

Possible values:

  • Read Collection (read_collection, 0) – Returns arbitrary elements using filter, sort, mask, limit and shift.

  • Aggregation (read_aggr, 1) – Returns aggregated data for a collection. Allows you to select arbitrary (including complex, with superposition) bases and aggregation functions. Returns a set consisting only of the specified fields.

  • Search by key (lookup, 2) – Obtaining a set of entities. Allows you to detect entity identifiers by the values ​​of their lookup fields.

  • Read Entity (read_entity, 3) – Returns the specified entity. Allows you to apply disguise.

  • Create Entity (create, 4) – Creates an entity in the collection.

  • Replace entity (replace, 5) – Replaces an entity in the collection with a new one. Unmentioned fields are cleared.

  • Change Entity (update, 6) – Changes the entity in the collection. Fields not mentioned remain untouched.

  • Delete Entity (delete, 7) – Removes an entity from the collection.

  • Collection Clear (clear, 8) – Clears the entire collection.

  • Download attachment (get_attach, 9) – Downloads the attachment to a temporary file and saves its path to the result. Requires specifying the name of a property with type attachment. If the field is a list field, it also requires specifying the file name.

  • Place attachment (put_attach, 10) – Places an attachment from the specified file into the storage linked to an entity. Requires specifying the name of a property with type attachment.

  • Delete attachment (delete_attach, 11) – Removes an attachment from storage and unlinks it from the entity. Requires specifying the name of a property with type attachment. If the field is a list field, it also requires specifying the file name.

  • Listing of attachments (list_attaches, 12) – Returns a list of attachments within a specific property of a particular entity - objects indicating the name, size, modification time, hash. Requires specifying the name of a property with type attachment, which must be a list property.

  • Clear Attachments (clear_attaches, 13) – Clears the list of attachments within a specific property of a specific entity. Requires specifying the name of a property with type attachment, which must be a list property.

Applies to operations in the Data Model category in a domain.

Name: Path (date/datetime) Code: dmsPrepath Visibility condition: yes

Default: — 

An argument containing the path to the entity (for history and transactionlog type collections. Date or date/time corresponding to the value from the field specified in class.opts.partition_property).

Applies to operations of the Data Model category in the domain in relation to collections of the history and transactionlog types.

Name: Entity ID

Code: dmsId

Visibility condition: yes Default: — 

Argument containing the entity identifier.

Applies to operations in the Data Model category in a domain.

Name: Property name

Code: dmsProperty

Visibility condition: yes

Default: — 

An argument containing the name of the property containing the target attachment. Applies to operations in the Data Model category in a domain.

Name: File name (multi)

Code: dmsSubId

Visibility condition: yes

Default: — 

An argument containing the account name of a specific attachment file if the property is a list type.

Applies to operations in the Data Model category in a domain.

Name: Start of interval (date/datetime)

Code: dmsIntervalFrom

Visibility condition: yes

Default: — 

An argument containing the date/time of the start of the interval for sampling objects from collections of type history and transactionlog.

Applies to operations in the Data Model category in a domain.

Name: End of interval (date/datetime) Code: dmsIntervalTo Visibility condition: yes

Default: — 

An argument containing the date/time of the end of the interval for sampling objects from collections of type history and transactionlog.

Applies to operations in the Data Model category in a domain.

Name: Filter (json)

Code: dmsFilter

Visibility condition: yes Default: — 

Argument containing a json list with a description of the filter for selecting collection elements.

Applies to operations in the Data Model category in a domain.

Example
["&&",["like",["property","phonenumber"],"1*"], ["like",["property","login"],"sip*"]]

Name: Sort (json) Code: dmsOrder Visibility condition: yes

Default: — 

An argument containing a json list describing the sorting sequence of the collection elements.

Applies to operations in the Data Model category in a domain.

Specified as a JSON value - field, list of fields, list of objects indicating the sorting direction. Order of indication and application (order parameter).

Example 1
"phonenumber"
Example 2
["phonenumber", "login"]
Example 3
[{"phonenumber": "asc"}, {"login":"desc"}]

Name: Mask (json)

Code: dmsMask

Visibility condition: yes

Default: — 

Argument containing a json list of fields to be selected. Applies to operations in the Data Model category in a domain.

Specified as a JSON list of strings - field names. Order of indication and application (mask parameter).

Example
["id", "name", "description"]

Name: Shift

Code: dmsOffset

Visibility condition: yes Default: — 

Argument containing a numeric indicator of the shift in the sample.

Applies to operations in the Data Model category in a domain.

Name: Quantity

Code: dmsLimit

Visibility condition: yes

Default: — 

Argument containing a numeric indicator of the number of elements in the selection. Any collection is forcibly limited from above to a finite value. Applies to operations in the Data Model category in a domain.

Name: Grouping fields (json)

Code: dmsGroupBy

Visibility condition: yes

Default: — 

Argument containing a json object from the grouping fields. Element values are lists representing a function for calculating the aggregation base.

Applies to operations in the Data Model category in a domain.

Name: Aggregation fields (json)

Code: dmsAggr

Visibility condition: yes

Default: — 

Argument containing a json object from the aggregation fields. Element values are lists representing an aggregation function. Superposition can be applied to calculate complex aggregation metrics.

Applies to operations in the Data Model category in a domain.

Name: Content (json) Code: dmsContent Visibility condition: yes

Default: — 

An argument containing a json object with field values when saving the entity.

Applies to operations in the Data Model category in a domain.

For rules on forming expressions for JSON values, see JSON escaping and Templates.

Name: Path to file (string) Code: `dmsFromPath Visibility condition: yes

Default: — 

An argument containing the categorized path to the file to be downloaded as an attachment.

Applies to operations in the Data Model category in a domain.

Name: Entity type

Code: regType

Visibility condition: yes Default: — 

Select from a list of types of registered entities.

Possible values:

  • Users (user

1) – User registrations and connections.

  • SIP users (sipuser

2) – Registration of SIP devices.

Applicable for operations in the Registrar category.

"Name: Method

Code: regOperationU

Visibility condition: yes

Default: Get websocket connection

Select operation.

Possible values:

  • Get websocket connections (read_user_websock_connections, 1) – Receiving an array of data about websocket connections in the form of JSON.

  • Get registrations (read_user_registrations, 2) – Receiving an array of registration data via HTTP in the form of JSON.

Applies to operations in the Registrar category for the selected entity type Users.

Name: Method

Code: regOperationSU

Visibility condition: yes

Default: Get registration

Select operation. Possible values:

  • Get registrations (read_user_registrations, 1) – Receiving an array of data about device registrations.

Applies to operations in the Registrar category for the selected entity type SIP users.

Name: Account

Code: regAccU

Visibility condition: yes Default: — 

Argument containing the login or entity identifier. If the value is empty, then all records will be returned.

Applies to operations in the Registrar category for the selected entity type Users.

Name: Account

Code: regAccSU

Visibility condition: yes

Default: — 

Argument containing the login or entity identifier. If the value is empty, then all records will be returned. Applies to operations in the Registrar category for the selected entity type SIP users.

Name: Filter

Code: regFilter

Visibility condition: yes

Default: — 

Search filter for the operation of obtaining entities of the Registrar category.

Specified as a JSON structure containing an object. Order of indication and application (filter parameter).

Name: Sort

Code: regSort

Visibility condition: yes

Default: — 

Sorting mode for the operation of obtaining entities of the Registrar category.

Specified as a JSON structure containing an array. Order of indication and application (order parameter).

Name: Fields Code: regFields Visibility condition: yes

Default: — 

Mask for issuing objects (fields) for the operation of obtaining entities of the Registrar category.

Specified as a JSON structure containing an object. Order of indication and application (mask parameter).

Name: Additional parameters

Code: regParam

Visibility condition: yes Default: — 

Additional parameters for the selection operation of the Registrar category.

Additional fields: offset, limit, etc. Order of indication and application.

Name: Method

Code: bindingOperation

Visibility condition: yes

Default: Add

Select an operation with call context labels. Applies to operations in the Call binding category.

Possible values:

  • Add (add, 0) – Adds a label.

  • Delete (remove, 1) – Deletes a mark.

  • Change (setx, 2) – Replaces the label with a new one.

  • Clear (cleanup, 3) – Clears the label.

  • Check (contains, 4) – Checks for the presence of the specified label and returns 1 or 0.

  • Get(get, 5) – Returns the label.

Name: Call ID

Code: bindingCallOrDlgId

Visibility condition: yes Default: — 

Argument containing the call identifier: CallId or DialogId.

Applies to operations in the Call binding category.

Name: Label

Code: bindingLabel

Visibility condition: yes

Default: — 

An argument containing the text content of the label. Applies to operations in the Call binding category.

Name: Method

Code: callmanagerOperation

Visibility condition: yes

Default: Outgoing call

Select an operation to control the call.

Applicable for operations in the Call Control category. Possible options:

  • Call search (lookupcall, 9) – Returns the call identifier (DialogId) by one of the key values: DialogId, InviteId, CallId of one of the arms, URI of one of the arms in the <sip:Username@Domain> format, etc.

  • Conference search (lookupconf, 10) – Returns the conference identifier (ConfId) by one of the key values: ConfId, room number, conference URI.

  • List of calls (listcalls, 11) – Returns a list of calls in the domain.

  • List of conferences (listconfs, 12) – Returns a list of conferences (ConfId) identifiers in the domain.

  • Call Information (getcall, 13) – Returns information about the call.

  • Conference Info (getconf, 14) – Returns conference information.

  • Outgoing call (invite, 0) – Initiates a new call from one subscriber to another. It is performed by the IVR service, which first calls one subscriber and then switches him to another using a SIP REFER request. The initial (intercom) call to the initiating subscriber’s device from the IVR is marked with the Ghost=invite attribute.

  • Outgoing call from IVR (invitebyivr, 18) – Initiates a new call and connects it to the specified IVR script. Completed immediately by the IVR service. The subscriber can be specified either through a number or through an account. A call from IVR is marked with Ghost=invitebyivr.

  • Call End (bye, 1) – Ends the specified call or set of calls at the specified URI.

  • Notification (notify, 17) - Sends a NOTIFY request to the device with the event type specified in the event parameter (For example, a BroadSoft extension for device management). The callid parameter indicates the arm behind which a specific device is located. The command is executed only if, in accordance with RFC3265, the device has reported support for the specified event type (extension). Optional parameters: body and contenttype.

  • Stop waiting melody (stop_hold_melody, 20) - Stops the current waiting melody on hold, or, depending on the parameter, turns off the waiting melody for the specified dialogue in the next or all future holds.

  • Setting the standby melody (setup_hold_melody, 21) - Sets a custom melody on hold for the current session (key allowed by the domain settings.melody_on_hold).

  • DTMF generation (send_dtmf, 22) - Generates the specified DTMF signal.

  • Playback (setup_player, 23) - Controls the player: starts or stops playing a sound file.

  • Transfer to number (refer, 2) – Transfers the subscriber of the specified call to the specified number. Performed by the IVR service, which replaces the shoulder (SIP request INVITE+Replaces) and sends a SIP request REFER. A terminating call from IVR is marked with Ghost=refer.

  • Transfer to IVR (refertoivr, 19) – Transfers the subscriber of the specified call to the specified IVR script. This is done immediately by the IVR service, which replaces the leverage (SIP request INVITE+Replaces). A terminating call from IVR is marked with Ghost=refertoivr.

  • Connection (referreplaces, 3) – Connects subscribers of two different calls, rejecting the remaining ones. It is performed by the IVR service, which replaces the shoulder (SIP request INVITE+Replaces), after which it transfers to another subscriber using the SIP request REFER+Replaces. A terminating call from IVR is marked with Ghost=referreplaces.

  • Transfer to conference (referconf, 8) – Switches one of the subscribers of the specified call to the specified conference. If the second subscriber has the conference on hold, then all he has to do is press HOLD. A terminating call from IVR is marked with Ghost=refer.

  • Conversion to conference (switchconf, 4) – Transfers both call subscribers to a common conference. Performed by IVR services, each of which replaces a separate arm using the INVITE+Replaces SIP request, and then transfers to the conference room number using the REFER SIP request. Cutting calls from IVR are marked with Ghost=switchconf.

  • Stop conference (stopconf, 5) – Ends the specified conference with automatic disconnection of all participants.

  • List of participants (getparticipants, 15) – Returns a list of conference participants.

  • Participant Information (getparticipant, 16) – Returns information about the conference participant.

  • Participant Join (attachparticipant, 6) – Makes an outgoing call from the specified conference to the specified number.

  • Excluding a participant (detachparticipant, 7) – Removes a participant from the conference.

Name: Parameters (JSON)

Code: callmanagerParams

Visibility condition: yes

Default: — 

Parameters for the call control operation.

The value for each method is a JSON structure in the form of an object with content corresponding to the calls and conferences management APIs.

Applicable for operations in the Call Control category.

Name: Method

Code: sipuserOperation

Visibility condition: yes

Default: Install huntblock

Select method.

Possible values:

  • Installing huntblock (huntblock, 0) – Installing huntblock.

Applicable for operations in the sipuser Management category.

Name: Login or Id

Code: sipuserLoginOrId

Visibility condition: yes

Default: — 

An argument containing the login or id of the sipuser entity in the domain.

Applicable for operations in the sipuser Management category.

Name: Timeout type

Code: sipuserHBStrat

Visibility condition: yes

Default: Replace

Select timeout type.

Possible values:

  • Replace (single_newexpire, 1) – Replacing a single state with another one of the same type with setting a new auto-deletion timer.

  • Maximum (single_maxexpire, 2) – Replacing a single state with another identical one with setting the auto-deletion timer for a time equal to max (remainder, new time).

Applicable for operations in the sipuser Management category.

Name: Timeout, sec.

Code: sipuserTTLSec

Visibility condition: yes

Default: — 

The blocking time of the specified sipuser for huntq queues in seconds.

Applicable for operations in the sipuser Management category.

Name: Comment

Code: sipuserComment

Visibility condition: yes

Default: — 

Comment for blocking the specified sipuser for huntq queues.

Applies to operations in the sipuser Management category.

Name: Storage ID

Code: recStorageId

Visibility condition: yes

Default: — 

Argument containing the storage identifier/code.

Applies to operations in the Download conversation recording category.

Name: Path to storage entry Code: recPath Visibility condition: yes

Default: — 

Argument containing the path to the recording file in the repository.

Applies to operations in the Download conversation recording category.

Name: Domain name

Code: extauthDomain

Visibility condition: yes Default: — 

An argument containing the domain name for the operation. You can specify any domain existing in the system.

Used for operations in the External Authentication category using the Password Check and Session Creation methods.

Name: Login or Id

Code: extauthLoginOrId

Visibility condition: yes

Default: — 

An argument containing the login or user ID (field value login or id) of the user entity in the domain. Used for operations in the External Authentication category using the Password Check and Session Creation methods.

Name: Password

Code: extauthPwd

Visibility condition: yes

Default: — 

An argument containing the password (field value pwd) of the user entity in the domain.

Used for operations in the External Authentication category of the Password Verification method.

Name: wsban data key

Code: extauthWsbanKey

Visibility condition: yes

Default: — 

Argument containing the data key to add the failed attempt to wsban.

To resist brute force authentication data, you need to use it when generating the key for wsban.

Using a key allows you to avoid blocking incorrectly implemented clients that, despite a negative response to the authentication attempt, continue to send the same data over and over again. For example, Creating Session uses {Domain,Login,Pwd} as the key.

The resulting key value is hashed and is not stored explicitly. If you do not pass any field to the key, it will be subject to brute force, because without taking it into account, only one record will be created (if all other fields match), which in itself will not cause blocking.

Used for operations in the External Authentication category using the Create Session and Add to wsban methods.

Name: Indicator code

Code: ssIndicatorCode

Visibility condition: yes Default: — 

String argument containing the code of the stat service indicator.

Applies to operations in the Increase stat service counter category.

Name: Filter name

Code: ssiFilterName

Visibility condition: yes

Default: empty

Optional string argument containing the name of the filter for the stat service indicator. Applies to operations in the Increase stat service counter category.

Name: Filter value

Code: ssiFilterValue

Visibility condition: yes

Default: empty

Optional argument containing the string filter value for the stat service indicator.

Applies to operations in the Increase stat service counter category.

Name: Argument

Code: ssiArgument

Visibility condition: yes

Default: empty

Optional argument containing the string value of the argument for the operation to increase the stat service counter.

Applies to operations in the Increase stat service counter category.

Name: Meaning Code: ssiValue Visibility condition: yes

Default: 1

Argument containing a numeric value for the operation of increasing the stat service counter.

Applies to operations in the Increase stat service counter category.

Name: Result into variable

Code: resultVariable

Visibility condition: no Default: — 

Variable for storing the result of the operation.

Name: Transition

Code: transfer

Visibility condition: no

Default: — 

The component to which control is transferred upon successful completion of the operation.

Name: Transition, time Code: transferTimeout Visibility condition: no

Default: — 

The component to which control is transferred after the timeout for waiting for the result of the operation.

Name: Transition, error

Code: transferError

Visibility condition: no

Default: — 

Component to which control is transferred in case of an error.

See also