smpp34
A pure-Rust implementation of the SMPP 3.4 protocol (Short Message Peer-to-Peer): a PDU codec plus an asynchronous (tokio) client and server built on a listener-trait model.
- Client — bind to an SMSC as an ESME (transmitter, receiver or
transceiver), send
submit_sm/data_sm, and receivedeliver_smand session events through your ownSmppClientListener. - Server — accept ESME binds and dispatch
submit_sm,data_sm,cancel_sm, … to yourSmppServerListener; push MT traffic back out withdeliver_sm. - Codec — encode/decode every SMPP 3.4 PDU, including optional TLV parameters.
Sessions handle the SMPP timers (session_init, enquire_link, inactivity,
response), sequence-number windowing, and optional TLS.
Supported PDUs
bind_transmitter · bind_receiver · bind_transceiver (+ resps) · outbind
· unbind · enquire_link · submit_sm · submit_sm_multi · deliver_sm ·
data_sm · query_sm · cancel_sm · replace_sm · alert_notification ·
generic_nack, plus arbitrary TLV (optional parameter) encode/decode.
Install
Quick start — server
Implement SmppServerListener and hand it to an SmppServer. (The trait has
one method per inbound PDU; the snippet below shows the common ones — see the
crate docs for the full set.)
use Arc;
use ;
use async_trait;
use ;
;
async
Quick start — client
Bind to an SMSC, then submit once the bind completes (the on_smsc_bound
callback hands you an SMSC you can submit through).
use Arc;
use ;
// `listener` implements SmppClientListener; its on_smsc_bound callback hands
// you the bound `SMSC` handle to submit through.
let listener = new;
let mut client = new;
client.start.await;
// inside on_smsc_bound(smsc, _):
// smsc.send_submit_sm("", 1, 1, "12345".into(), 1, 1, "31600000000".into(),
// 0, 0, 0, "".into(), "".into(), 0, 0, 0, 0,
// b"hello".to_vec()).await?;
TLS
Pass tls = true to SmppClient::new to bind over TLS. The TLS transport is
backed by tokio-native-tls
(system OpenSSL).
Timers & windowing
SmppServer::new / SmppClient::new use sensible default timers. Use the
*_with_default_timers constructors to set session_init, enquire_link,
inactivity and response timers (milliseconds) and the buffer / window size
explicitly.
MSRV
Rust 1.80.
Stability
The SMPP 3.4 codec and the client/server session handling are used in
production. Until a 1.0 release the public API may still see ergonomic
refinement — pin a minor version if you need stability across 0.x bumps. See
VERSIONING.md.
License
MIT © Real Time Telecom B.V.
Maintained by Real Time Telecom B.V. — carrier-grade telecom infrastructure in Rust.