/server

Tracking & Modification

TraceProtocol callback

TraceProtocol callback can be used for tracking & modification of every single protocol message (PDU, Protocol Data Unit) that is exchanged between the SMSC and the library.

TraceProtocol callback, unlike all other events published by the library is not synchronised with application's main thread. That is why it is refered as callback not as event. This means that code of the event cannot modify user interface controls directly. It can however be used to log trace information and perform all other tasks that do not need to be synchronized with application's main thread.

Example below demonstrates setting sequence_number of SMPP protocol frame for each message outgoing component, without disturbing responses to messages sent by SMSC:


uint MySequenceNumber = 2000;

// [...]

private void serverSMPP_OnSmppTraceProtocol(object Sender,
  smppTraceProtocolCallbackArgs e)
{
  if (String.Equals(e.FromAddress, "192.168.1.1:2345") &&
    (e.CommandID < 0x80000000))
  {
      e.SequenceNumber = MySequenceNumber++;
  }
}

See Also

OnSmppTraceProtocol, OnUcpTraceProtocol