long message

.NET library for SMPP protocol
Locked
rakan
Posts: 1
Joined: Mon Oct 11, 2010 4:36 pm

long message

Post by rakan » Mon Oct 11, 2010 4:46 pm

im using inetlab smpp server when i send a 320 char long message from Smpp client , how is the message sent in 2 parts , can any expline how i can recived 1 mesage in mobile
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Sat Oct 16, 2010 2:04 pm

when short_message is longer then 140 bytes it should be splited on parts as defined in GSM standard.
Every mobile phone support concatenated messages and you should see on the screen one message.
shazia1
Posts: 12
Joined: Wed Nov 16, 2011 10:22 am

Re: long message

Post by shazia1 » Wed Nov 16, 2011 11:09 am

Whenever I try to send a large message from demo server, to the client, the code crashes at client.Deliver(data) method with the following exception: "Value was either too large or too small for an unsigned byte".

Am I missing some attribute needing to be added in the sending message?
What is the max msg size which can be send from server?
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: long message

Post by alt » Fri Nov 18, 2011 9:07 am

Could you post here stack trace and code you use.
shazia1
Posts: 12
Joined: Wed Nov 16, 2011 10:22 am

Re: long message

Post by shazia1 » Fri Nov 18, 2011 11:54 am

The is same as used in demo application server:

Code: Select all

               
                Inetlab.SMPP.PDU.DeliverSm data = new Inetlab.SMPP.PDU.DeliverSm();

                data.SourceAddrTon = byte.Parse(tbSrcAdrTON.Text);
                data.SourceAddrNpi = byte.Parse(tbSrcAdrTON.Text);
                data.SourceAddr = tbSrcAdr.Text;

                data.DestAddrTon = byte.Parse(tbDestAdrTON.Text);
                data.DestAddrNpi = byte.Parse(tbDestAdrNPI.Text);
                data.DestAddr = tbDestAdr.Text;

                data.DataCoding = GetDataCoding();
                data.UserDataPdu = new Inetlab.SMPP.Common.UserData();
                data.UserDataPdu.ShortMessage = _client.GetMessageBytes(tbSend.Text, data.DataCoding);
               _client.Deliver(data);
And the stack trace is as follows:

" at System.Convert.ToByte(Int32 value)\r\n at Inetlab.SMPP.PDU.DeliverSm.WddAOCwt0e()\r\n at Inetlab.SMPP.PDU.DeliverSm.GetBytes()\r\n at Inetlab.SMPP.Common.SmppClientBase.FWEGyqKuL()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: long message

Post by alt » Fri Nov 25, 2011 1:36 pm

Hi shazia1,

data.UserDataPdu.ShortMessage cannot be longer than 140 bytes regarding GSM standard.

It seems you need something like PrepareSubmit that return SubmitSm list in SmppClient class, but in your case you need to generate concatenated DeliverSm parts.
Usually for SMPP proxy you receive DeliverSm parts from SMSC and then just forward them to recipient. Do you concatenate text parts when you receive from SMSC, or do you havw different workflow?
shazia1
Posts: 12
Joined: Wed Nov 16, 2011 10:22 am

Re: long message

Post by shazia1 » Mon Nov 28, 2011 5:04 am

This is not my application flow. I was just trying to send messages from server to client and client to server in demo application. And everytime on sending a long message to client, the server gets crashed.
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: long message

Post by alt » Wed Nov 30, 2011 8:43 am

Ok, I'm going to add helper methods for sending concatenated DeliverSm messages.
hishhash2
Posts: 17
Joined: Mon Jan 30, 2012 11:24 am

helper methods for sending concatenated DeliverSm messages

Post by hishhash2 » Tue Jan 31, 2012 6:55 am

HI alt,

I am testing a situation where in which my smpp server acts as SMSC and i want to send Long Messages to the clients which are like 400 characters or more. At the moment the following code throws an error when the message length is more.

Code: Select all

data.UserDataPdu.ShortMessage = _client.GetMessageBytes(MsgLengthMorethan400, data.DataCoding);
It would have been really great if there is a way to get concatenated DeliverSm parts, like in the current PrepareSubmit that return SubmitSm list in SmppClient class.

Appreciate your reply...
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: long message

Post by alt » Wed Feb 01, 2012 12:14 pm

Hi

I'm going to add fluent SMS builder as replacement of PrepareSubmit. It will work with SubmitSm, SubmitSmMulti and DeliverSm.

Here is example of code:

Code: Select all

SMS.With()
.Text("Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test")
.From("1111")
.To("2222")
.Coding(DataCodings.UCS2)
Locked