Sun Java System Messaging Server 6.3 Administration Guide

C.2.3 The SMS Message Submission Process

Once an email message has been converted to one or more SMS messages, with possibly different sets for each recipient, the SMS messages are then submitted to the destination SMSC. The submissions are effected using SMPP V3.4 over TCP/IP. The hostname (SMPP_SERVER) of the SMPP server is taken to be the official host name associated with the SMS channel; the TCP port (SMPP_PORT) to use is specified with the port channel keyword.

When there are messages to process, the channel is started. The channel binds to the SMPP server as a transmitter, presenting the credentials specified with the ESME_ channel options described in C.3.3.4 SMPP Options. Table C–2 lists the fields set in a BIND_TRANSMITTER PDU (Protocol Data Unit), and gives their values:

Table C–2 Fields in Generated in a BIND_TRANSMITTER PDU

Field  

Value  

system_id

ESME_SYSTEM_ID channel option; default value is an empty string

password

ESME_PASSWORD channel option; default value is an empty string

system_type

ESME_SYSTEM_TYPE channel option; default value is an empty string

interface_version

0x34 indicating SMPP V3.4 

addr_ton

ESME_ADDRESS_TON; default value is 0x00 indicating an unknown TON

addr_npi

ESME_ADDRESS_NPI; default value is 0x00 indicating an unknown NPI

addr_range

ESME_IP_ADDRESS channel option; default value is an empty string

Note that the channel is multithreaded. Depending on how much mail there is to send, the channel may have multiple dequeue thread running. (There can even be multiple channel processes running.) Each thread does a BIND_TRANSMITTER and then on that TCP/IP connection, sends all of the SMS messages it has to send, and then sends an UNBIND, and then closes the connection. No attempt is made to hold a connection open for a period of idle time for potential reuse. If the remote SMPP server sends back a throttle error, then an UNBIND is issued, the TCP/IP connection is closed, and a new connection and BIND established. It behaves similarly if the remote SMPP server sends an UNBIND before it is finished sending its SMS messages.

The SMS messages are then submitted using SMPP SUBMIT_SM PDUs. If a permanent error is returned (for example, ESME_RINVDSTADR), then the email message is returned as undeliverable. If a temporary error is returned, then the email message is re-enqueued for a later delivery attempt. To clarify, a permanent error is one for which the condition is likely to exist indefinitely and for which repeated delivery attempts will have no positive effect, such as invalid SMS destination addresses. Whereas, a temporary error is one for which the condition is likely to not exist in the near future, such as a server down or server congested condition.

If the USE_HEADER_FROM option has the value 1, then the source address for the submitted SMS message is set. The value used is derived from the originating email message and is chosen to be the most likely (email) address to which any replies should be directed. Accordingly, the source address taken from one of the following seven sources, shown in decreasing order of preference:


1. Resent-reply-to:
2. Resent-from:
3. Reply-to:
4. From:
5. Resent-sender:
6. Sender:
7. Envelope From:

Note that the Resent-reply-to: and Reply-to: header lines are only considered if the USE_HEADER_REPLY_TO option has the value 1. Moreover, the Resent-reply-to:, Resent-from:, and Resent-sender: header lines are only considered if the USE_HEADER_RESENT option has the value 1. (Note that this means that both of those options must have the value 1 for the Resent-reply-to: header line to be considered.) The default value for both of these options is the value 0. As such, only items 4, 6, and 7 are considered by the default configuration. Finally, since the source address in an SMS message is limited to 20 bytes, the source address chosen will be truncated if it exceeds that limit.

Table C–3 shows the mandatory fields set in a SUBMIT_SM PDU:

Table C–3 Mandatory Fields in Generated SUBMIT_SM PDUs

Field  

Value  

service_type

DEFAULT_SERVICE_TYPE channel option; default value is an empty string.

source_addr_ton

DEFAULT_SOURCE_TON channel option; if USE_HEADER_FROM=1, then this field is usually forced to the value 0x05 indicating an alphanumeric TON; otherwise, the default value is 0x01 indicating an international TON.

source_addr_npi

DEFAULT_SOURCE_NPI channel option; default value is 0x00.

source_addr

DEFAULT_SOURCE_ADDRESS channel option if USE_HEADER_FROM=0; otherwise, an alphanumeric string representing the originator of the email message.

dest_addr_ton

TON addressing attribute or DEFAULT_DESTINATION_TON channel option; default value is 0x01 indicating an international TON.

dest_addr_npi

NPI addressing attribute or DEFAULT_SOURCE_NPI channel option; default value is 0x00 indicating an unknown NPI.

dest_addr

Destination SMS address derived from the local part of the email envelope To: address; see C.2.1 Directing Email to the Channel.

esm_class

For one-way SMS, set to 0x03, indicating store and forward mode, default SMSC message type, and do not set reply path. For a two-way MSM message, set to 0x83. 

protocol_id

0x00; unused for CDMA and TDMA; for GSM, 0x00 indicates no Internet, but SME-to-SME protocol. 

priority_flag

0x00 for GSM & CDMA and 0x01 for TDMA, all indicating normal priority; See the description of the DEFAULT_PRIORITY channel option.

schedule_delivery_time

Empty string indicating immediate delivery. 

validity_period

DEFAULT_VALIDITY_PERIOD channel option; default value is an empty string indicating that the SMSC’s default should be used.

registered_delivery

0x00 indicating no registered delivery. 

replace_if_present_flag

0x00 indicating that any previous SMS messages should not be replaced. 

data_coding

0x00 for the SMSC’s default character set; 0x08 for the UCS2 character set. 

sm_default_msg_id

0x00 indicating not to use a pre-defined message. 

sm_length

Length and content of the SMS message; see C.2.2 The Email to SMS Conversion Process

short_message

Length and content of the SMS message; see C.2.2 The Email to SMS Conversion Process

Table C–4 shows the optional fields in a SUBMIT_SM PDU:

Table C–4 Optional Fields in Generated SUBMIT_SM PDUs

Field  

Value  

privacy

See the description of the DEFAULT_PRIVACY channel keyword; default is to not provide this field unless the email message has a Sensitivity: header line

sar_refnum

See the description of the USE_SAR channel keyword; default is to not provide these fields

sar_total

See sar_refnum above.

sar_seqnum

See sar_refnum above.

The channel remains bound to the SMPP server until either it has no more SMS messages to submit (the message queue is empty), or MAX_PAGES_PER_BIND has been exceeded. In the latter case, a new connection is made and bind operation performed if there remain further SMS messages to send.

Note that the SMS channel is multithreaded. Each processing thread in the channel maintains its own TCP connection with the SMPP server. For example, if there are three processing threads each with SMS messages to submit, then the channel will have three open TCP connections to the SMPP server. Each connection will bind to the SMPP server as a transmitter. Moreover, any given processing thread will only have one outstanding SMS submission at a time. That is, a given thread will submit an SMS message, then wait for the submission response (that is, SUBMIT_SM_RESP PDU) before submitting another SMS message.