Assumptions on Behavior
For the sake of this example, let us assume that the following behavior is desired:
Email messages addressed to
sms-id@sms.domain.com
are to be sent to the SMS address
sms-id
and given a unique SMS source address in the range 000nnnnnnnnnn.
Mobile SMS messages addressed to the SMS address 000 are to be sent through the gateway to email with the email address extracted from the start of the SMS message text.
For example, if the SMS message text is:
jdoe@domain.com Interested in a movie?
then the message “Interested in a movie?” is to be sent to jdoe@domain.com.
SMS notifications sent to 000nnnnnnnnnn are to be sent through the gateway to email and directed to the originator of the message being receipted.
In order to bring about this behavior, the following assumptions and assignments are made
Further Assumptions and Assignments
The MTA’s SMS channel uses the domain name sms.domain.com.
The SMS Gateway Server runs on the host gateway.domain.com and uses:
TCP port 503 for its SMPP relay
TCP port 504 for its SMPP server
The remote SMSC’s SMPP server runs on the host smpp.domain.com and listens on TCP port 377.
The remote SMSC’s default character set is UCS2 (aka, UTF-16).
SMS Channel Configuration
To effect the above behavior, the following SMS channel configuration may be used in the imta.cnf file (add these lines to the bottom of the file):
(blank line) sms sms.domain.com
SMS Channel Option File
The channel’s option file, sms_option, would then contain the following settings:
SMPP_SERVER=gateway.domain.com SMPP_PORT=503 USE_HEADER_FROM=0 DEFAULT_SOURCE_ADDRESS=000 GATEWAY_PROFILE=sms1 SMSC_DEFAULT_CHARSET=UCS2
SMS Gateway Server Configuration
Finally, the Gateway Server configuration file, sms_gateway.cnf, should look like the following:
HISTORY_FILE_DIRECTORY=/sms_gateway_cache/ [SMPP_RELAY=relay1] LISTEN_PORT=503SERVER_HOST=smpp.domain.com SERVER_PORT=377 [SMPP_SERVER=server1] LISTEN_PORT=504 [GATEWAY_PROFILE=sms1] SELECT_RE=000([0-9]{10,10}){0,1} SMSC_DEFAULT_CHARSET=UCS2 |
Testing This Configuration
If you do not have an SMSC to test on, you may want to perform some loopback tests. With some additional settings in the sms_option file, some simple loop back tests may be performed for the above configuration.
The additional settings for the sms_option file are:
! So that we don’t add text to the body of the SMS message FROM_FORMAT= SUBJECT_FORMAT= CONTENT_PREFIX=
Without these settings, an email containing:
user@domain.com (Sample subject) Sample text
would get converted into the SMS message:
From:user@domain.com Subject:Sample Subject Msg:Sample text
That, in turn, would not be in the format expected by the mobile-to-email code, which wants to see:
user@domain.com (Sample subject) Sample text
Hence the need (for loopback testing) to specify empty strings for the FROM_FORMAT, SUBJECT_FORMAT, and CONTENT_PREFIX options.
Send test email messages addressed to 000@sms.domain.com, such as:
user@domain.com (Test message) This is a test message which should loop back
The result is that this email message should be routed back to the email recipient user@domain.com.Be sure to have added sms.domain.com to your DNS or host tables for the test.