QueryAsync Example

.NET library for SMPP protocol
Locked
joebo
Posts: 1
Joined: Wed Oct 28, 2015 2:38 pm

QueryAsync Example

Post by joebo » Wed Oct 28, 2015 2:56 pm

Hello,

I'm trying to determine if a message has been successfully sent and I can't find an example of how to do so using QueryAsync. Our old app would use the SubmitText function which would return a SubmitSmResp. From there we would be able to determine if the message was successfully sent. In the new version I'm working on we have a requirement to send messages asynchronously and I don't know how to get the status of a sent message. Can someone give me an example of how to get the status of a sent message? I should also mention that I don't have access to delivery receipts, it's not available to us for now.
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: QueryAsync Example

Post by alt » Sun Nov 01, 2015 11:09 am

Hello Joe,

When you send sms with method SybmitAsync, you can receive SubmitSmResp response in the event evSubmitComplete.

Code: Select all

_client.evSubmitComplete += ClientOnEvSubmitComplete;

 private void ClientOnEvSubmitComplete(object sender, SubmitSmResp data)
 {
            _repository.StoreMessagePartResponse(_sessionId, data.Sequence, data.MessageId);
}

private void SendSMS() 
{
   _client.SubmitAsync(pduList);  
}

Locked