Page 1 of 1

Adding a UDH?

Posted: Wed May 22, 2013 4:25 pm
by AG70
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

Re: Adding a UDH?

Posted: Wed May 22, 2013 7:19 pm
by AG70
Hello,

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

Kind Regards,
Asaf

Re: Adding a UDH?

Posted: Tue Sep 26, 2017 5:35 am
by aymansoft
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