This module was created to format numbers into a specified format (preferably e.164) for doing ENUM or LCR lookups, based on a set of regular expressions listed in translate.conf.xml. When used as a dialplan module, it can rewrite both the caller id number and destination number of the call before it reaches the XML dialplan, considerably simplifying dialplan and xml_curl configuration which in turn translates the values used in the CDR.
The configuration file allows for a number of profiles, each listing a number of regex rules which are processed in order. It appears that the first match is used. Here is an example configuration for translating numbers in the United Kingdom to E.164 format.
from the cli:
If profile is not specified, it defaults to US
The following will translate the destination number using the US profile defined in the translate.conf.xml
The result is stored in a new channel variable called translated which you can then use to transfer the call back to the dialplan
It can also be used as part of a variable
The following example will translate the destination_number and caller_id_number from a call coming in on a sofia profile before it goes to the XML dialplan
The order the profiles are resolved in is as follows:
- Checks the following channel variables in this order:
- Fall back to US