M4 Destination Transformation
Tech Prefix rules
Tech Prefix rules are used to translate outgoing number (cut prefix, add prefix). Rules can be set only in Termination Points Tech Prefix input field. There are 3 different Tech Prefix rules:
1. Add prefix
To add something to every number, just enter what to add.
2. Cut prefix
To cut something from number, write - character and then what to cut. For example -00 will cut 00 from the beginning of number (if number starts with 00).
3. Replace prefix
To cut something from number and add something else (replace), write - character followed by what to cut, then + character and what to add. For example -00+8 will cut 00 from beginning of number and add digit 8 in front (00 will be replaced by 8).
Multiple rules
It is possible to define many Tech Prefix rules in one single line. It is done by separating rules with | character:
-A+B|-C+D|-X|Z
Rules are checked in the order they are written and first matching rule will be applied. If one rule is applied, then other rules will be skipped. This means that some rules do no make sense, for example 00|-6+370 rule will always add 00 in front of number and second rule will be skipped.
The number of rules is limited only by the length of input field (255 characters).
Examples
Number | Tech Prefix | Outgoing number | Comment |
86123456789 | 00 | 0086123456789 | simple Tech Prefix just adds 00 in front of number |
003706123456789 | -00 | 3706123456789 | if number starts with digits 00, then cut them |
86123456789 | -8+370 | 3706123456789 | cut number 8 and add 370. If number does not start with 8, then nothing will be added |
03706123456789 | -00+370|-0 | 3706123456789 | Tech Prefix contains multiple rules but first rule is skipped, because number starts with 0 and not 00. Second rule is applied and 0 is cut from number |
3706123456789 | -00+370|-0|+ | +3706123456789 | Tech Prefix contains multiple rules but first and second rules are skipped. Last rule simply adds + to the number |
86123456789 | -8+370|00 | +3706123456789 | Tech Prefix contains multiple rules but first rule is applied and other rules are skipped |
86123456789 | -8+\+370 | +3706123456789 | if number start with digit 8, then cut it and add +370. Note that + is escaped by using \ character |