User Tools

Site Tools

SMPP Gateway

When you resell SMPP traffic you need to implement SMPP Gateway or Proxy.

To do this you need to use SmppServer class in order to start listening for SMPP commands on TCP port and several SmppClient instances to send message to another SMPP servers (SMSC, Provider).

When you send SubmitSmResp to the client you should assign own MessageId. Later when you forward this message to another server you will receive another MessageId from SMSC . This SMSC MessageId should be also replaced in DeliverSm (delivery receipt) for the target client.

You can build any routing. F.i. when you are going to forward SMS message you can estimate which connection with SMSC (SmppClient) accept destination phone number and which costs cheaper. Sure when all this information is know to your application.

When you need only forward SubmitSm messages I suggest following steps:

  1. Receive SubmitSm from client.
    1. Save client's sequence number to the database. Possible good idea to save entire PDU.
    2. Send SubmitSmResp with client's sequence number and MessageId generated on your server side.
  2. In another process/thread send this SubmitSm PDU to another SMPP provider.
    1. Change SubmitSm sequence number to the next sequence number for the SmppClient that connected to that SMPP provider.
    2. Receive Provider's MessageId in SubmitSmResp
    3. Store Provider's MessageId and sequence number to the same database table as for client's sequence number.

These four values:

  1. Client's sequence number
  2. Client's MessageId
  3. Provider's sequence number
  4. Provider's MessageId

help later to find corresponding client that should receive delivery receipt from provider.

When DeliverSm comes from provider and contains delivery receipt following steps should be done:

  1. Get Provider's MessageId from delivery receipt.
  2. Find client's MessageId and corresponding SMPP user.
  3. Replace Provider's MessageId in DeliverSm PDU with client's MessageId and send delivery receipt to the SmppServerClient that belongs to SMPP user.
  4. If there is no active connection with the client, place DelivetSm PDU to the outgoing persistent queue (another database table).

Page Tools