Adding a UDH?

.NET library for SMPP protocol
Locked
AG70
Posts: 15
Joined: Sun May 19, 2013 5:48 pm

Adding a UDH?

Post by AG70 » Wed May 22, 2013 4:25 pm

Hello,

From client code example at SubmitBatchMessages method my modified code look like this:

Code: Select all

for (int i = 0; i < count; i++)
            {
                //05 00 03 AB 02 02
                byte[] aaa = new byte[6];
                aaa[0] = 0x05;
                aaa[1] = 0x00;
                aaa[2] = 0x03;
                aaa[3] = 0xAB;
                aaa[4] = 0x02;
                aaa[5] = 0x02;
                
                UserDataHeader udh = new UserDataHeader();
                udh.Data = aaa;

                ISubmitSmBuilder builder = SMS.ForSubmit()
                    .Text(text)
                    .From(srcAdr, srcTon, srcNpi)
                    .To(dstAdr, dstTon, dstNpi)
                    .Coding(coding)
                    .Set(delegate(SubmitSm sm) { sm.Sequence = 12; })
                    .Set(delegate(SubmitSm sm) { sm.UserDataPdu.Headers.Add(udh); })
                    ;

                switch (mode)
                {
                    case SubmitMode.Payload:
                        builder.MessageInPayload();
                        break;
                    case SubmitMode.ShortMessageWithSAR:
                        builder.ConcatenationInSAR();
                        break;
                }
                _client.SubmitAsync(builder);

                Application.DoEvents();
            }
Problem is that when submitting to SMPP Server the UDH should arrive as 050003AB0202 but instead it arrives with leading bytes as marked in red 080006050003AB0202
How to delete leading three bytes?

* I know that Inetlab.SMPP can automatically concatenated messages but my situation is a different and I must submit each part of the concatenated with UDH and Text.

Thanks in advanced for any help,
Asaf
Kind Regards,
Asaf
AG70
Posts: 15
Joined: Sun May 19, 2013 5:48 pm

Re: Adding a UDH?

Post by AG70 » Wed May 22, 2013 7:19 pm

Hello,

Problem solved, I forgot to set EsmClass to 0x40 :)

Kind Regards,
Asaf
Kind Regards,
Asaf
aymansoft
Posts: 3
Joined: Sat Jul 30, 2016 10:33 am

Re: Adding a UDH?

Post by aymansoft » Tue Sep 26, 2017 5:35 am

Hi sir ,


my code is

resp = sroute.Submit(SMS.ForSubmit()
.From(srcAdr, srcTon, srcNpi)
.To(dstAdr, dstTon, dstNpi)
.Coding(coding)
.Text(row["sms_text"].ToString())
.ExpireIn(TimeSpan.FromDays(2))
.DeliveryReceipt()
.Set(delegate (SubmitSm sm) { sm.EsmClass = 0x40; })
.Set(delegate (SubmitSm sm) { sm.UserDataPdu.Headers.Add(udh); }));

and still i got issue for udh like 080006050003880202 how you can solve it pls
Locked