Notification Component

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

Description

Sends a message to the specified recipient. This may include placing a message in the script engine log file.

For a system user, a notification is a websocket message from the server over an existing websocket connection. In particular, the Script Editor web application displays notifications in the form of pop-up messages, which is convenient to use when debugging a script while writing. A comma-separated list of users can be specified as recipients: their logins, identifiers, logins of associated SIP user accounts or their numbers. :description2: Notification can send SIP NOTIFY requests to SIP user devices with a message placed in the request body according to the SIP protocol.

Table 1. System characteristics

Index

111

Short name

notify

Script types

All

Start module

r_script_component_notify

Mode

Asynchronous

Icon

111

Branching type

Branching, closing

Properties

Table 2. Properties
Specification Description

Name: Mode

Code: mode

Visibility condition: no

Default: Log log

Possible options:

  • Notification (scriptnotify, 0) – Sends a message of type script_notify to the websocket connection of the specified user. For the event to pass successfully, capability scriptnotify must be enabled in the connection. The Script Editor web application handles these messages. Any other application can also implement subscription and processing of notifications from scripts.

  • Log log (log, 2) – The message is entered into the log log of the scripting machine with reference to the current script and handler.

  • sip message (sip, 3) – The message is sent to the user’s SIP device in the form of a SIP request.

Name: Text

Code: text

Visibility condition: yes

Default: — 

Message text for Notification and Log modes.

Name: User

Code: user

Visibility condition: yes

Default: — 

An argument specifying a user or a list of users, separated by commas.

Login, ID, login or number of the linked SIP account.

For Notification mode.

Name: Save

Code: postToDms

Visibility condition: yes

Default: no

Toggle the mode of saving notifications in the data model.

When enabled, the notification will be available in the Account application and in the '/rest/v1/model/platform/notifications/Notifications' collection.

Requires a product layer installed on the domain. For Notification mode.

Name: Display type

Code: type

Visibility condition: yes

Default: Auto

Display method in the user interface. Generates an additional option in a websocket message.

Possible options:

  • Auto (auto, 0) – The notification method is at the discretion of the application.

  • WebKit (webkit, 1) – Notification using WebKit.

  • HTML (html, 3) – Notification using HTML tools.

For Notification mode.

Name: Notification type Code: notifyType Visibility condition: yes

Default: Info

Notification formatting.

Possible options:

  • Info (info, 0) – Notification method is at the discretion of the application.

  • Success (success, 1) – Notification using WebKit.

  • Warning (warning, 2) – Notification using HTML tools.

  • Error (error, 3) – Notification using HTML tools.

For Notification mode

Name: Background color

Code: color

Visibility condition: yes Default: — 

Custom background color as a number corresponding to the RGB 24bit representation.

For Notification mode.

Name: Text color

Code: textColor

Visibility condition: yes

Default: — 

Custom text color as a number corresponding to the RGB 24bit representation. For Notification mode.

Name: Group

Code: group

Visibility condition: yes

Default: — 

Message group code for automatic hiding when duplicated.

The app that displays the notification should automatically hide the on-screen message when a new message arrives with the same group code. For Notification mode.

Name: Auto-hide, with

Code: autoHide

Visibility condition: yes

Default: — 

The interval after which the notification should disappear from the screen if the user has not performed any action on it.

For Notification mode.

Name: Duplicate to log

Code: writeLog

Visibility condition: yes

Default: No

Switch on additional logging of messages to the script processor log.

For Notification mode.

Name: Message Code: sipMsg Visibility condition: yes

Default: NOTIFY

Method of the SIP request sent.

Possible options:

  • NOTIFY (notify, 0)

  • INFO (info, 1)

  • MESSAGE (message, 2)

For Notification mode.

Name: User Code: sipUser Visibility condition: yes

Default: — 

Destination in the format tel:username or username, where the login and SIP user account number can be substituted as username.

For SIP Message mode.

Name: Additional headers

Code: sipHeaders

Visibility condition: yes Default: ``

Additional headers inserted into the SIP request. The argument contains a multi-line value, the format of each line is HeaderName: HeaderValue.

For SIP Message mode.

Name: From Code: sipFrom

Visibility condition: yes

Default: — 

The value to be inserted into the sent SIP request for the From header.

For SIP Message mode.

Name: Event Code: sipEvent Visibility condition: yes

Default: — 

Value for the Event header inserted into the sent SIP request NOTIFY.

For SIP Message mode.

Name: Content-Type Code: sipContentType

Visibility condition: yes

Default: — 

The value to be inserted into the sent SIP request for the Content-Type header. For SIP Message mode.

Name: Content Code: sipContent

Visibility condition: yes

Default: — 

Message text inserted into the body of the sent SIP request.

For SIP Message mode.

Name: Wait for confirmation Code: sipReport Visibility condition: yes

Default: No

Switch for waiting for a SIP response to a sent SIP request.

For SIP Message mode.

Name: Report to variable

Code: sipReportMsg

Visibility condition: yes Default: — 

Variable for storing the body of the SIP response to the sent SIP request.

For SIP Message mode.

Name: Time, s

Code: sipTimeoutSec

Visibility condition: yes

Default: 37

Timeout for waiting for a response to a sent SIP request, in seconds. For SIP Message mode.

Name: Transition, time

Code: transferTimeout

Visibility condition: yes

Default: — 

The component to which control is transferred if, in standby mode, a response to the sent SIP request is not received at the specified time.

For SIP Message mode.

Name: Cause of error in variable

Code: errMsg

Visibility condition: yes

Default: — 

Variable for storing the error code.

Name: Transition

Code: transfer

Visibility condition: no Default: — 

Component to which control is transferred.

Name: Transition, error

Code: transferError

Visibility condition: yes

Default: — 

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

See also