Get MessageId of SubmitAsync

.NET library for SMPP protocol
Locked
ACTEL_SMPP_SMPP
Posts: 1
Joined: Mon Aug 08, 2016 3:44 pm

Get MessageId of SubmitAsync

Post by ACTEL_SMPP_SMPP » Tue Aug 09, 2016 1:36 pm

We are encountering a problem and we need you support in order to solve it. We had complaints from some mobile operators that the end user is receiving multiple MT’s on his handset as we have only one registered record into our database as outgoing SMS.
They asked us to disable the retry mode in case we didn’t get an ACK from the SMPP server. So the only way to solve this issue is by submitting the SMS using the Async mode.

Used Code :
ISubmitSmBuilder Asyncbuilder = SMS.ForSubmit()
.To(drmessage["destination"].ToString(), byte.Parse(drmessage["DestAdrTON"].ToString()), byte.Parse(drmessage["DestAdrNPI"].ToString()))
.From(drmessage["originator"].ToString(), byte.Parse(drmessage["SrcAdrTON"].ToString()), byte.Parse(drmessage["SrcAdrNPI"].ToString()))
.Text(drmessage["smstextfull"].ToString())
.Set(delegate(SubmitSm sm) { sm.Sequence = _client.SequenceGenerator.NextSequenceNumber(); })
.Set(delegate(SubmitSm sm) { gatewayresponse = sm.Status.ToString(); });

if (drmessage["smsdlr"].ToString() == "1") { Asyncbuilder.DeliveryReceipt(); }
if (drmessage["MessageSubmitMode"].ToString().ToLower() == "payload") { Asyncbuilder.MessageInPayload(); };
if (drmessage["Encoding"].ToString() == "unicode") { Asyncbuilder.Coding(DataCodings.UCS2); };
try
{
if (!string.IsNullOrEmpty(drmessage["extra"].ToString()))
{
string[] tlvlist = Globals.SplitString(drmessage["extra"].ToString(), ";");
foreach (string par in tlvlist)
{
string[] subtlvlist = Globals.SplitString(par, "->");
Asyncbuilder.AddParameter(ushort.Parse(subtlvlist[0].ToString().Substring(2), System.Globalization.NumberStyles.HexNumber), Globals.FromUInt(uint.Parse(subtlvlist[1].ToString())));

}
}

}
catch { }
_client.SubmitAsync(Asyncbuilder);

But the main purpose here is to get the same messageid submitted in order to update the incoming DLR based on this messageid. How can we detect it upon sms submission in order to save it directly and solve this issue ? Or is there solution to disable the retry mode using the normal _client.Submit(builder) ?
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Get MessageId of SubmitAsync

Post by alt » Wed Aug 10, 2016 12:27 pm

You should use evSubmitComplete event in order to get MessageId from SubmitSmResp when you send with SubmitAsync method.

Try to avoid reading the same message from database before library get response (or responses for concatenated messages) from SMSC.
Locked