26 January 2009 ~ 16 Comments

[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 fragements 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 fragements, 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 :-)

Tags: ,

16 Responses to “[SMPP] Sending long SMS through SMPP”

  1. Chintan 3 March 2009 at 11:14 am Permalink

    Thanks, It is small but give me very useful idea to search ahead for it.

  2. Vikram 20 August 2009 at 11:55 am Permalink

    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.

  3. ashish 25 August 2009 at 6:59 am Permalink

    Vikram, I am not sure about how to send them. Can you try jsmpp forum.

  4. Vikram 28 August 2009 at 11:21 am Permalink

    Hi,
    I am getting special chracters through smpp using my java code..
    Now I am gettting diff problem.I am not getting long sms in one updation.In several updation I am getting complete long sms.

    Is there any way to get complete sms in one updation???
    Please help me…

  5. Suren 4 September 2009 at 1:22 pm Permalink

    Hi,
    For each SubmitSM of the message fragment, do we get a SubmitSMResp?
    Pls clarify

  6. ashish 5 September 2009 at 3:54 pm Permalink

    Yes it will. try it with real SMSC

  7. Suren 7 September 2009 at 7:55 am Permalink

    Thanx a lot!!

  8. Tommy 24 September 2009 at 1:54 pm Permalink

    Can anyone told me how can I add the optional paramter after the mandatory parameter. Can give me a example?

  9. Ruwan 19 October 2009 at 11:41 am Permalink

    Can any body, please share java code to send Long SMS messages using SMPP Version 3.4?

  10. Arvind 5 November 2009 at 10:23 am Permalink

    How does JSMPP send 3000 – 5000 messages per second?
    Meaning, is this by creating multiple threads or any particular mechanism.

    Thanks in advance!!

  11. ashish 7 November 2009 at 10:28 am Permalink

    Yup it uses Executors for the same. Though the number is not guranteed. A lot depends on how soon the SMPP Server is responding back to requests.

  12. Arvind 9 November 2009 at 1:29 pm Permalink

    Thanks for the quick reply Ashish

  13. Sebastian 3 December 2009 at 3:33 am Permalink

    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.

  14. NAVEEN JAIN 2 June 2010 at 10:02 am Permalink

    Hi Ashish,

    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.

    Please reply ASAP.

  15. Rakesh Kumar 10 June 2010 at 12:37 pm Permalink

    Hi can any body tell me how to send long concatenated sms using Logica smpp. Can somebody give me code to send long sms Please help.Thanks in advance.

  16. ram 10 June 2010 at 2:28 pm Permalink

    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……..


Leave a Reply