Number templates are used to translate the To address from one format to another. You can use a number template if the gateway accepts only specific number formats (e.g. only numbers in international number format) and the source of the messages might generate the numbers in other formats.
Number templates can also be used if you use different gateways to send the messages and if each gateway accepts numbers in a slightly different format. For instance when you use a GSM modem as a primary gateway to send the messages and a Paging Gateway with an e-mail service as a backup gateway. Since the e-mail service only accepts an e-mail address as a valid recipient address you can use a number template to translate the GSM phone number to a valid e-mail address.
Number template format
The number template uses a simple format to check if the number confirms to the template and to translate the number from one format to another.
# |
The hash tag character is used for each number or character that is available in the source address and should be sent to the gateway. |
[...] |
Everything in brackets is not used to check if the number matches the number format but is inserted in the resulting recipient address. |
Other characters |
All other characters are used to check if the number matches the number format but are removed from the resulting recipient address. |
The number template field can contain multiple number templates, each one separated by a semicolon, e.g.:
07[+447]#########;447[+447]#########
If the number does not confirm to the template format it is not translated to a different number format but sent "as is".
Examples
Translate local UK GSM numbers to international format:
07[+447]######### translates "07848000000" to "+447848000000".
Translate UK GSM number to an international format starting with 00:
07[00447]#########;+447[00447]######### translates "07848000000" and "+447848000000" to "00447848000000".
Translate a pager phone number to a 5 digit PIN:
+124812#####;024812##### translates "+12481234567" and "02481234567" to "34567"
Translate a national GSM number to an e-mail address:
0[0]##########[@t-mobile.de] translates "01511111111" to "01511111111@t-mobile.de".