Test a translation rule
Это содержимое пока не доступно на вашем языке.
applyTranslationRule applies a translation rule to a number and returns the result, without changing anything. Use it to validate a rule before you save it on an object; the panel calls it to check every translation rule field when you save a form. It works for the CLD and CLI translation rules of accounts, account classes, authentication rules of accounts and DIDs, and connections. The rule syntax is explained in number translation.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
rule |
string | yes | The translation rule, for example s/^00/+/ |
number |
string | no | The number to translate. Default: empty string |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK: the rule has a correct syntax |
number |
string | The number after translation |
A rule with a syntax error returns a fault.
Example
Section titled “Example”call("applyTranslationRule", {"rule": "s/^00//;s/^/+/", "number": "00442071234567"}){"result": "OK", "number": "+442071234567"}