| Crates.io | rustpbx |
| lib.rs | rustpbx |
| version | 0.3.15 |
| created_at | 2025-04-25 02:22:18.582208+00 |
| updated_at | 2025-11-06 10:18:29.313172+00 |
| description | A SIP PBX implementation in Rust |
| homepage | |
| repository | https://github.com/restsend/rustpbx |
| max_upload_size | |
| id | 1648433 |
| size | 11,901,620 |
RustPBX is a high-performance, secure software-defined PBX (Private Branch Exchange) system implemented in Rust, designed to support AI-powered communication pipelines and modern voice applications.
pkg-config, libasound2-dev, libopus-devLinux:
apt-get install -y libasound2-dev libopus-dev
macOS:
brew install opus
git clone https://github.com/restsend/rustpbx
cd rustpbx
cargo build --release
For a minimal footprint you can disable heavy features:
cargo build -r --no-default-features --features vad_webrtc,console
config.ua.toml) that exposes the WebRTC console and proxies LLM traffic:cat > config.ua.toml <<'EOF'
http_addr = "0.0.0.0:8080"
log_level = "info"
[ua]
addr = "0.0.0.0"
udp_port = 13050
EOF
cargo run --bin rustpbx -- --conf config.ua.toml
http://localhost:8080 โ WebRTC Interface. Under LLM select your model, toggle streaming if needed, and click Start Session. You can now hold a full duplex voice conversation with the LLM through your browser.config.pbx.toml) pointing to SQLite and enabling call records:cat > config.pbx.toml <<'EOF'
http_addr = "0.0.0.0:8080"
log_level = "debug"
#log_file = "/tmp/rustpbx.log"
recorder_path = "/tmp/recorders"
# recorder_format can be "wav" (default) or "ogg" (requires enabling the 'opus' feature)
recorder_format = "ogg"
media_cache_path = "/tmp/mediacache"
database_url = "sqlite://rustpbx.sqlite3"
# external IP address for SIP signaling and media
# if server is behind NAT, set your public IP here (without port)
# external_ip = "1.2.3.4"
[console]
#session_secret = "please_change_me_to_a_random_secret"
base_path = "/console"
# allow self-service administrator signup after the first account
allow_registration = false
[proxy]
modules = ["acl", "auth", "registrar", "call"]
addr = "0.0.0.0"
udp_port = 15060
registrar_expires = 60
ws_handler= "/ws"
media_proxy = "auto"
# Base directory for generated routing/trunk/ACL files
generated_dir = "./config"
routes_files = ["config/routes/*.toml"]
trunks_files = ["config/trunks/*.toml"]
[proxy.transcript]
command = "sensevoice-cli"
# ACL rules
acl_rules = [
"allow all",
"deny all"
]
acl_files = ["config/acl/*.toml"]
[[proxy.user_backends]]
type = "memory"
users = [
{ username = "bob", password = "123456" },
{ username = "alice", password = "123456" },
]
[[proxy.user_backends]]
type = "extension"
database_url = "sqlite://rustpbx.sqlite3"
[callrecord]
type = "local"
root = "/tmp/recorders"
[recording]
enabled = true
auto_start = true
EOF
cargo run --bin rustpbx -- --conf config.pbx.toml
cargo run --bin rustpbx -- --conf config.pbx.toml \
--super-user admin --super-password change-me-now
http://localhost:8080/console/, add extensions, and register your SIP endpoints against udp://localhost:15060.






docker pull ghcr.io/restsend/rustpbx:latest
copy from config.toml.example
docker run -d \
--name rustpbx \
-p 8080:8080 \
-p 15060:15060/udp \
-p 13050:13050/udp \
-p 20000-30000:20000-30000/udp \
--env-file .env \
-v $(pwd)/db:/app/db \
-v $(pwd)/config.toml:/app/config.toml \
-v $(pwd)/config:/app/config \
-v $(pwd)/recorders:/tmp/recorders \
ghcr.io/restsend/rustpbx:latest \
--conf /app/config.toml
docker exec rustpbx /app/rustpbx --conf /app/config.toml --super-user=YOUR --super-password=PASS
Web Interface: http://localhost:8080/console/
YOUR + PASSSIP Proxy: localhost:15060
User Agent: localhost:13050
See https://github.com/restsend/rustpbxgo

The SIP workflow demonstrates how external applications can initiate calls through RustPBX, leveraging the full SIP protocol stack for reliable voice communications.

The WebRTC workflow shows how web applications can establish direct peer-to-peer connections via RustPBX, enabling modern browser-based voice applications.
For detailed API documentation, see API Documentation.
API Reference - Complete REST API documentation
Architecture Diagrams - System architecture and workflows
This project is currently in active development. We welcome contributions and feedback from the community.
MIT License - see LICENSE file for details.
Work in Progress - Core functionality is implemented and being actively refined. The system is suitable for development and testing environments.