eSMS AfricaeSMS Africa
SMPP Gateway

Protocol Reference

SMPP 3.4 PDU types, encoding, TON/NPI values, TLVs, and throughput limits.

PDU types

Bind PDUs

PDUDirectionPurpose
bind_transceiverClient → ServerOpen a TRX session (send + receive)
bind_transmitterClient → ServerOpen a TX-only session
bind_receiverClient → ServerOpen an RX-only session
bind_*_respServer → ClientBind acknowledgement
unbindEitherRequest graceful disconnect
unbind_respEitherUnbind acknowledgement

Message PDUs

PDUDirectionPurpose
submit_smClient → ServerSubmit a message for delivery
submit_sm_respServer → ClientSubmission acknowledgement + message_id
deliver_smServer → ClientInbound MO message or DLR callback
deliver_sm_respClient → ServerMust acknowledge every deliver_sm
query_smClient → ServerQuery current status of a submitted message
query_sm_respServer → ClientStatus + final date

Session PDUs

PDUDirectionPurpose
enquire_linkEitherKeepalive probe
enquire_link_respEitherKeepalive acknowledgement
generic_nackEitherReject a PDU with an unrecognised command_id

submit_multi is not currently supported. For bulk delivery, parallelise submit_sm across multiple binds.


Encoding (data_coding)

data_codingEncodingMax chars / segmentNotes
0x00GSM-7160Default for Latin-script messages
0x03Latin-1 (ISO-8859-1)160Western European characters
0x08UCS-2 (UTF-16 BE)70Unicode - Arabic, Amharic, CJK, emoji
0x04Binary (8-bit)140 bytesRaw binary payloads
0xF5Flash / Binary Class 0140 bytesDisplayed immediately, not stored

Long messages (UDH)

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.


TON and NPI values

Type of Number (TON)

ValueConstantUse for
0UNKNOWNWhen TON is not known
1INTERNATIONALE.164 numbers (+254...)
2NATIONALNational format numbers
5ALPHANUMERICText sender IDs (eSMSCo)
6ABBREVIATEDShort codes

Numbering Plan Indicator (NPI)

ValueConstantUse for
0UNKNOWNUse 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

submit_sm fields reference

FieldTypeNotes
service_typestringLeave empty ("")
source_addr_tonbyteSee TON table above
source_addr_npibyteSee NPI table above
source_addrstringYour approved sender ID
dest_addr_tonbyte1 (international)
dest_addr_npibyte1 (ISDN)
destination_addrstringE.164 format: +254712345678
esm_classbyte0x00 default; 0x40 if using UDH
protocol_idbyte0x00
priority_flagbyte0x01 (normal)
registered_deliverybyte0x01 to request DLR; 0x00 for no DLR
data_codingbyteEncoding - see table above
short_messagebytesMessage body, encoded per data_coding

registered_delivery flags

ByteMeaning
0x00No delivery receipt
0x01Receipt on final delivery (delivered or failed)
0x02Receipt on delivery failure only
0x03Receipt on successful delivery only

Throughput and connection limits

ParameterDefaultMaximum
Submit throughput100 msg/s per bind5,000 msg/s (on request)
Enquire_link interval30 s-
Bind timeout30 s-
Concurrent binds3Configurable per system_id
Max message size254 bytes (GSM-7)-

Higher throughput and concurrency limits can be negotiated. Contact noc@esmsafrica.io with your expected peak TPS.


Optional TLVs supported

TLV TagNamePurpose
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)

Error codes (command_status)

HexNameCause
0x00000000ESME_ROKSuccess
0x00000001ESME_RINVMSGLENMessage too long
0x00000002ESME_RINVCMDLENPDU length field incorrect
0x00000005ESME_RINVDSTADRInvalid destination address
0x0000000AESME_RINVSRCADRInvalid source address (unapproved sender ID)
0x0000000BESME_RINVDSTADRDestination address not reachable on any route
0x0000000EESME_RBINDFAILBind failed - check system_id and password
0x0000000DESME_RINVPASWDInvalid password
0x00000058ESME_RTHROTTLEDThroughput limit exceeded
0x000000FFESME_RUNKNOWNERRUnspecified error - contact support

See Troubleshooting for solutions to common errors.

On this page