SMPP Gateway
Protocol Reference SMPP 3.4 PDU types, encoding, TON/NPI values, TLVs, and throughput limits.
PDU Direction Purpose bind_transceiverClient → Server Open a TRX session (send + receive) bind_transmitterClient → Server Open a TX-only session bind_receiverClient → Server Open an RX-only session bind_*_respServer → Client Bind acknowledgement unbindEither Request graceful disconnect unbind_respEither Unbind acknowledgement
PDU Direction Purpose submit_smClient → Server Submit a message for delivery submit_sm_respServer → Client Submission acknowledgement + message_id deliver_smServer → Client Inbound MO message or DLR callback deliver_sm_respClient → Server Must acknowledge every deliver_smquery_smClient → Server Query current status of a submitted message query_sm_respServer → Client Status + final date
PDU Direction Purpose enquire_linkEither Keepalive probe enquire_link_respEither Keepalive acknowledgement generic_nackEither Reject a PDU with an unrecognised command_id
submit_multi is not currently supported. For bulk delivery, parallelise submit_sm across multiple binds.
data_codingEncoding Max chars / segment Notes 0x00GSM-7 160 Default for Latin-script messages 0x03Latin-1 (ISO-8859-1) 160 Western European characters 0x08UCS-2 (UTF-16 BE) 70 Unicode - Arabic, Amharic, CJK, emoji 0x04Binary (8-bit) 140 bytes Raw binary payloads 0xF5Flash / Binary Class 0 140 bytes Displayed immediately, not stored
Messages exceeding the per-segment character limit are split into parts. Signal multi-part structure by setting esm_class=0x40 (UDH indicator) and prepending a User Data Header to each part.
Most libraries (smpplib, node-smpp) handle UDH splitting automatically when you call their make_parts/split helpers.
Alternatively, use the sar_msg_ref_num, sar_total_segments, and sar_segment_seqnum optional TLVs instead of UDH headers - set esm_class=0x00 in this case.
Type of Number (TON)
Value Constant Use for 0UNKNOWN When TON is not known 1INTERNATIONAL E.164 numbers (+254...) 2NATIONAL National format numbers 5ALPHANUMERIC Text sender IDs (eSMSCo) 6ABBREVIATED Short codes
Numbering Plan Indicator (NPI)
Value Constant Use for 0UNKNOWN Use with alphanumeric source addresses 1ISDN (E.163/E.164) Standard phone numbers
Recommended values:
Alphanumeric sender: source_addr_ton=5, source_addr_npi=0
E.164 sender: source_addr_ton=1, source_addr_npi=1
E.164 destination: dest_addr_ton=1, dest_addr_npi=1
Field Type Notes service_typestring Leave empty ("") source_addr_tonbyte See TON table above source_addr_npibyte See NPI table above source_addrstring Your approved sender ID dest_addr_tonbyte 1 (international)dest_addr_npibyte 1 (ISDN)destination_addrstring E.164 format: +254712345678 esm_classbyte 0x00 default; 0x40 if using UDHprotocol_idbyte 0x00priority_flagbyte 0x01 (normal)registered_deliverybyte 0x01 to request DLR; 0x00 for no DLRdata_codingbyte Encoding - see table above short_messagebytes Message body, encoded per data_coding
Byte Meaning 0x00No delivery receipt 0x01Receipt on final delivery (delivered or failed) 0x02Receipt on delivery failure only 0x03Receipt on successful delivery only
Parameter Default Maximum Submit throughput 100 msg/s per bind 5,000 msg/s (on request) Enquire_link interval 30 s - Bind timeout 30 s - Concurrent binds 3 Configurable per system_id Max message size 254 bytes (GSM-7) -
Higher throughput and concurrency limits can be negotiated. Contact noc@esmsafrica.io with your expected peak TPS.
TLV Tag Name Purpose 0x020Csar_msg_ref_numReference number for SAR concatenation 0x020Esar_total_segmentsTotal number of SAR segments 0x020Fsar_segment_seqnumThis segment's sequence number 0x0204user_message_referenceClient-assigned message reference 0x0005dest_addr_subunitFlash message delivery (Class 0)
Hex Name Cause 0x00000000ESME_ROK Success 0x00000001ESME_RINVMSGLEN Message too long 0x00000002ESME_RINVCMDLEN PDU length field incorrect 0x00000005ESME_RINVDSTADR Invalid destination address 0x0000000AESME_RINVSRCADR Invalid source address (unapproved sender ID) 0x0000000BESME_RINVDSTADR Destination address not reachable on any route 0x0000000EESME_RBINDFAIL Bind failed - check system_id and password 0x0000000DESME_RINVPASWD Invalid password 0x00000058ESME_RTHROTTLED Throughput limit exceeded 0x000000FFESME_RUNKNOWNERR Unspecified error - contact support
See Troubleshooting for solutions to common errors.