[SMPP] Sending long SMS through SMPP

SMS is designed to send small text messages upto 140 chars. It actually depends upon the encoding. Using 7 bit encoding, you can send 160 chars, using Unicode, you can only send 70 chars. The data is carried in User Data section.

This post talks about ways of sending Long message using SMPP

Using SMPP we can send long SMS by two means

Using Payload option

Submit SM PDU has a field called message_payload. Set the data in it and you can send upto 64K octets. But this option is not supported by a lot of provider. Verify with your provider, if they support the same.

Using Message fragementation

This format is more common and widely supported. Essentially, the long SMS is divided into smaller messages and send with a particular format, by setting UDH.

The key TLV options used are

sar_msg_ref_num - The reference number for a particular concatenated short message

sar_total_segments - Indicates the total number of short messages within the concatenated short message

sar_segment_seqnum - Indicates the sequence number of a particular short message fragment within the concatenated short message

How do you set these, depends upon the SMPP library you use. Will brief the algo

Break the long sms into parts, so that fragement can fit into single Submit SM PDU

The total number of fragments shall give the value of sar_total_segments

Generate a unique identifier value, this becomes the values of sar_msg_ref_num

Now in a loop send the message fragments, with values in step above. sar_segment_seqnum values shall be the value of the loop count (ensure that it starts from 1)

39 thoughts on “[SMPP] Sending long SMS through SMPP”

Hi,
I am unable to send some special characters through smpp like £(pound) ,• (bullet).

can you tell me how to generate unique sar_msg_ref_num for messages.I am using random number to generate for this.But some times we may get same random number diff requests.In that case both messages will be failed.

What do you mean when you say by setting UDH?
There is a way of adding chars to the PDU but is not working on my SMPP Client
I think it’s because I’m not reciving the sm_resp from the SMSC and using the value.
Can you help me giving me a php code example of how you do this?
Thanks a lot.

I have a query with regard to fragmentation. I need to send a long message using fragmentation i.e. dividing a long message into multiple short messages. Now, this has to be done along with encoding, say GSM 7-Bit. There are two scenarios:

a) Need to send fragments using SAR TLVs. The question arises whether I will fragment messages first and then encode it or other way. Let’s say I have original message spanning (in ASCII) 400 octets. Now, If I encode this message into GSM 7-Bit, then it converts to 350 octets (400 * 7/8). If I follow encode first, fragment next, then it means 3 fragments of 140, 140, 70 octets. What is the ideal way of doing it?

b) Need to send fragments using UDH. I have same question over ordering of encoding & fragmentation.

hi
any one reply me plz…
i am send sms using jsmpp the msg send successfuly but cant able to read….it says “Unable to open. Message format not supported”
i am new for this…
how can identify find the error i dont knw wat to do..any one helpme its urgent……..

What is the library (and version of it) you use in this example? It looks like Java SMPP Library by Logica, but in version that I found (The Java SMPP Library version 1.3) I dont see the method setShortMessageData( ByteBuffer byteBuffer ) in class SubmitSM.

Did you add it to the library by yourself?
If not, can you put correct link to the library you use?

I have 2 messages:
– “This is a message 001” with the PDU in normal format: 0000004B0000000400000000000000020001013139303035373135393200010130313233363734353737380000000300000000000015546869732069732061206D65737361676520303031
– “This is a message 002” with the PDU in normal format: 0000004B0000000400000000000000020001013139303035373135393200010130313233363734353737380000000300000000000015546869732069732061206D65737361676520303032

—> How to add the sar_msg_ref_num,sar_total_segments,sar_segment_seqnum into these PDUs?

Hi ,
I am also using smpp protocol.I am sending the long unicode message with encoding format as UTF-16 for encoding the unicode message and using setmessagPayLoad(buffer bb)function for sending the long message. This method is defined in submit_sm class of smpp protocol.For me the receiver is getting the empty message suggest what to do so that receiver will get the correct encoded message.

There is another way of sending a long message (more than 140 octets ) using 3GPP TS 23.040 supported User Data Header(UDH) apart form using SAR TLVs or mesage_payload TLV.

The UDH is more suitable when ESME is sending this message to SMSC (and the finally to a customer handset). Why ? because in this case SMSC needs to do very limited processing for building TPDU comparing with the TLV model. The contents of short_message will be copied and put into TP-UD field of TPDU – No further processing required. Here are the steps:

1. ESME should set the UDHI bit in esm_class of submit_sm – indicating that the short_message has user data header in addition to actual sms text.
2. Put the UDH and sms body in the short_message or message_payload parameter of submit_sm.
3. Submit all segments by changing appropriate values of user data header –
Message identifier (same for all segments of a long message)
Message Parts (Total number of segments – same for all segments)
Message Part Number (1 to value of Message Parts)

On receiving these segments, SMSC will first accumulate all these and then will try to deliver to end user.