Table of Contents

Migration from v1.x to 2.x

How to solve some compile issues:

SmppClient

  1. The events evBindComplete, evSubmitComplete, evQueryComplete have been deprecated. You should use async await pattern with the methods BindAsync, SubmitAsync, QueryAsync.
public async Task SubmitBatchAsync(List<SubmitSm> batch)
{
    IEnumerable<SubmitSmResp> responses = await _client.SubmitAsync(batch).ConfigureAwait(false);
}

or handle the response with ContinueWith

_client.SubmitAsync(submitSm).ContinueWith(t =>
{

    if (t.IsFaulted)
    {
        var error = t.Exception;
    }
    else
    {
        //get SUBMIT_SM_RESP    
        SubmitSmResp resp = t.Result;

    }

});
  1. Missing BatchMonitor class. Use instead SubmitAsync(IEnumerable<SubmitSm>). It waits until all responses for the batch are received.
Tip

Awaiting for each single SubmtiSmResp can reduce the performance. You can create a batch of SubmitSm PDUs and send all of them with one SubmitAsync(IEnumerable<SubmitSm>) call.

  1. _client.AddressRange, _client.AddrNpi and _client.AddrTon must be specified as
_client.EsmeAddress = new SmeAddress(AddressRange, AddrTon, AddrNpi);
  1. Sequence number and Command Status are moved to Header property of the PDU.
  • data.Status replaced with data.Header.Status,
  • data.Sequence replaced with data.Header.Sequence
  1. client.GetMessageText is moved to client.EncodingMapper.GetMessageText

  2. PDU Properties

  1. Property MessageText in SubmitSm, SubmitMulti, DeliverSm, DataSm, ReplaceSm classes is deprecated. Use the method pdu.GetMessageText(client.EncodingMapper).

  2. Method SmppClientBase.MapEncoding moved to SmppClientBase.EncodingMapper.MapEncoding

SmppServer

  1. Namespace for SmppServerClient class changed to Inetlab.SMPP.

  2. IPEndPoint of the server must be specified in SmppServer constructor, instead of Start method of this class.

Serialization

Method submitSm.Serialize can be replaced with extension method:

byte[] pduData = submitSm.Serialize(_client.EncodingMapper);

Static method SubmitSm.Deserialize can be replaced with code:

byte[] pduData = ReadFromDataReader();

SubmitSm submitSm = pduData.Deserialize<SubmitSm>(_client.EncodingMapper);