>130 chars error

Smpp v3.4 client

Moderator: alt

Locked
KonstOne
Posts: 7
Joined: Fri Sep 26, 2008 7:31 am

>130 chars error

Post by KonstOne » Fri Sep 26, 2008 7:40 am

Hello. I try to send a message with more than 130 chars (130-160 chars english text) but receive this error:

"Value was either too large or too small for an unsigned byte."

StackTrace:
at System.Convert.ToByte(Int32 value)
at ALT.SMS.SubmitSm.suBHmnexr()
at ALT.SMS.SubmitSm.ALT.SMS.IPacket.GetBytes()
at ALT.SMS.SmppClient.KkdQHOPxF(IPacket )
at ALT.SMS.SmppClient.Submit(SubmitSm data)


Execute on this code:

Code: Select all

                    sm = New SubmitSm
                    sm.Command = CommandSet.SubmitSm
                    sm.DestAddr = Msg.Contact
                    sm.DestNpi = Convert.ToByte(1)
                    sm.DestTon = Convert.ToByte(1)
                    sm.SrcAddr = SourceAddress
                    sm.SrcNpi = Convert.ToByte(1)
                    sm.SrcTon = Convert.ToByte(1)
                    sm.RegisteredDelivery = 1
                    sm.ShortMessage = Msg.Message '>130 chars message string
                    ret = smpp.Submit(sm)
Why error?

PS
hm, by default datacoding set to USC2 ;)
thanks, all ok.
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Thu Oct 09, 2008 4:11 pm

sm.ShortMessage can not contain more than 254 bytes

Please try method SubmitText. This method supports concatenated messages.
Locked