The recommended way to set up bidirectional email and SMS routing between the MTA and SMSC is a three step process:
Set the SMS Address Prefix– Choose an SMS address prefix. Any prefix may be used, so long as it is ten characters or less.
Set the Gateway Profile– Reserve the prefix for use with the SMS Gateway Server (by setting the gateway profile).
Configure the SMSC– Configure the SMSC to route SMS destination addresses to the SMS Gateway SMPP server that start with the prefix. Mobile originated email will have only the prefix. Replies and notifications will have the prefix followed by exactly ten decimal digits.
The source SMS addresses generated by the MTA SMS channel should be set to match the selected SMS address prefix. Do this by setting the following:
MTA SMS channel options:
USE_HEADER_FROM=0
DEFAULT_SOURCE_ADDRESS=prefix
The first setting causes the channel to not attempt to set the SMS source address from information contained in the email message. The second setting causes the SMS source address to be set (to the selected prefix) when it is not set from any other source.
Recognize the prefix as an SMS destination address to accept and route to email. Do this by specifying the SELECT_RE gateway profile option as follows:
SELECT_RE=prefix
The SMS Gateway Server’s gateway profile should then be set to make all relayed SMS source addresses unique. This is the default setting but may be explicitly set by specifying the gateway profile option MAKE_SOURCE_ADDRESSES_UNIQUE=1. This will result in relayed SMS source addresses of the form:
prefixnnnnnnnnnn
where nnnnnnnnnn will be a unique, ten digit decimal number.
Finally, the SMSC should be configured to route all SMS destination addresses matching the prefix (either just the prefix, or the prefix plus a ten digit number) to the SMS Gateway Server’s SMPP server. The regular expression for such a routing will be similar to:
prefix([0-9]{10,10}){0,1}
where prefix is the value of DEFAULT_SOURCE_ADDRESS, [0-9] specifies the allowed values for the ten digit number, {10, 10} specifies that there will be a minimum of ten digits and a maximum of ten digits, and {0, 1} specifies that there can be zero or one of the 10-digit numbers.