Table of Contents

Receive messages

To receive messages it is necessary to create an event handler for evClientSubmitSm event. The evClientSubmitSm event is raised each time packet with SubmitSm command arrives. The remote SMPP-client uses this command to send SMS to SMPP-server (SMS Center).

_server.evClientSubmitSm += (sender, client, submitSm) =>
{
    // process SubmitSm PDU here
};

Even with an empty event handler attached, the SmppServerClient will automatically generate SubmitSmResp packet and put the ESME_ROK status in submitSm.Response field. In addition, the unique identifier “MessageId” for each message/part received will be created and placed into response packet. The event handler allows you to change submitSm.Response.MessageId or any other property of SubmitSmResp object.

submitSm.Response.MessageId = "myUnuqueID";

If there is no event handler attached to evClientSubmitSm event, the server sends to client the response SubmitSmResp containing status ESME_RSUBMITFAIL.

It is common to implement various rules for inbound messages (such as processing, saving, sending, storing, parts collecting, etc.) inside the event handler attached to evClientSubmitSm event.