@leissner/node-red-smpp 1.1.2
Node-RED nodes for sending and receiving SMS via SMPP, wrapping the smpp package.
@leissner/node-red-smpp
Node-RED nodes for sending and receiving SMS via SMPP, built on top of the smpp npm package.
Nodes
- smpp-config — shared connection/bind configuration (host, credentials, bind mode, TLS). Manages the underlying SMPP session, including automatic reconnect with backoff.
- smpp-out — submits an SMS (
submit_sm) to the bound SMSC. - smpp-in — receives inbound messages and delivery receipts (
deliver_sm) from the bound SMSC.
Install
Via the Node-RED editor's Palette Manager, or from the command line in your Node-RED user directory (typically ~/.node-red):
npm install @leissner/node-red-smpp
smpp-config
Holds the connection details for one bound SMPP session, shared by any number of smpp-in/smpp-out nodes. Configure url (e.g. smpp://host:2775, or ssmpp://host:3550 for TLS), system_id, password, and bind_mode (transceiver/transmitter/receiver). Advanced options include addr_ton/addr_npi/address_range (only needed if your SMSC provider tells you to set them), enquire_link interval, connect timeout, and TLS settings for ssmpp://.
The connection is established lazily on deploy (when the first smpp-in/smpp-out node using it starts) and torn down when the last one is removed. On disconnect, it retries with capped exponential backoff (1s → 2s → 5s → 10s → 30s, then holds).
smpp-out
Sends msg.payload as an SMS.
- Destination — set on the node, or leave blank to use
msg.destination. - Source — set on the node, or leave blank to use
msg.source. - Encoding —
Auto-detect(default),ASCII(GSM 03.38),LATIN1, orUCS2. Can be overridden per-message withmsg.encoding(same values, case-insensitive). If the payload contains characters the chosen encoding can't represent, a warning is logged and the unrepresentable characters are substituted or dropped by the underlying library — switch toautoorUCS2if you need those characters preserved. - Message class — optional, under Advanced.
0marks the message as Flash (most handsets display it immediately without storing it);1-3are the less commonly used ME/SIM/TE-specific classes. Can be overridden per-message withmsg.class(0-3). Only supported with GSM 7-bit or UCS2 — combined with LATIN1, a warning is logged and the message is sent without a class marking. Withautoencoding, GSM 7-bit or UCS2 is chosen automatically based on the message content, same as normal auto-detection. msg.payloadthat isn't already a string or Buffer is converted: plain objects are JSON-stringified, other types are coerced withString().- On success,
msg.payloadis replaced with the SMSC'smessage_id, and the full response PDU is attached atmsg.smpp_response.
Note on LATIN1: only data_coding 0x00 (GSM 7-bit) and 0x08 (UCS2) are universally honored by SMSCs and handsets. LATIN1 (0x03) is valid per the SMPP spec but has been observed to be silently misinterpreted as GSM 7-bit by some SMSCs — test against your specific SMSC before relying on it for anything outside the base GSM alphabet.
smpp-in
Emits a message for each inbound deliver_sm PDU. Configure whether to receive all messages, MO (mobile-originated) only, or delivery receipts only, and whether delivery receipt text is parsed into a structured msg.payload (id, sub, dlvrd, submit_date, done_date, stat, err, text) or left as raw text.
Auto-acknowledges each received PDU by default (required by the SMPP spec) — only disable this if your flow explicitly sends the response itself via msg.smpp_pdu.response().
Examples
Three example flows are included — in the Node-RED editor, use Import → Examples → node-red-smpp (or @leissner/node-red-smpp, depending on your Node-RED version):
- Send SMS — the minimal flow: an inject node with a test message and destination number, wired to
smpp-out, with a debug node showing the returnedmessage_id. - Send flash SMS — the same shape, but the inject node also sets
msg.class = 0, demonstrating Flash SMS. - Receive SMS —
smpp-inwired to a switch node that splits inbound traffic onmsg.smpp_is_delivery_receipt, routing mobile-originated messages and (parsed) delivery receipts to separate debug nodes.
All examples ship with a placeholder smpp-config node (smpp://your-smsc-host:2775, system_id: your_system_id) — edit it with your real SMSC details and set a password after importing, before deploying.
License
MIT