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)
This is it 🙂