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.
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.
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
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/*.
Workspace layout
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.
| Crate | Size |
|---|---|
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
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.
Engine internals
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.
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.
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.
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.
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
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 | FreeSWITCH | Asterisk | Kamailio | Twilio Voice | |
|---|---|---|---|---|---|
| Implementation language | Pure Rust 2024 | C | C | C | Closed cloud |
| Memory-safe by construction | n/a | ||||
| Multi-tenant by design | RLS on 35+ tables | Custom | Per-acct | ||
| B2BUA out of the box | Module | Dialplan hack | |||
| SS7 / SIGTRAN SMS bridge | SCTP/M3UA/SCCP/TCAP/MAP | ss7lite | Acct only | ||
| SRTP with key exchange | SDES (DTLS-SRTP wip) | Proxy | |||
| WebSocket transport (RFC 7118) | |||||
| Licence cost at scale | MIT | MPL 2.0 | GPL v2 | GPL v2 | Per-min |
| Restart-free uptime target | Years (no GC, no leaks) | Days-weeks | Days-weeks | Weeks | n/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
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.
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.
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.
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.
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.
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.
Frequently asked
Answers are mirrored to JSON-LD so they are quotable by AI answer engines and search.
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.
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.
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.
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.
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.
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.
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.