User Tools

Site Tools

SMPP Client FAQ

If I use SendAsync(), how do I know which DR should be matched with each sent SMS?

SubmitSmResp can be processed in evSubmitCompleted event handler, where you know sequence number from SubmitSm and you get MessageId for future Delivery receipt.

To send long SMS, is it handled internally (split into multiple part-SMS) in you code or must I handle UDH manually?

Text will be split automatically when you use SMS builders. Following example covers most usage scenarios

Client.Submit(SMS.ForSubmit()
     .ServiceType("test")
     .Text("Test Test Test Test Test Test Test Test Test Test")
     .From("1111")
     .To("2222")
     .DeliveryReceipt()
     .Coding(DataCodings.Default)
     );

FlashSMS, must I set this using DataCoding or do you have a Property I have not yet found?

In order to send Flash SMS you need to specify one of the following data coding in the SubmitSm class: DataCoding.UnicodeFlashSMS, DataCoding.DefaultFlashSMS

How do I get hold of the sequence number, when doing Client.SubmitAsync()

SMS Builder has Create method that returns SubmitSm list with already assigned sequence numbers. Then you can pass this list to SubmitAsync.

How to handle Throttling error from SMSC

SMSC can limit number of submitted PDU for SMPP account. When allowed message limit exceeded, server returns status ESME_RTHROTTLED. To avoid throttling error you can specify number of messages per second in SmppClient. For this purpose you can set property SmppClientBase.SendSpeedLimit

//Send 10 messages per second
client.SendSpeedLimit = 10;
 
//Send 1 message every 5 seconds
client.SendSpeedLimit = 1f/5f;

Example: Read messages from database and send them as fast as possible

var messageList = _query.GetUnsentMessages();
 
foreach (var message in messageList)
{
    var pduBuilder = SMS.ForSubmit()
                    .From(_config.ShortCode)
                    .To(message.PhoneNumber)
                    .Text(message.Text);
 
    foreach (var pdu in pduBuilder.Create(_client))
    {
        _client.SubmitAsync(pdu);
        _repository.StoreSequenceNumber(message.Id, pdu.Sequence);
    }
}

How to create SubmitMulti PDUs for multiply receivers

var pduBuilder = SMS.ForSubmitMulti()
                 .From(_config.ShortCode)
                 .Text(message.Text);
 
foreach (string phoneNumber in message.PhoneNumbers) {
   pduBuilder.To(phoneNumber);
}
 
IList<SubmitMulti> pduList = pduBuilder.Create(_client);

Page Tools