SMPP Multipart Messages

IPWorks V9 and Later

Sending multipart SMPP messages with newer versions of IPWorks is easy. Simply set the SplitLargeMessages configuration setting to true before sending, like the below example.

string msg = "This is a rather long message that should be split up into several smaller messages for transmission and then reassembled on the recipient's phone. While it is dependent on the data coding used, up to 140 characters are used per message fragment."; smpp1.Config("SplitLargeMessages=true"); smpp1.SendMessage(msg);

At the protocol-level SplitLargeMessages uses a UDH. In older versions of IPWorks this had to be constructed manually as described below.

Older Versions of IPWorks

To send enhanced content, a so called user data header (UDH) is added add the beginning of the user data block of the SMS.

When using an UDH, there is less data left for user data in the User Data field (140 - length of UDH).

A UDH can be used to send multipart messages, smart messaging (ringtones, WAP push, pictures etc), voicemail indications and other services.

In this article we will only discuss the use of UDH to send multipart text messages.

The UDH for message concatenation will only take 5 bytes, so there are 135 bytes left for the user data. When sending concatenated text messages, you can send 153 characters when using 7-bit text, when using Unicode 67 characters per part.

Byte Value Description
01 00 Information Element Identifier: Concatenated short message, 8bit reference number
02 03 Information Element Data Length (always 03 for this UDH)
03 A4 Information Element Data: Concatenated short message reference, should be same for all parts of a message
04 03 Information Element Data: Total number of parts
05 01 Information Element Data: Number of this part (1/3)


Example of a multipart message consisting of 3 parts containing 300 bytes:

SMS 1 User Data: 00 03 A4 03 01 [ 135 bytes of message data ]
SMS 2 User Data: 00 03 A4 03 02 [ 135 bytes of message data ]
SMS 3 User Data: 00 03 A4 03 03 [ 30 bytes of message data ]

The UDH present flag in the SMS header has to be set when an UDH block is used.

Using the latest version (V8) you can achieve this, even though it's not directly supported by the component. Below is some example code: nsoftware.IPWorks.Smpp smpp = new nsoftware.IPWorks.Smpp(); nsoftware.IPWorks.Netcode netcode = new nsoftware.IPWorks.Netcode(); smpp.Config("GSMSpecificFeatures=1"); //Set the UDHI field of the header. smpp.SMPPServer = "testman"; smpp.Connect("sender1", "sender1"); smpp.Recipients.Add(new nsoftware.IPWorks.SMPPRecipient("recipient1", 0)); byte[] UDH = new byte[6]; for (int i = 1; i <= 3; i++) //send a 3 part message { //UDH[0] = 0x05; //Length of UDH //UDH[1] = 0x00; //Concatenated short message //UDH[2] = 0x03; //Data Length //UDH[3] = 0xA4; //Concatenated short message reference //UDH[4] = 0x03; // Total number of parts //UDH[5] = (byte)i; //number of this part netcode.Format = nsoftware.IPWorks.NetcodeFormats.fmtHex; netcode.DecodedDataB = System.Text.Encoding.Default.GetBytes("This is part " + i.ToString()); netcode.Encode(); //Netcode is used to HexEncode the string for the next step. You can use any Hex encoding utility you like string myHexString = "050003A403" + i.ToString("00"); //Just hard code the UDH header for now. myHexString += netcode.EncodedData; smpp.Config("HexString=" + myHexString); //Setting this also sends the message. } smpp.Disconnect();
Note that this will only work on GSM networks.

We appreciate your feedback.  If you have any questions, comments, or suggestions about this article please contact our support team at kb@nsoftware.com.