Skip to content

Commit 652a8a3

Browse files
committed
refactor: user agent -> active-call
1 parent fbd6c66 commit 652a8a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+293
-9657
lines changed

README.md

Lines changed: 16 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# RustPBX - AI-Powered Software-Defined PBX
1+
# RustPBX - Secure Software-Defined PBX
22

33
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/restsend/rustpbx)
44

55
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.
66

7+
> **Note**: The Voice Agent functionality has been moved to a separate repository: [Active Call](https://github.com/restsend/active-call). This repository now focuses on the SIP Proxy and PBX features.
8+
79
## 🚀 Key Features
810

911
### SIP PBX Core
@@ -14,19 +16,6 @@ RustPBX is a high-performance, secure software-defined PBX (Private Branch Excha
1416
- **Call Recording**: Built-in call recording with multiple storage backends
1517
- **User Management**: Flexible user authentication and registration system
1618

17-
### AI Voice Agent Services
18-
19-
- **Speech-to-Text (ASR)**: Real-time speech recognition with multiple providers (Tencent Cloud, Aliyun, Deepgram)
20-
- **Text-to-Speech (TTS)**: High-quality speech synthesis with emotion and speaker control
21-
- **LLM Integration**: OpenAI-compatible LLM proxy for intelligent conversation handling
22-
- **Voice Activity Detection**: WebRTC and Silero VAD and Ten VAD support for optimal speech processing
23-
- **Noise Suppression**: Real-time audio denoising(rnnoise) for crystal-clear conversations
24-
25-
### RESTful API & WebSocket
26-
27-
- **RESTful Endpoints**: Complete REST API for call management and control
28-
- **WebSocket Commands**: Real-time call control via WebSocket connections
29-
- **Call Management**: List, monitor, and control active calls
3019

3120
## 🐳 Docker Deployment
3221

@@ -76,7 +65,6 @@ docker exec rustpbx /app/rustpbx --conf /app/config.toml --super-username=YOUR -
7665
- Web Interface: <http://localhost:8080/console/>
7766
- Login via `YOUR` + `PASS`
7867
- SIP Proxy: localhost:15060
79-
- User Agent: localhost:13050
8068

8169
## 🛠 Quick Start
8270

@@ -109,28 +97,6 @@ cargo build --release
10997
> For a minimal footprint you can disable heavy features:
11098
> `cargo build -r --no-default-features --features vad_webrtc,console`
11199
112-
### UserAgent Quick Start (Browser LLM voice demo)
113-
114-
1. Create a lightweight UA configuration (`config.ua.toml`) that exposes the WebRTC console and proxies LLM traffic:
115-
116-
```bash
117-
cat > config.ua.toml <<'EOF'
118-
http_addr = "0.0.0.0:8080"
119-
log_level = "info"
120-
[ua]
121-
addr = "0.0.0.0"
122-
udp_port = 13050
123-
EOF
124-
```
125-
126-
2. Start RustPBX in UA mode and serve the console assets:
127-
128-
```bash
129-
cargo run --bin rustpbx -- --conf config.ua.toml
130-
```
131-
132-
3. Open `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.
133-
134100
### PBX Quick Start (SQLite + console admin)
135101

136102
1. Create a PBX configuration (`config.pbx.toml`) pointing to SQLite and enabling call records:
@@ -143,17 +109,6 @@ log_level = "debug"
143109
media_cache_path = "/tmp/mediacache"
144110
database_url = "sqlite://rustpbx.sqlite3"
145111
146-
# external IP address for SIP signaling and media
147-
# if server is behind NAT, set your public IP here (without port)
148-
# external_ip = "1.2.3.4"
149-
150-
[console]
151-
#session_secret = "please_change_me_to_a_random_secret"
152-
base_path = "/console"
153-
# allow self-service administrator signup after the first account
154-
allow_registration = false
155-
156-
[proxy]
157112
modules = ["acl", "auth", "registrar", "call"]
158113
addr = "0.0.0.0"
159114
udp_port = 15060
@@ -165,7 +120,17 @@ generated_dir = "./config"
165120
routes_files = ["config/routes/*.toml"]
166121
trunks_files = ["config/trunks/*.toml"]
167122
168-
[proxy.transcript]
123+
# external IP address for SIP signaling and media
124+
# if server is behind NAT, set your public IP here (without port)
125+
# external_ip = "1.2.3.4"
126+
127+
[console]
128+
#session_secret = "please_change_me_to_a_random_secret"
129+
base_path = "/console"
130+
# allow self-service administrator signup after the first account
131+
allow_registration = false
132+
133+
[transcript]
169134
command = "sensevoice-cli"
170135
171136
# ACL rules
@@ -175,14 +140,14 @@ acl_rules = [
175140
]
176141
acl_files = ["config/acl/*.toml"]
177142
178-
[[proxy.user_backends]]
143+
[[user_backends]]
179144
type = "memory"
180145
users = [
181146
{ username = "bob", password = "123456" },
182147
{ username = "alice", password = "123456" },
183148
]
184149
185-
[[proxy.user_backends]]
150+
[[user_backends]]
186151
type = "extension"
187152
database_url = "sqlite://rustpbx.sqlite3"
188153
@@ -246,28 +211,6 @@ EOF
246211

247212
![Console webrtc phone](./docs/screenshots/web-dailer.png)
248213

249-
## 🧪 Go Client Integration
250-
251-
### Using rustpbxgo Client Library
252-
253-
See `https://github.com/restsend/rustpbxgo`
254-
255-
### API Documentation
256-
257-
#### SIP Workflow
258-
259-
![Sip](./docs/sip.png)
260-
261-
The SIP workflow demonstrates how external applications can initiate calls through RustPBX, leveraging the full SIP protocol stack for reliable voice communications.
262-
263-
#### WebRTC Workflow
264-
265-
![Webrtc](./docs/webrtc.png)
266-
267-
The WebRTC workflow shows how web applications can establish direct peer-to-peer connections via RustPBX, enabling modern browser-based voice applications.
268-
269-
For detailed API documentation, see [API Documentation](./docs/api.md).
270-
271214
## 🔧 Configuration Features
272215

273216
### SIP Proxy
@@ -284,20 +227,6 @@ For detailed API documentation, see [API Documentation](./docs/api.md).
284227
- Support for multiple codecs
285228
- Real-time media relay
286229

287-
### AI Services
288-
289-
- Multiple ASR/TTS provider support
290-
- Configurable LLM endpoints
291-
- Voice activity detection
292-
- Audio preprocessing and enhancement
293-
294-
## 📚 Documentation
295-
296-
- [API Reference](./docs/api.md) - Complete REST API documentation
297-
- [Architecture Diagrams](docs/) - System architecture and workflows
298-
- [VoiceAgent Integration with Telephony Networks](./docs/how%20webrtc%20work%20with%20sip(en).md)
299-
- [VoiceAgent 与电话网络互通的技术实现](./docs/how%20webrtc%20work%20with%20sip(zh).md)
300-
301230
## 🤝 Contributing
302231

303232
This project is currently in active development. We welcome contributions and feedback from the community.

config.toml.example

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ allow_registration = false
3838
# set to true to force Secure cookie attribute, otherwise it is auto-detected based on request
3939
secure_cookie = false
4040

41-
[ua]
42-
addr="0.0.0.0"
43-
udp_port=13050 # don't use 5060
44-
4541
[proxy]
4642
modules = ["acl", "auth", "registrar", "call"]
4743
addr = "0.0.0.0"
@@ -57,16 +53,6 @@ addons = ["acme", "wholesale"]
5753
# Don't responed the request when user not existed (slience for spam scanner)
5854
ensure_user = true
5955

60-
#[proxy.transcript]
61-
# command = "sensevoice-cli"
62-
# models_path = "/var/lib/sensevoice"
63-
# hf_endpoint = "https://huggingface.co"
64-
# extra_args = ["--format", "json"]
65-
# model = "medium"
66-
# samplerate = 16000
67-
# default_language = "zh"
68-
# timeout_secs = 60
69-
7056
# ACL rules
7157
acl_rules = [
7258
# "allow 10.0.0.0/8",
@@ -76,19 +62,14 @@ acl_rules = [
7662
]
7763
acl_files = ["config/acl/*.toml"]
7864

79-
[ua.handler]
80-
type = "webhook"
81-
url = "http://localhost:8090/webhook"
82-
method = "POST"
83-
84-
[[proxy.user_backends]]
65+
[[user_backends]]
8566
type = "memory"
8667
users = [
8768
{ username = "bob", password = "123456" },
8869
{ username = "alice", password = "123456" },
8970
]
9071

91-
[[proxy.user_backends]]
72+
[[user_backends]]
9273
type = "extension"
9374

9475
[recording]
@@ -100,18 +81,18 @@ type = "local"
10081
root = "./config/cdr"
10182

10283

103-
# [proxy.trunks.wuhoo]
84+
# [trunks.wuhoo]
10485
# dest = "sip:123.456.789.00:1234"
10586

106-
# [[proxy.routes]]
87+
# [[routes]]
10788
# name = "default"
10889
# priority = 1
10990
# dest = "wuhoo"
11091

111-
# [proxy.routes.match]
92+
# [routes.match]
11293
# "to.user" = "^\\+.*"
11394

114-
# [proxy.routes.rewrite]
95+
# [routes.rewrite]
11596
# "to.user" = "+{1}"
11697
# "to.host" = "123.456.789.00:1234"
11798
# "from.user" = "12345"

docs/README.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)