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 synchronized with application's main thread. That is why it is referred 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 = 1000;

// [...]

private void clientSMPP_OnSmppTraceProtocol(object Sender,
  smppTraceProtocolCallbackArgs e)
  if (String.Equals(e.ToAddress, "") &&
    (e.CommandID < 0x80000000))
    e.SequenceNumber = MySequenceNumber++;

See Also

OnSmppTraceProtocol, OnUcpTraceProtocol