Function resolution rule (featurerule)

Description

Enables or blocks a service function call based on the filter by initiator number and destination number. The rule is applied after routing the call to one of featurecode with types: 'mesh', 'prompt', 'monitor', 'pickup', 'callwaiting', 'barge', 'intercom', 'replace', voicemail', as well as BLF subscriptions and notifications - at the time of the respective transaction.

In the test trace of routing rules, no permit rules are applied and the corresponding results are not displayed.

If, according to the applied call initiator and destination number filters, no rules are found that allow the use of a fichacode, the call is terminated by rejection with code 403. The call is also terminated with a rejection if a rule prohibiting the call is detected according to the priority.

When a domain is created, three rules are automatically created: "default all" - allowing everything to everyone, "default self" - allowing users everything to themselves, "default callmanager" - allowing the user callmanager everything to everyone. The first of these must be turned off when configuring constraints. The second and third must remain in some form for the needs of system calls.

Limitations

  • The collection is not available in the master domain.

Fields

Entity structure
{
  "id": uuid,
  "name": str,
  "types": str,
  "filter_from": str,
  "filter_to": str,
  "enabled": bool,
  "priority": int,
  "opts": {
    "title": str,
    "comment": str,
    "tab": array<obj>
  },
  "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: name
Mode: in
Type: str
Default: required

Rule Name.

Field: enabled
Mode: in
Type: bool
Default: true

Rule switch.

Field: types
Mode: in
Type: array<str>
Default: required

List of subscriber function types (ficacodes) to which the rule applies.
Possible values:

  • * - all kinds of functions.

  • blf - function to subscribe to notifications of status changes.

  • blf_details - function for detailing call information in a BLF notification for the purpose of displaying call originator information.

  • pickup - call intercept function.

  • intercom - intercom function.

  • barge - invasion function.

  • callwaiting - second call function when the number of simultaneous calls is limited.

  • replace - shoulder swap function in the dialog.

  • monitor - function to connect to a conversation in listening mode.

  • prompt - function to connect to a conversation in prompter mode.

  • mesh - function to connect to a conversation in conference mode.

  • voicemail - voice box control function.

Field: filter_from
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: filter_to
Mode: in
Type: str
Default: `"*"`", "Destination number mask-filter.
The result of modification by rules in previous routing steps is checked.
Initially the destination number from the username field of the To SIP request header is checked INVITE.
Filter operation modes.

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

Priority of the rule in the search sequence. The smaller the value, the higher the priority.
Due to the fact that the result of the rule is the single action of allowing the rule to be applied, the priority carries no meaning.

Field: action
Mode: in
Type: str
Default: allow

Rule Action. Possible options:

  • allow - the rule allows the application of the service function;

  • deny - rule prohibits the application of the service function.

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

Filter operation modes

Table 2. 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: filter_from, filter_to.

  • 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.

See also

Logical roles

  • b2b conducts routing and rule enforcement.