Page 1 of 1

Access Custom Parameter ID In client_evSubmitComplete

Posted: Tue May 16, 2017 3:53 pm
by vineet
Hi,

I want to send message using SubmitAsync() function is there way i can fetch the custom id like 34455 in client_evSubmitComplete
so i can relate this id with the db and update the messageid in the db. if possible please provide a sample.

Re: Access Custom Parameter ID In client_evSubmitComplete

Posted: Tue May 16, 2017 4:08 pm
by alt
Each SmppPDU has Tag property where you can store any state. In complete method you can get it with data.Request.Tag property.

Re: Access Custom Parameter ID In client_evSubmitComplete

Posted: Tue May 16, 2017 4:34 pm
by vineet
Please show a code snippet how to set a tag property i am unable to find it.

here is the code

DataCodings coding = GetDataCoding();

byte srcTon = byte.Parse(tbSrcAdrTON.Text);
byte srcNpi = byte.Parse(tbSrcAdrNPI.Text);
string srcAdr = tbSrcAdr.Text;

byte dstTon = byte.Parse(tbDestAdrTON.Text);
byte dstNpi = byte.Parse(tbDestAdrNPI.Text);
string dstAdr = tbDestAdr.Text;

ISubmitSmBuilder builder = SMS.ForSubmit()
.From(srcAdr, srcTon, srcNpi)
.To(dstAdr, dstTon, dstNpi)
.Coding(coding)
.Text(tbSend.Text)
.ExpireIn(TimeSpan.FromDays(2))
.DeliveryReceipt();

_client.SubmitAsync(builder);

how to set tag value example 35467.

Many Thanks

Re: Access Custom Parameter ID In client_evSubmitComplete

Posted: Tue May 16, 2017 4:51 pm
by alt

Code: Select all

ISubmitSmBuilder builder = SMS.ForSubmit()
.From(srcAdr, srcTon, srcNpi)
.To(dstAdr, dstTon, dstNpi)
.Coding(coding)
.Text(tbSend.Text)
.ExpireIn(TimeSpan.FromDays(2))
.DeliveryReceipt()
.Set(s=>s.Tag = "myId");
Please note that myId represents tbSend.Text and in case of long text it will be spitted to several small parts where each part receives own SubmitSmResp with different MessageId from the server but with the same myId.

Re: Access Custom Parameter ID In client_evSubmitComplete

Posted: Tue May 16, 2017 4:59 pm
by vineet
Thanks a lot for help. there is no issue if it receives same tag for each message part as in db design it is the main message id connected with message parts tables so it will be real easy to implement thanks a lot for the help.