mirzoev.cv — home
Telecom · Backend

SMPP / USSD Gateway

A transport layer for short-code services: a Go service keeps SMPP connections to operators, while business logic stays in Node.js and talks to it over gRPC.

Category
Telecom · Backend
Stack
Go · gRPC · SMPP · Redis · Node.js

The problem

  • Business logic for short-code services (subscriptions, quizzes, notifications) is written in Node.js and has to be decoupled from SMS transport.
  • The system needs long-lived SMPP connections to several operators, automatic reconnects, and intake of inbound messages and delivery reports.
  • The architecture must allow new capabilities — USSD menus first of all — without rewriting the logic.

The solution

  • A Go service with a gRPC interface; its clients are Node.js services running on the same or on other servers.
  • An account is an SMPP connection bound to a short code. The short code selects the account, and accounts can belong to different operators.
  • A pool of long-lived connections with automatic reconnects.
  • Batch sending: a batch is acknowledged on intake and then sent. NORMAL and FAST modes: FAST pre-empts a running NORMAL campaign.
  • Delivery reports (DLR) and inbound SMS (MO) are published to Redis separately, tagged with the short code.
  • An Admin API for account management, plus metrics; TPS and inflight limits are configurable.
  • The USSD gateway is being designed on top of the SMPP gateway: the gateway handles transport only, while menu logic lives in Node.js; menus are defined as configuration, each item mapped to a function ID.

Architecture

SMS: sending, DLR and inbound
SMS: sending, DLR and inboundA Node.js service sends an SMS or a batch to the SMS Service over gRPC. The short code selects the SMPP account; the message goes to the operator SMSC over a long-lived connection. Delivery reports (DLR) and inbound SMS (MO) come back over the same connection. The service publishes DLR and MO to Redis separately, tagged with the short code; Node.js services consume them from there.gRPCSMPPDLR / MONode.js servicesbusiness logicSMS ServiceGo · gRPCSMPP poolaccount = short codeOperator SMSCRedisDLR and MO, separate
Data flow, step by step
  1. A Node.js service sends an SMS or a batch to the SMS Service over gRPC.
  2. The short code selects the SMPP account; the message goes to the operator SMSC over a long-lived connection.
  3. Delivery reports (DLR) and inbound SMS (MO) come back over the same connection.
  4. The service publishes DLR and MO to Redis separately, tagged with the short code; Node.js services consume them from there.
USSD (in design)
USSD (in design)A subscriber dials a USSD code; the operator forwards the request to the USSD Gateway. The gateway hands the request to the Node.js menu logic without making decisions itself. The logic resolves the menu item to a function via configuration and returns the reply through the gateway.SMPPgRPCSubscriberUSSD requestOperator USSD centreUSSD Gatewaytransport onlyMenu logicNode.js
Data flow, step by step
  1. A subscriber dials a USSD code; the operator forwards the request to the USSD Gateway.
  2. The gateway hands the request to the Node.js menu logic without making decisions itself.
  3. The logic resolves the menu item to a function via configuration and returns the reply through the gateway.
  • Transport is separated from logic: Node.js services know nothing about SMPP, and the gateway knows nothing about business rules.
  • Using the short code as the routing key lets one service hold accounts of different operators.
  • Redis as an event buffer decouples DLR/MO intake from processing.

Technology stack

  • GoSMPP transport and connection pool
  • gRPCinterface for Node.js services
  • SMPPprotocol for operator SMSCs
  • Redisdelivering DLR and MO to consumers
  • Node.jsbusiness logic and USSD menu logic
← All projects

Need a similar system?
Let’s discuss your project.