Incorrect message length of 1st PDU

Post Reply
iflow
Posts: 2
Joined: Sat Jun 01, 2019 11:37 am

Incorrect message length of 1st PDU

Post by iflow » Tue Jun 04, 2019 12:55 pm

Hi,

I want to report an issue in Inetlab.SMPP version 2.6.10 (latest release on NUGET).

The issue is when a message is using GSM 7-bit encoding, is over 160 characters in length and two or more extended-character-set characters are in the second-half of the message. The length of the first PDU becomes 154 characters in length which is subsequently rejected by the network.

To illustrate I wrote this function

Code: Select all

        private static void runTest(string text_message)
        {
            var _smpp = new SmppClient();

            var em = new EncodingMapper();
            var coding = DataCodings.Default;

            var sms_pdus = SMS.ForSubmit()                                                      // create pdu(s) for sms message
                .From("+353870000000")
                .To("+353870000000")
                .Coding(coding)
                .Text(text_message)
                .DeliveryReceipt()
                .Create(_smpp);

            foreach (var Sm in sms_pdus)
            {
                var message = Sm.GetMessageText(em);
                Console.Write("Message length: ");
                Console.WriteLine(message.Length.ToString());
            }
            return ;
        }
  
Then calling that function with 2 similar text messages:

Code: Select all

            // This works correctly
                       runTest("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");

            // This does not work with the extra { }
                      runTest("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ{}");

The first yields text lengths of 153 and 29.

The second yields text lengths of 154 and 30 which is invalid.

Is there something I can do as a work around?

many thanks

Dermot
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Incorrect message length of 1st PDU

Post by alt » Mon Jun 24, 2019 5:09 pm

Hi Dermot,

Thank you for reporting and sorry for the delayed response.

This issue should be fixed in v.2.6.12
https://www.nuget.org/packages/Inetlab. ... eta-190623

Please check it and let me know if you have another issues.
iflow
Posts: 2
Joined: Sat Jun 01, 2019 11:37 am

Re: Incorrect message length of 1st PDU

Post by iflow » Tue Jun 25, 2019 10:26 am

Hi,

yes, that version is now working correctly.

Thank you
Dermot
Post Reply