This article allows to manage the numbering rules for a PBX (OXO Connect, OXO Connect Evolution or OmniPCX Enterprise) associated to a customer company.
The numbering rules apply to outgoing Rainbow communications. They use the regular expression mechanism (also called RegEx) to perform "search and replace" operations on dialed phone numbers. For more details, see: https://en.wikipedia.org/wiki/Regular_expression.
The numbering rules are configured in the telephony settings of the PBX associated to the customer company.
How does it work?
- If no numbering rules are defined, Rainbow default behavior is to automatically analyze a phone number using a built-in phone number library and the country defined in the user profile. For example, if the number is identified as a national phone number, it will add the outbound prefix defined in the PBX configuration.
- If numbering rules are defined, the dialed number is first subjected to these rules, and if it matches a rule, the default behavior (built-in phone number library and country analysis) is ignored and the rule is applied. If no rule matches, the default phone number analysis is applied (see above).
If the dialed phone number matches a rule, do not forget to add the outbound prefix in the Replace with field if the resulting number is a public phone number.
Accessing the numbering rule configuration window
- From the Rainbow application, click on Manage your customers
in the left panel.
- In the MY CUSTOMERS panel, click on Customers companies.
- In the right part of the window, click on the name of the target customer company.
- In the left panel, click on Communication.
- In the right part of the window, click on the Comm. Servers tab.
- Click on the target PBX and select the Telephony tab.
The Phone Numbers Transformation Rules frame is used to configure the PBX numbering rules. - In the Rule 1 field, enter the regular expression that will be used to find a phone number. For details, see: Examples of numbering rule configuration.
Character entry is checked by the system and indicated by an icon on the right part of the window (if ok,
if nok).
As soon as a regular expression is entered, a new rule configuration frame is available (e.g. Rule 2). - In the Replace with field, enter the expression that defines how the phone number is to be formatted.
- If desired, enter a description for the rule.
- Click on Apply to validate.
- In the Test of rules frame, you can check the rules by entering a phone number in the Phone number field.
Examples of numbering rule configuration
Example 1: The numbers with exactly 5 digits are internal numbers
Rule N° = ^(\d{1,5})$
Replace with = $1
e.g. input 54321 => dialed 54321 (outbound prefix is not added)
e.g. input 65432 1 => more than 5 digits, rule does not match:
- A number is a valid number according to the built-in phone number library, then the outbound prefix is added and 0654321 is dialed (which may result in an invalid number)
- The number is not a valid number according to the built-in phone number library, then 654321 is dialed and will result in an invalid number
Example 2: Numbers starting with 258 and having exactly 8 digits are internal numbers
Rule N° = ^((?=(258))[0-9]{8})$
Replace with = $1
e.g. input 25845678 => dialed 25845678
e.g. input 2584567890 => more than 8 digits, rule does not match
e.g. input 25745678 => not starting with 258, rule does not match
Example 3: Change a national number in the same area to a local number (e.g. area code = 321)
Rule N° = ^0321
Replace with = 00
e.g. input 0321456789 = dialed 00456789
Example 4: Forbid special rate numbers starting with 0800
Rule N° = ^0800
Replace with = empty
e.g. input 0800123456 => nothing is dialed
e.g. input 0801654321 => rule does not match, 0801654321 can be recognized by default phone number recognition and 00801654321 is sent to the PBX
Example 5: Add an outbound prefix to special service numbers (e.g. road and traffic status or speaking clock)
Rule N° = ^3699$
Replace with = 03699
or
Rule N° = (^3699$)
Replace with = 0$1
e.g. input 3699 => dialed 03699
Example of configuration with two rules: