BitsPath Voice
Carrier-grade PBX / pure Rust

The PBX rewritten
so it never has to reboot.

BitsPath Voice is what happens when you delete FreeSWITCH and rebuild an enterprise PBX in Rust, end to end. SIP over UDP, TCP, TLS, and WebSocket. RTP and SRTP media with NAT latching. A B2BUA call engine. A SIGTRAN SS7 stack so a SIP message can land on a GSM phone. About 517,000 lines, 10 crates, no garbage collector, no segfaults.

517K
Lines of Rust
10
Cargo crates
~1,000
Concurrent calls / node
sip-trace·crates/bitspath-sip
pcap / live
UAC alice
··· transport ···
UAS b2bua
  1. REGISTERsip:alice@bitspath; UDP transport
  2. SIP/2.0 401 UnauthorizedWWW-Authenticate: Digest realm=…
  3. REGISTERAuthorization: Digest response=…
  4. SIP/2.0 200 OKContact bound -> LocationService
  5. INVITEsip:bob@bitspath; SDP offer (PCMU/PCMA/G722)
  6. SIP/2.0 100 TryingServer transaction created
  7. SIP/2.0 180 RingingB2BUA dispatched outbound leg
  8. SIP/2.0 200 OKSDP answer; MediaBridge allocated
  9. ACKDialog confirmed; RTP latching
  10. BYECDR finalised; sweep at 30s
Transport
UDP / TCP / TLS / WS
Auth
Digest MD5 / SHA-256
Media
RTP / SRTP (zero-copy)

A real call leg: REGISTER + 401 challenge + REGISTER with digest, then INVITE + 100 + 180 + 200 + ACK + BYE. Every state machine in this trace is implemented in crates/bitspath-sip/src/transaction/.

What is BitsPath Voice

A pure-Rust telephony engine, headless by design.

BitsPath Voice is the carrier-grade PBX engine sitting underneath theBitsPathunified-comms platform. It is the voice plane. Two binaries ship: an Axum REST API for management on port 8080, and a standalone SIP server that holds the 5060 / 5061 / 5066 listeners on host networking.

The workspace is around 517,000 lines of Rust across 10 crates. SIP signalling and RTP media are first-party, not third-party. So is the SIGTRAN stack that lets a SIP MESSAGE become a MAP MT-ForwardSM into a GSM core. FreeSWITCH has been fully removed; the design goal is years of uptime without a process restart.

The management UI lives in the BitsPath portal at bitspath.com/voice. The Voice API itself is reached over a YARP reverse proxy at /api/voice/*.

Built onPure Rust 2024Axum 0.8 + TokioPostgreSQL 18 + SQLx 0.8rustls 0.23FreeSWITCH removed

Workspace layout

Ten crates. Four for SIP, four for SS7, two binaries on top.

The cargo workspace splits along protocol layer rather than feature. That is how a stack you intend to run for years stays modifiable. The SIP plane lives independently of the SIGTRAN plane, and the B2BUA call engine sits above both.

10 Cargo crates, pure Rust, production workspace
CrateSize
bitspath-sip
RFC 3261 parser (nom), 4 transports (UDP/TCP/TLS/WS), transactions, SDP, digest auth, DNS SRV
~3.5K
bitspath-pbx
Registrar, dialplan router, trunks, forwarding (5 types), hold, REFER transfer, ring groups, IVR
~6.6K
bitspath-media
RTP/RTCP, SRTP (AES-128-CM + HMAC-SHA1-80), G.711 µ/A, G.722, DTMF, jitter buffer, PLC, conference mixer
~3.0K
bitspath-call
B2BUA core, call state machine, media bridge with NAT latching, IVR sessions, voicemail, retransmission, rate limiting
~7.0K
bitspath-sctp
SCTP user-space stack for SIGTRAN underlay; RFC 4960
bitspath-m3ua
MTP3 User Adaptation layer over SCTP; ASP state machines
bitspath-sccp
Signalling Connection Control Part; GTT routing for cellular signalling
bitspath-tcap
Transaction Capabilities Application Part; component sublayer for MAP dialogs
bitspath-map
Mobile Application Part; HLR queries and MT SMS submission to GSM cores
bitspath-smsgw
SMS Gateway binary — SIP MESSAGE bridged to cellular MT-SMS via the SIGTRAN stack

Wire-level support

Every RFC 3261 transport. The codecs you can actually use in production.

The SIP server speaks the four standard transports. Outbound INVITEs use a conservative SDP profile so hardware phones do not respond 415 and softphones do not negotiate themselves into mismatch.

Transports
  • UDP:5060Default RFC 3261 transport, retransmission per §17.1.1
  • TCP:5060Connection pool plus RFC 4475 framing
  • TLS:5061rustls 0.23 + ring; cert and key configurable
  • WS:5066SIP-over-WebSocket, RFC 7118; browser softphones
Codecs
  • G.711 µ-law
    Default for narrowband PSTN trunks
    PT 08 kHz
  • G.711 A-law
    Default for EU PSTN trunks
    PT 88 kHz
  • G.722
    Wideband HD voice for IP-to-IP
    PT 916 kHz
  • RFC 2833 DTMF
    Tone events out-of-stream
    tel-eventin-band

Engine internals

Four things that are unusual for a PBX, all shipped first-party.

These are not modules bolted on after launch. Each one ships in the same cargo workspace as the SIP parser. The B2BUA, the zero-copy media relay, the auth chain, and the SS7 SMS gateway are the project, not extensions to it.

~1,000
Concurrent calls per node, observed
<50ms
SIP transaction internal latency
<20ms
Media one-way relay overhead
10K
RTP port range (10000-20000)

Standalone SIP server

A second binary (sip_server) speaks SIP on host network across UDP, TCP, TLS, and WebSocket. The Axum API stays on :8080 for management; the SIP plane is independent.

Zero-copy RTP relay

Media bridge does not decode and re-encode. RTP packets are forwarded with NAT latching, codec is negotiated by SDP, and CPU stays low even at four-digit concurrent calls.

Wenme OAuth + Darwan RBAC

Management API authenticates via Wenme OAuth 2.1 with PKCE and JWKS. Every action is gated by Darwan with 62 pbx.* permissions. No bespoke auth code in the PBX.

SIGTRAN SMS pathway

Five crates implement the SS7 stack so a SIP MESSAGE can be submitted as a MAP MT-ForwardSM into a GSM core. The standalone smsgw binary brokers the gateway role.

Compared honestly

vs FreeSWITCH, Asterisk, Kamailio, and Twilio Voice.

Each of these is the right answer for somebody. The honest comparison is between an operator who wants to run their own PBX without daily process restarts, without GPL exposure, and without per-minute bills.

Capability
BitsPath VoiceBitsPath Voice
FreeSWITCH
Asterisk
Kamailio
Twilio Voice
Implementation languagePure Rust 2024CCCClosed cloud
Memory-safe by constructionn/a
Multi-tenant by designRLS on 35+ tablesCustomPer-acct
B2BUA out of the boxModuleDialplan hack
SS7 / SIGTRAN SMS bridgeSCTP/M3UA/SCCP/TCAP/MAPss7liteAcct only
SRTP with key exchangeSDES (DTLS-SRTP wip)Proxy
WebSocket transport (RFC 7118)
Licence cost at scaleMITMPL 2.0GPL v2GPL v2Per-min
Restart-free uptime targetYears (no GC, no leaks)Days-weeksDays-weeksWeeksn/a

Kamailio remains an excellent SIP proxy in front of any of these. The BitsPath Voice answer is to ship a B2BUA, registrar, media bridge, and SS7 SMS gateway in one cargo workspace without giving up memory safety.

The shipped reality

Production code. Not a roadmap deck.

BitsPath Voice runs in production at voice.bitspath.com. The SIP server holds the listeners on host networking, the Axum API lives in a container, PostgreSQL 18 carries the schema, and the BitsPath portal is the UI.

Auth chain

Wenme OAuth 2.1 with PKCE and JWKS validates the session cookie. Darwan answers 62 pbx.* permissions through a 60 second TTL cache with webhook invalidation.

Media security

SRTP via AES-128-CM and HMAC-SHA1-80, SDES key exchange per RFC 4568. DTLS certificate generation in place; DTLS-SRTP handshake being completed for WebRTC peers.

Multi-tenancy

Every API query filters by domain_uuid. PostgreSQL row-level security is applied to 35 plus tables. Tenants share the cluster but never the row scope.

Observability

Prometheus metrics on :9090 for transactions, calls, ratelimits, and cache. Active registrations and active calls sync to PostgreSQL every 5 to 10 seconds for API visibility.

~517K
Lines of Rust, workspace total
10
Crates in cargo workspace
255+
REST endpoints (Axum 0.8)
1,038+
Unit tests across the stack
Built from

Rust 2024 edition. Axum 0.8 with macros, multipart, and ws. Tokio 1 full. SQLx 0.8 against PostgreSQL 18 with runtime queries. lapin 4 for RabbitMQ. rustls 0.23 with ring. jsonwebtoken 10 with aws_lc_rs. Release profile: opt-level 3, LTO, codegen-units 1, panic abort.

$ cargo build --release
Compiling bitspath-sip v0.1.0
Compiling bitspath-media v0.1.0
Compiling bitspath-call v0.1.0
Compiling bitspath-pbx v0.1.0
Finished `release` profile [optimized] target(s)

Frequently asked

Six questions buyers and operators actually ask.

Answers are mirrored to JSON-LD so they are quotable by AI answer engines and search.

What is BitsPath Voice?

BitsPath Voice is a carrier-grade multi-tenant PBX written end-to-end in pure Rust. Two binaries ship: a REST management API on Axum 0.8 and a standalone SIP server speaking SIP RFC 3261 over UDP, TCP, TLS, and WebSocket. The workspace totals around 517,000 lines of Rust across 10 crates that cover SIP signalling, RTP and SRTP media, a B2BUA call engine, and a full SIGTRAN SS7 stack (SCTP, M3UA, SCCP, TCAP, MAP) for bridging SIP to cellular SMS.

Does BitsPath Voice support SIP trunking and standard SIP devices?

Yes. The bitspath-sip crate implements a nom-based RFC 3261 parser, full transaction state machines, SDP offer/answer, digest authentication (MD5 and SHA-256), and RFC 3263 DNS SRV resolution. Outbound trunks, inbound DID routing, and standard hard phones and softphones interoperate. The standardised SDP profile (G.711 µ/A-law and G.722) is used for outbound INVITEs to avoid 415 rejections on hardware phones.

What is the concurrent-call ceiling?

Observed throughput on a single node sits at approximately 1,000 concurrent calls. The bottleneck is bandwidth and RTP port allocation (the default range is 10,000 to 20,000), not signalling. Zero-copy RTP relay keeps CPU low because media is forwarded without decode and re-encode whenever both legs negotiate the same codec.

How does BitsPath Voice compare to FreeSWITCH, Asterisk, or Kamailio?

FreeSWITCH and Asterisk are mature C codebases that ship more PBX features out of the box but carry the operational cost of manual memory management and GPL or MPL licensing. Kamailio is a SIP proxy, not a B2BUA. BitsPath Voice is memory-safe by construction, multi-tenant by design with PostgreSQL row-level security, MIT licensed, and ships a B2BUA call engine and SS7 SMS bridge as first-party crates rather than third-party modules.

Is media secured? What codecs and SRTP modes are supported?

Audio codecs are G.711 µ-law (PT 0), G.711 A-law (PT 8), and G.722 wideband (PT 9), plus RFC 2833 telephone-event for DTMF. SRTP is implemented with AES-128-CM and HMAC-SHA1-80 and SDES key exchange (RFC 4568). DTLS certificate generation is in place; the DTLS-SRTP handshake is being completed for browser interoperability with WebRTC peers.

Why is there a full SS7 stack inside a PBX?

Because BitsPath Voice runs an SMS gateway role. The bitspath-smsgw binary accepts a SIP MESSAGE from the IP side and submits it as a MAP MT-ForwardSM into a GSM core. To do that natively without a vendor SMSC, the workspace ships SCTP (RFC 4960) as the transport, M3UA on top, SCCP for routing, TCAP for transactions, and MAP for the cellular application layer. This is unusual outside of carrier-grade equipment.

BitsPath Voice / production

Put the PBX
in the language that does not leak.

Two binaries. Ten crates. Full SIP plane, full media plane, full SIGTRAN plane. Built to run for years without a restart, with every action gated by Darwan and every session issued by Wenme.

On the wire, right now
  • Pure Rust SIP / RTP / SRTP stack, no C dependencies in the app layer
  • B2BUA call engine with zero-copy media relay and NAT latching
  • SIGTRAN stack (SCTP / M3UA / SCCP / TCAP / MAP) for cellular SMS
  • Multi-tenant by row-level security on 35 plus PostgreSQL tables
  • Wenme OAuth 2.1 plus Darwan RBAC with 62 pbx.* permissions