telephony/NumbersDomains

Master domain collection defining bindings of external numbers to cluster domains.

Case: the system is connected to a PSTN provider. One account, one multi-channel connection, a pool of external numbers. The number pool is distributed across cluster child domains. Billing is connected.

Goal 1: when interacting with billing (for calls with a PSTN leg), pass as the client domain the specific working cluster domain to which the corresponding number is allocated. Goal 2: optimize configuration by excluding copying and enumeration of numbers in multiple routing and representation rules in different domains, reducing the number of entities (routing rules and representation rules) to a primitive minimum.

Storage type: category.

Table 1. Class fields
Field Description

id

Identifier

domain

Domain name in the cluster

numbers

List of external numbers allocated from the pool to the specified domain. Each element is either a specific external number or a range (specified as "/dia/<NUMBER>+N", where <NUMBER> is the external number and N is the number of additional numbers in sequence, so +10 defines a range of 11 numbers).

mainNumber

Main number used as the source number in outgoing calls from the domain through the shared connection. If the number is not set, the first number from the 'numbers' property is assigned as the main one.

Used by the representation rule when routing a call from the domain to another domain serving the PSTN connection. To apply it as a call initiator number modifier, the macro "{nd}" must be set.

How it works

The service running within the mware role forms a table by expanding all numbers including ranges. For each number it allows determining the domain, and for each domain — the main number.

  1. When interacting with billing, the system determines the associated working domain by the local number in the PSTN leg and passes exactly it as the client domain in RADIUS. By default, the domain in which the corresponding provider account is configured.

  2. In routing rules of the domain with the provider account, the macro "{nd}" can be specified as a modifier for a rule with action type 'To another domain'. Then, if the destination number received by the rule filter is defined in the NumbersDomains collection, the corresponding domain is substituted. If the number does not match any domain, or the domain is not found, the next rule or refusal applies. This allows reducing configuration without multiplying rules or number tables, and managing with a single primitive rule.

  3. In number mask filters of routing rules in working domains, the prefix macro "/nd/…​" can be used (for example, "/nd/7XXXXXXXXXX") — the system first filters and then checks this number against the domain in the NumbersDomains collection. This helps differentiate directions: accept local external numbers for servicing inside the domain, and route other external numbers to the domain with the PSTN connection. This reduces configuration, eliminating the need to create several rules in each working domain enumerating numbers allocated to the domain, and allows using one primitive rule in each working domain.

  4. In representation rules, the macro "{nd}" can be specified as a source number modifier. Then, on cross-domain calls from working domains to the domain with the PSTN connection, a search is performed in the NumbersDomains collection by the source domain and the corresponding main number (mainNumber) is substituted. This reduces configuration by excluding copying and enumeration of numbers for each domain. One primitive representation rule in the domain with the PSTN connection is sufficient.

In total, it is enough to specify each external number allocated in the pool only once in the NumbersDomains collection bound to some child domain of any level, and not use or copy them anywhere else in routing and representation rules.