Skip to content
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 with WebRTC bridged through implemented ICE and DTLS-SRTP. A SIGTRAN SS7 stack so a SIP message can land on a GSM phone. About 120,000 lines, 1,561 tests, no garbage collector, no segfaults.

120K+
Lines of Rust
225
REST endpoints
1,561
Test functions
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. Three binaries ship: an Axum REST API for management on port 8080 (225 endpoints across 38 handler modules), a standalone SIP server that holds the 5060 / 5061 / 5066 listeners on host networking, and a standalone SMS gateway.

The workspace is 120,209 lines of Rust across 10 crates plus the API server, with 1,561 test functions. SIP signalling and RTP media are first-party, not third-party. So are the WebRTC bridge (str0m, with ICE and DTLS-SRTP implemented) and 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 plus the API server. Four for SIP, five for SS7, three binaries.

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.

11 workspace members, pure Rust, MIT licensed
CrateSize
bitspath-sip
RFC 3261 parser (nom), 4 transports (UDP/TCP/TLS/WS), transactions, SDP, digest auth, DNS SRV, session timers (RFC 4028)
~12.1K
bitspath-pbx
Registrar, dialplan router, trunks with health monitoring, LCR + DID routing, forwarding, hold, REFER transfer, parking, pickup, queues, ring groups, IVR, BLF + MWI presence
~23.1K
bitspath-media
RTP/RTCP, SRTP (AES-128-CM + HMAC-SHA1-80, SDES + DTLS), G.711 µ/A, G.722, DTMF, Opus (feature-gated), jitter buffer, PLC, conference mixer, T.38 fax modules, echo cancellation, ICE/STUN/TURN
~13.7K
bitspath-call
B2BUA core, call state machine, media bridge with NAT latching, str0m WebRTC leg (ICE + DTLS-SRTP), IVR sessions, voicemail, retransmission, rate limiting, HA cluster status
~23.6K
bitspath-sctp
SCTP user-space stack for SIGTRAN underlay; RFC 4960
~1.0K
bitspath-m3ua
MTP3 User Adaptation layer over SCTP; ASP state machines
~1.5K
bitspath-sccp
Signalling Connection Control Part; GTT routing for cellular signalling
~1.0K
bitspath-tcap
Transaction Capabilities Application Part; BER/ASN.1 via rasn for MAP dialogs
~1.3K
bitspath-map
Mobile Application Part; HLR queries and MT SMS submission to GSM cores
~1.2K
bitspath-smsgw
SMS Gateway binary: SIP MESSAGE bridged to cellular MT-SMS via the SIGTRAN stack, multi-operator prefix routing, delivery callbacks
~2.5K

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
  • Opus
    Behind an off-by-default cargo feature
    PT 11148 kHz

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.

10,001
RTP ports in the default range
4
SIP transports: UDP/TCP/TLS/WS
38
API handler modules
24
SQL migrations

Standalone SIP server

A dedicated 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 as call counts grow.

Wenme OAuth + Darwan RBAC

Management API authenticates via Wenme OAuth 2.1 with PKCE and JWKS. Every action is gated by Darwan with 74 distinct 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.

Scroll for full table

Capability
BitsPath VoiceBitsPath Voice
FreeSWITCH
Asterisk
Kamailio
Twilio Voice
Implementation languagePure Rust 2024CCCClosed cloud
Memory-safe by constructionn/a
Multi-tenant by designRLS on 36 tablesCustomPer-acct
B2BUA out of the boxModuleDialplan hack
SS7 / SIGTRAN SMS bridgeSCTP/M3UA/SCCP/TCAP/MAPss7liteAcct only
SRTP with key exchangeSDES + DTLS-SRTPProxy
WebRTC browser callingstr0m ICE + DTLS-SRTPModuleModuleProxy
WebSocket transport (RFC 7118)
LicenceMITMPL 2.0GPL v2GPL v2Per-min

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 is deployed 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 74 distinct pbx.* permissions through a permission cache with webhook invalidation.

Media security

SRTP via AES-128-CM and HMAC-SHA1-80, SDES key exchange per RFC 4568, plus DTLS. WebRTC peers bridge through implemented ICE and DTLS-SRTP on str0m, with TURN relay support.

Multi-tenancy

Every API query filters by domain_uuid. PostgreSQL row-level security is applied to 36 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.

120K+
Lines of Rust, workspace total
11
Workspace members (10 crates + API)
225
REST endpoints (Axum 0.8)
1,561
Test functions 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. Three binaries ship: a REST management API on Axum 0.8, a standalone SIP server speaking SIP RFC 3261 over UDP, TCP, TLS, and WebSocket, and a standalone SMS gateway. The workspace totals 120,209 lines of Rust (about 120K) across 10 crates plus the API server, with 1,561 test functions, covering SIP signalling, RTP and SRTP media, a B2BUA call engine, a WebRTC bridge, 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 determines call capacity on a node?

Bandwidth and RTP port allocation, not signalling. The default RTP range spans ports 10,000 to 20,000 (10,001 ports), and the media bridge is a zero-copy relay: packets are forwarded without decode and re-encode whenever both legs negotiate the same codec, so CPU stays low as call counts grow. BitsPath Voice publishes no benchmark figures; size the node to your trunk bandwidth and port budget.

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, with Opus (PT 111) available behind an off-by-default cargo feature. SRTP is implemented with AES-128-CM and HMAC-SHA1-80, SDES key exchange (RFC 4568), and DTLS support. WebRTC browser calls are shipped, not work in progress: legs bridge into SIP through implemented ICE and DTLS-SRTP on str0m 0.16, with STUN and TURN relay support.

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.

Three binaries. Ten crates plus the API server. Full SIP plane, full media plane, full SIGTRAN plane. Designed 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 36 PostgreSQL tables
  • Wenme OAuth 2.1 plus Darwan RBAC with 74 pbx.* permissions
  • Queues, parking, pickup, BLF + MWI, LCR, session timers, T.38 modules