-
Notifications
You must be signed in to change notification settings - Fork 361
Sending message longer than 160 characters using UDH #49
Comments
I'm using this way and it works fine:
|
I have already tried this option. But it is not working. SMSC team suggested to send UDH. |
We have the same problem. Some example using UDH to split long message would be great |
Here you go |
Hi, you can use GsmUtil from cloudhopper-commons GsmUtil.createConcatenatedBinaryShortMessages - split byte array to parts and create proper UDH-headers in parts. You have only create message id. Example: byte[][] msgParts; Random random = new Random(); Then you have to make a loop through all msgParts, create SUBMIT_SMs and send them. |
These unwanted symbols are bytes of udh header. Your cell phone use them for proper concatenation. |
Yes. But message have to be less then 140 bytes. In other words dont use concatenated messages. |
@aagiri : Normally, SMSC allows only 160 characters max. per SMS. If message goes beyond this limit, SMSC simply reject the message and does not deliver to sender. To solve this problem, UDH comes into picture. If a message has length more than 160 chars then it should be divided into multiple short messages for delivery (look at method sendLongMessage / splitUnicodeMessage). For example, if a message has 350 characters then it will be divided into 3 messages. Each message will contain the UDH information (packet sequence, referenceId etc. ) as given in the gist. Mobile devices has the capability to concatenate multiple messages containing UDH and displaying as a single SMS. |
Not quite that, the message can have 140 bytes max. See http://stackoverflow.com/a/21121353/685796 |
@aagiri |
@aagiri Well, technically you can send a longer message, but real SMSC will reject your message, while dummy testing SMSC will not. |
@foreverdeepak I used the code in your link https://gist.github.com/foreverdeepak/9130661. The message is concatenated and sent but is received on the phone as a single 160 character message with questions marks in the front like this ...
is there anything else I'm missing?
|
@sybraimah: You have spaces in starting of the text. Just trim the text (text.trim()) before encode. |
@foreverdeepak thanks for hint |
@foreverdeepak Do you want me to share the codes here? I don't mind. just to let you know that I have implemented that using version 3.0.0 (single and multiple page worked just fine at first try) but moving to jsmpp though. reason is simple, I don't really like the way delivery response registration is done and how the call back is done. Maybe I am missing something but not matter what value registered I only get submit_resp. I am going to explore jsmpp and post back here if it fits all my expectations |
I am trying to send concatenated SMS.My previous code(implemented by others) successfully sends 160 long SMS successfully.I am tryng to increase the length of SMS,so Spiled that msg in 153 each and trying to put UDH in each part.my previous SMS in septet .header have 6(6*8=48 and i want 49 that is 7 septet) octets.how to create that combination of Septet and octate.please help me.its urgent |
In general SMSC takes care of splitting of long messages , adding udh headers to msg and sending them to mobile handset .In this case you have to use optional parameter to send long messages to SMSC. In case if your SMSC doesnt support splitting then you have to send message to SMSC in parts by appending udh headers to each part . refer https://gist.github.com/foreverdeepak/9130661 to achieve this . For your information ,6 bytes are required to add udh headers. I could not understand what u meant to say in the last two lines. |
@batman09 In my experience ESME (the client) takes care of splitting. |
@krasa depends on SMSC gateway.If it doessn't then u have to split !!!! This question is off topic: Have you ppl ever implemented submit_multi using cloudhopper ????? I referred this #33 but unable to implement .Help me out @kdjomeda @sybraimah @wizardjedi @gabrielhof @krasa @foreverdeepak @imade |
Closing this issue as the discussion above provides lots of useful info for folks interested in splitting SMS. Lots of various ways depending on the SMSC. |
UDH is not supported in CDMA networks. Is there any other way we can send message larger than 160 both GSM and CDMA networks.
According to SMPP doc we can use TLV message payload and sar_msg_ref_num, sar_segment_seqnum and sar_total_segments and set short_message to null. |
Hi Joe,
First of all, Happy new year to you. Hope, you are doing good.
We are using cloudhopper-smpp to submit the SMS to SMSC. But, SMSC has a restriction that we cannot send the SMS longer than 160 characters. If you want then you have to set the UDH. I was looking for some example/documentation, but did not find any. Can you please help us with some code snippet where we can send the long messages using UDH.
Best Regards,
Deepak
The text was updated successfully, but these errors were encountered: