Routing vector (route)

Description

A vector for routing phone calls and state subscriptions applied in the first stage of the two-stage routing process.
Vectors are analyzed in a strictly defined order corresponding to priorities.
The vector is analyzed through matching the conditions with the query parameters. In case all conditions are met, a search for routing rules inside the vector takes place - the second step of the routing process.

The configured set of routing vectors and rules can be tested through the diagnostic API.

Limitations

  • The collection is not available in the master domain.

Fields

Entity structure
{
  "id": uuid,
  "vector": str,
  "priority": int,
  "dir": str,
  "fromnumber": str,
  "fromdomain": str,
  "fromextaccount": str,
  "tonumber": str,
  "schedule": str,
  "periods": array<object>,
  "opts": {
    "title": str,
    "comment": str
  },
  "ext": {
    "ct": date,
    "lwt": date
  }
}
Table 1. Fields
Specification Description

Field: id
Mode: inout
Type: uuid
Default: generated

Identifier. Can be specified at creation, otherwise generated by the system.

Field: vector
Mode: in
Type: str
Default: required

Vector code

Field: priority
Mode: in
Type: int
Default: required

Vector priority. When the priorities of multiple vectors match, they are checked and applied in random order. Smaller value means higher priority.

Field: dir
Mode: in
Type: str
Default: "*"

Filter based on call initiator environment

Field: fromnumber
Mode: in
Type: str
Default: "*"

Source number filter mask.
The result of modification by rules in previous routing steps is checked.
Initially the source number from the username field of the Referred-By header, and in its absence from the From header, SIP-request INVITE, or the result of a more complex definition of the initiator subscriber number (e.g. sipuser phonenumber, the result of applying sipuser extension, callerid to esg conversion rules, etc.) is checked.
Filter operation modes.

Field: fromdomain
Mode: in
Type: str
Default: "*"

Source Domain Filter Mask.
Applies when a call directed in the previous step from another domain is processed.
Filter operation modes.

Field: fromextaccount
Mode: in
Type: str
Default: `"*"`", "ISP account code mask-filter in the current domain.
It is used in the first step of routing in case of call processing from the external environment.
Filter operation modes.

Field: tonumber
Mode: in
Type: str
Default: `"*"`", "Destination number mask-filter.
The result of modification by the rules in the previous steps is checked.
Initially, the number from the username field of the To SIP request header will be checked INVITE.
Filter operation modes.

Field: schedule
Mode: in
Type: str
Default: "all"

Specifies the activity schedule of the rule.
Working/non-working hours are defined in the settings of the current domain, or in the parent domains up to the master domain.
Work schedule.

Field: periods
Mode: in
Type: array<object>
Default: empty

Activity interval during the week.
Applies in mode schedule = custom.
Each item in the list covers a specific segment within the week: from time on a particular day of the week to time on another particular day of the week.
Based on the aggregate of these segments, an overall schedule is generated.
Weekly schedule list item.

Field: opts
Mode: in
Type: object
Composite field

Field: opts.title
Mode: in
Type: str
Default: empty

Arbitrary header

Field: opts.comment
Mode: in
Type: str
Default: empty

Arbitrary comment

Field: opts.tab
Mode: in
Type: array<object>
Default: []

Tabular data for using filters (and modifiers) within a single route search session.
Each object in the list contains arbitrary fields that can be used in the mask as a string {tab:some_field}.
For more details see Filter operation modes, item 'Table'.

Field: ext
Mode: inout
Type: object
Compound field

Allows you to extend the compound with arbitrary keys and values

Field: ext.ct
Mode: out
Type: date
Default: generated

Object creation time

Field: ext.lwt
Mode: out
Type: date
Default: generated

Time of last modification of the object

The environment of the call initiator

Table 2. The environment of the call initiator
Value Description

"inner"

The vector can only be applied to calls initiated within the current domain

"outer"

The vector can only be applied to calls that came in from the outside through a provider account in the current domain

"cross"

The vector can only be applied to calls coming from another domain

"*"

No filter is applied, the vector is suitable for all call initiator environments

Filter operation modes

Table 3. Filter operation modes
Mode Description

Posymbolic

The value to be subjected to the conformance check is passed through the filter character by character.
The following special characters and combinations may be used:

  • X – any character;

  • * – all remaining characters;

  • {F} and {f} is the original From username in its entirety;

  • {T} and {t} is the original value of To username in its entirety;

  • {E} and `{e}' is an empty value.

  • ? - any character (if used for filtering by domain names, any character except dot - domain name separator).

  • $ - to filter by domain. Any sequence of characters other than a dot - domain name separator.

If it is necessary to specify one of the service characters as a target character, it should be enclosed in square brackets, e.g. [X].

For example, XXX is any three-character value.

Table

The {tab:…​} substring can be used. It can be used to select a group of characters in the tested value and match them with the table embedded in the rule (opts.tab).
For example, {tab:a} - select a substring and map it to the a field of all objects/rows in the table.
The table serves as a bundle of several filter fields and modifiers. Based on the sequential check of filters, there are fewer rows in the table, taking into account the detected matches.
The first of the remaining rows is used for application in modifiers. If there are no rows left in the table, the rule is rejected.
Capturing characters from the mask-based value being checked can be done automatically, or with strict specification of the substring length:

  • {tab:KEY} - Automatic capture from the value being tested.

  • {tab:KEY:LENGTH} - Capture the specified number of characters from the value being checked.

Field values in the table can be used as field values:

  • constants;

  • regular expressions (to do this, you must specify a value in the format /reg/EXPRESSION, e.g. /reg/^1[1-4]$);

  • mapping with other fields of the table (for this purpose it is necessary to specify the value in /tab/FIELD format, for example /tab/a). The mode is used to bind values of different fields. For example, to allow calls only to your own voice mailbox. The binding order must be strictly observed: if the referenced table field has not been checked yet and has not been filled with the real value of another entity field, the matching will fail. The order of checking entity fields: fromnumber, tonumber, fromdomain, fromextaccount.

  • any value applied without a regular expression (for this purpose /any must be set). The mode is useful only when organizing direct comparisons with values of other fields without additional filters.

The tabular modifier may be used in combination with other character mode control commands.
Multiple specification of fields in one modifier, repetition, specification of non-existent fields are allowed.

For example, {tab:a:3}XXXXX{tab:b} - allows you to highlight the 3-character city code in the number and map it to the a field in the table, and simultaneously highlight the tail starting at the 9th character and map it to the b field in the table.

Regex

The pattern is applied to the original value Pattern.

The structure of a regex pattern value:
/reg/Pattern1.

For example,- significance: "302"
- mask: "/reg/0"
- Result: true.

  • significance: "302"

  • mask: "/reg/^0$"

  • Result: false.

  • significance: "302"

  • mask: "/reg/^302$"

  • Result: true.

  • significance: "302"

  • mask: "/reg/^(301|302|305)$"

  • Result: true.

All standard regular expression rules can be applied when forming Pattern patterns.

Range

The value subject to compliance checking is a numeric integer and is within the specified numeric range.

The structure of the dia-template value:
/dia/FromValue+N - fall under the pattern of N+1 values from FromValue to FromValue+N.

For example,- significance: "302"
- mask: "/dia/300+10"
- Result: true.

Work schedule

Table 4. Work schedule
Value Description

"all"

The vector is available for use at all times

"disabled"

The rule is not available for use ever

"work"

The vector is available for use only during business hours

"non-work"

The vector is only available for use after hours

"custom"

The vector defines the individual availability schedule in the periods field of the vector

Weekly schedule list item

Table 5. Weekly schedule list item
Field Value Description

daystart

17

Day of the week of the start of the segment (1 - Mon, 7 - Sun)

daystop

17

Day of the week of the end of the segment (1 - Mon, 7 - Sun)

timestart

01440

Intraday segment start time in minutes

timestop

01440

Intraday segment end time in minutes

See also

Logical roles

  • b2b does the routing.

  • mdc and sdc searches for vectors and rules.