Skip to content

Numbers translations

Yeti has flexible configuration of numbers modifications - it allows to change source and destination numbers on different call processing stages:

  1. Before routing, immediately after call authorization at Customers Auth
  2. Before routing, during Numberlist processing.
  3. After routing in Dialpeer
  4. After routing at termination Gateway

In most cases numbers translations implemented using POSIX Regular Expressions. This section describes general principles and examples of using POSIX Regular Expressions in Yeti.

Yeti uses logic similar to PostgreSQL REGEXP_REPLACE(phonenumber, rewrite_rule, rewrite_result) function with following arguments:

phonenumber
It is a phone number (source or destination) that replacement should be taken place.
rewrite_rule
It is a POSIX regular expression for matching sub-strings that should be replaced.
rewrite_result
It is a string that to replace the sub-strings which match the rewrite_rule.

The REGEXP_REPLACE() function returns a new phonenumber with the elements, which match a regular expression pattern, replaced by a new sub-string.

Examples

Some examples of number rewrite configuration are provided below:

ActionOriginal Numberrewrite_rulerewrite_resultRewrite result
Add prefix 07335255^(.*)$0\107335255
Add prefix 0662296132^(.*)$066\10662296132
Add prefix 380487050460^(.*)$38048\1380487050460
Remove prefix 999#999#380487050460^999#(.*)$\1380487050460
Add suffix 12345380487050460^(.*)$\11234538048705046012345
Replace prefix 123# with 321#123#380487050460^123#(.*)$321#\1321#380487050460