How to convert septects to octets

.NET library for SMPP protocol
Locked
didimo
Posts: 8
Joined: Thu Jan 23, 2014 9:23 pm

How to convert septects to octets

Post by didimo » Thu Apr 10, 2014 1:17 pm

Hi,
We have to connect to a SMPP server that our SMSC operator specified to use DCS = 241 (Class1) and pack septets to octets.

We initialize the smpp client MapEncoding and build Submit_sm as below:

Code: Select all

smppClient.MapEncoding(Inetlab.SMPP.Common.DataCodings.Class1, new Inetlab.SMPP.Encodings.GSMPackedEncoding());
 
Inetlab.SMPP.SMS.ForSubmit()
		.Coding(Inetlab.SMPP.Common.DataCodings.Class1)
		.From(sourceAddr, srcTON, srcNPI)
		.To(destAddr, destTON, destNPI)
		.Text(text)
		;
But we received the status "ESME_RINVOPTPARAMVAL" and our SMSC operator says us that the problem are with the length of the sms:
If you use GSM 7bits characters (DCS = 241) then the maximum lenght of the sms should be 140 bytes (it means that maximum number of 7bits characters is 160 = 140 bytes). But you need to pack septects into octets.
How can we convert septects to octects?

Could someone give us help on this?

Thanks.
Locked