Long Messages

Long Messages

Messaging technology in most mobile networks has a limitation to 140 bytes of message content which is either 160 characters in 7 bit encoding, 70 Unicode encoded characters or 140 bytes of data. Messages which are longer than this are sent and delivered using message concatenation - message is split into a series of messages each within size allowed for particular encoding. The messages are then received and reassembled into one long message by the remote party - most commonly mobile phone. This process requires forming a User Data Header (UDH) for each partial message. UDH size has to be deduced from the size of the message data so splitting is not an equivalent to dividing the message size by maximum message size for particular encoding.

Enabling Long Messages

Library handles internally splitting and joining of long messages send and received respectively. All that is needed is setting smpp.long-messages during initialization of the connection with the SMSC. For example for the SMPP protocol:

  string ep = "smpp.long-messages=udh8";

  // [...]

  result = clientSMPP.smppInitializeSession("user", "password",
    1, 1, "", smppBindModeEnum.bmTransceiver, 3, ep);

Possible values of the smpp.long-messages flag are as follows:

none No message concatenation.
udh8 Message concatenation is done using User Data Header field (UDH) with 8 bit reference field.
udh16 Message concatenation is done using User Data Header field (UDH) with 16 bit reference field.

SMPP Specific Split Methods

In SMPP protocol apart from generic method of splitting using User Data Header (UDH) there are two other methods to transmit long message:

sar Messages is split using sar_msg_ref_num (0x020c), sar_total_segments (0x020e) and sar_segment_seqnum (0x020f) optional parameters (TLVs).
payload Long message can be accepted by the SMSC encoded in message_payload (0x0424) optional parameter (TLV) which can hold up to 65535 bytes.

Availability of these SMPP specific methods depends on the configuration of particular messaging service. It is always safe to try User Data Header (UDH) splitting method for long messages and when it fails ask provider for more information.

See Also

Usage Overview