Multipart SMS DELIVERY problem
Moderator: alt
I am tring to sent Long SMS(length=320) with our SMPP client, where
Data Coding=Default
and receive sms message with invalid characters.
When I am tring to sent same text in DataCoding=UCS2, I am receive Correct message with normal text.
Are You sure, when you split message text in SUBMIT_SM method, you set encoding in 7 bit?.
Data Coding=Default
and receive sms message with invalid characters.
When I am tring to sent same text in DataCoding=UCS2, I am receive Correct message with normal text.
Are You sure, when you split message text in SUBMIT_SM method, you set encoding in 7 bit?.
It might help if you copy and paste the code you're using to create your submitsm and read your deliversm?
Sounds like you're setting the .ShortMessage property to an encoded Hex String instead of a standard string.
Also, I believe the .Default option requires different encodings depending on the SMSC as it is SMSC specific.
Sounds like you're setting the .ShortMessage property to an encoded Hex String instead of a standard string.
Also, I believe the .Default option requires different encodings depending on the SMSC as it is SMSC specific.
See http://www.inetlab.ru/support/viewtopic.php?t=631
If you set the Encoding to ASCII then use that algorithm to generate your ShortMessageBytes it should work.
I'm using this currently.
If you want to concatenated messages, it gets a bit more complicated. I can post this algorithm also if you want.
If you set the Encoding to ASCII then use that algorithm to generate your ShortMessageBytes it should work.
I'm using this currently.
If you want to concatenated messages, it gets a bit more complicated. I can post this algorithm also if you want.
Sending Concatenate ASCII / GSM 03.38 messages
Below is close to what I am using, so far I've had no problems with it.
Code: Select all
// Encode as GSM 03.38
byte[] data = GsmEncode(/* Put Plain Text here */);
List<SubmitSm> reqs = new List<SubmitSm>();
// If message needs to be concatenated (140 bytes (160 Gsm characters))
if (data.Length > 160)
{
byte concatMsgRef = // Generate new unique concatMsgRef here (0/1-255) for each long message you send. Once the operation is complete you can re-use the same id again.
byte seqNum = 0;
const int concatPartLength = 153;
int bytes = data.Length;
while (bytes > 0)
{
// Create Message
SubmitSm req = new SubmitSm(/* Service Type */, /* Source TON */, /* Source NPI */, /* Source Address*/, /* Dest TON */, /* Dest NPI */, /* Dest Addr */);
// Load Data
req.DataCoding = DataCodings.ASCII;
int bytesLeft = data.Length - bytes;
byte[] toSend = new byte[concatPartLength < bytes ? concatPartLength : bytes];
for (int i = 0; i < toSend.Length; i++)
toSend[i] = data[bytesLeft + i];
req.UserDataPdu.Headers.AddConcatenatedShortMessages8bit(concatMsgRef, (byte)((data.Length / concatPartLength) + 1), ++seqNum);
int r = req.UserDataPdu.Headers[0].Length;
req.UserDataPdu.ShortMessage = toSend;
reqs.Add(req);
bytes = bytes - concatPartLength;
}
}
else
{
SubmitSm req = new SubmitSm(/* Service Type */, /* Source TON */, /* Source NPI */, /* Source Address*/, /* Dest TON */, /* Dest NPI */, /* Dest Addr */);
req.DataCoding = DataCodings.ASCII;
req.ShortMessageBytes = data;
reqs.Add(req);
}
SubmitSmResp[] resps = client.Submit(reqs.ToArray());
Last edited by BenEllis on Wed Nov 11, 2009 4:50 pm, edited 1 time in total.
Dears,
please, look to this:
I am send long message with 355 length via SUBMIT_SM
1. when DataCoding is UCS2, the result is OK
2. when DataCoding is DataCodings.Default or DataCongs.Latin1, the result is unreadable text
What is a problem?
please, look to this:
I am send long message with 355 length via SUBMIT_SM
1. when DataCoding is UCS2, the result is OK
2. when DataCoding is DataCodings.Default or DataCongs.Latin1, the result is unreadable text
Code: Select all
SubmitSm[] req = client.PrepareSubmit(
mode,
byte.Parse(tbSrcAdrTON.Text),
byte.Parse(tbSrcAdrNPI.Text),
tbSrcAdr.Text,
byte.Parse(tbDestAdrTON.Text),
byte.Parse(tbDestAdrNPI.Text),
tbDestAdr.Text,
coding,
tbSend.Text);
SubmitSmResp[] resp = client.Submit(req);