Multipart SMS DELIVERY problem

Smpp v3.4 client

Moderator: alt

prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Wed Nov 11, 2009 1:07 pm

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?.
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Wed Nov 11, 2009 1:15 pm

I have the same problem in SUBMIT_SM and in DELIVER_SM
BenEllis
Posts: 21
Joined: Mon Nov 09, 2009 4:30 pm
Location: Leicester, United Kingdom
Contact:

Post by BenEllis » Wed Nov 11, 2009 1:29 pm

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.
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Wed Nov 11, 2009 2:31 pm

Dears, I have one question: can I prepare SUBMIT_SM in DataCodings.ASCII
BenEllis
Posts: 21
Joined: Mon Nov 09, 2009 4:30 pm
Location: Leicester, United Kingdom
Contact:

Post by BenEllis » Wed Nov 11, 2009 3:08 pm

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.
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Wed Nov 11, 2009 3:09 pm

Dear BenEllis,

Please sent me the algorithm

Thanks a lot
BenEllis
Posts: 21
Joined: Mon Nov 09, 2009 4:30 pm
Location: Leicester, United Kingdom
Contact:

Sending Concatenate ASCII / GSM 03.38 messages

Post by BenEllis » Wed Nov 11, 2009 3:28 pm

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.
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Wed Nov 11, 2009 4:42 pm

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

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);
What is a problem?
BenEllis
Posts: 21
Joined: Mon Nov 09, 2009 4:30 pm
Location: Leicester, United Kingdom
Contact:

Post by BenEllis » Wed Nov 11, 2009 4:47 pm

What text are you trying to send? Is it alphanumeric characters only?

Also, what mode are you using? Payload/Shortmessage?
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Wed Nov 11, 2009 4:50 pm

And I have other problem too,

when I am tring sent large SMS with payload, then I receive multiple separated SMSs.
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Wed Nov 11, 2009 4:51 pm

I am sending alphanumeric characters in ShortMessage mode
BenEllis
Posts: 21
Joined: Mon Nov 09, 2009 4:30 pm
Location: Leicester, United Kingdom
Contact:

Post by BenEllis » Wed Nov 11, 2009 5:00 pm

Is this payload problem a seperate problem?

Since you aren't suppose to use Payload and ShortMessage at the same time, this can cause problems.

I've used Latin-1 and ASCII in ShortMessage mode and both work fine with my SMSC. So alt is possibly right and it may be a problem with your SMSC.
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Thu Nov 12, 2009 10:15 am

Dears,
I found the froblem, it is folowing:

When I am ting to send large message with SUBMIT_SMS,
then SMPP client DLL splits the messahe in parts and send it.

And message encoding of each part is 8 bit, but my DCS: is 7 bit
prog019
Posts: 44
Joined: Mon Mar 02, 2009 2:12 pm

Post by prog019 » Thu Nov 12, 2009 12:00 pm

Dear BenEllis,

You sent to me example for sending multiple smses and you are using AddConcatenatedShortMessages8bit.
Question: how Add Concatenated Short Messages in 7 bit.
I have the big problem with this.
BenEllis
Posts: 21
Joined: Mon Nov 09, 2009 4:30 pm
Location: Leicester, United Kingdom
Contact:

Post by BenEllis » Wed Dec 09, 2009 9:06 am

My SMSC takes 7bit encoding with 8 bit characters (the 8th bit is always 0). As far as I know this is standard.

If your SMSC isn't following this, then you'll need to write an algorithm to concatenate the 7bit characters in a binary stream.
Locked