Skip to content

Commit 0dfe34f

Browse files
committed
feat: addon with submodules
1 parent 191ac18 commit 0dfe34f

101 files changed

Lines changed: 8863 additions & 2910 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,7 @@ config/voicemail.toml
7070
config.toml.test
7171
docs/qrcode.png
7272
docs/rustpbx-product-brief.zh.html
73-
src/addons/wholesale
74-
src/addons/cc
75-
src/addons/endpoint_manager
76-
src/addons/enterprise_auth
77-
src/addons/ivr_editor
78-
src/addons/jsonrpc_router
79-
src/addons/telemetry
80-
src/addons/voicemail
73+
src/addons/jsonrpc_router
8174
*.sh
75+
screenshots/
76+
demo/

.gitmodules

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[submodule "src/addons/sbc"]
2+
path = src/addons/sbc
3+
url = https://cnb.cool/miuda.ai/sbc
4+
[submodule "src/addons/cc"]
5+
path = src/addons/cc
6+
url = https://cnb.cool/miuda.ai/cc
7+
[submodule "src/addons/wholesale"]
8+
path = src/addons/wholesale
9+
url = https://cnb.cool/miuda.ai/wholesale
10+
[submodule "src/addons/endpoint_manager"]
11+
path = src/addons/endpoint_manager
12+
url = https://cnb.cool/miuda.ai/endpoint_manager
13+
[submodule "src/addons/enterprise_auth"]
14+
path = src/addons/enterprise_auth
15+
url = https://cnb.cool/miuda.ai/enterprise_auth
16+
[submodule "src/addons/ivr_editor"]
17+
path = src/addons/ivr_editor
18+
url = https://cnb.cool/miuda.ai/ivr_editor
19+
[submodule "src/addons/telemetry"]
20+
path = src/addons/telemetry
21+
url = https://cnb.cool/miuda.ai/telemetry
22+
[submodule "src/addons/voicemail"]
23+
path = src/addons/voicemail
24+
url = https://cnb.cool/miuda.ai/voicemail

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ aws-lc-rs = { version = "1", optional = true }
205205
totp-rs = { version = "5.7.1", features = ["qr", "gen_secret"] }
206206
ldap3 = { version = "0.12.1", optional = true }
207207
ring = { version = "0.17", optional = true }
208+
tempfile = "3.27.0"
208209

209210

210211
[dev-dependencies]
211-
tempfile = "3.27.0"
212212
portpicker = "0.1.1"
213213
tower = { version = "0.5", features = ["util"] }
214-
sipbot = { version = "0.2.37", default-features = false }
214+
sipbot = { version = "0.2.38", default-features = false }
215215
serde_urlencoded = "0.7"
216216

217217
[build-dependencies]

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,40 @@ Per-channel overhead: ~0.06% CPU / 0.24 MB (signaling); ~0.19% CPU / 0.33 MB (wi
177177
# Linux: apt-get install cmake pkg-config libasound2-dev libssl-dev libopus-dev
178178
# macOS: brew install cmake openssl pkg-config
179179

180-
git clone https://github.com/restsend/rustpbx
180+
git clone --recurse-submodules https://github.com/restsend/rustpbx
181181
cd rustpbx
182182
cargo build --release
183183
cargo run --bin rustpbx -- --conf config.toml.example
184184
```
185185

186186
> Cross-compile via [cross](https://github.com/cross-rs/cross): `cargo install cross && cross build --release --target aarch64-unknown-linux-gnu`
187187
188+
### Submodules
189+
190+
Commerce addons are managed as git submodules under `src/addons/`:
191+
192+
| Submodule | Repository |
193+
|-----------|-----------|
194+
| `src/addons/cc` | https://cnb.cool/miuda.ai/cc |
195+
| `src/addons/wholesale` | https://cnb.cool/miuda.ai/wholesale |
196+
| `src/addons/endpoint_manager` | https://cnb.cool/miuda.ai/endpoint_manager |
197+
| `src/addons/enterprise_auth` | https://cnb.cool/miuda.ai/enterprise_auth |
198+
| `src/addons/ivr_editor` | https://cnb.cool/miuda.ai/ivr_editor |
199+
| `src/addons/sbc` | https://cnb.cool/miuda.ai/sbc |
200+
| `src/addons/telemetry` | https://cnb.cool/miuda.ai/telemetry |
201+
| `src/addons/voicemail` | https://cnb.cool/miuda.ai/voicemail |
202+
203+
```bash
204+
# Initialize submodules after clone
205+
git submodule update --init --recursive
206+
207+
# Pull latest changes for all submodules
208+
git submodule update --remote
209+
210+
# Pull latest for a specific submodule
211+
git submodule update --remote src/addons/cc
212+
```
213+
188214
---
189215

190216
## Screenshots

docs/ivr_step_protocol_en.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,35 @@ Every response is a JSON object with a `"type"` field. Two categories:
138138
{ "type": "torecord", "prompt": "leave_msg.wav", "beep": true }
139139
```
140140

141+
### Transparent Passthrough Fields
142+
143+
Every `ActionNode` response can include three optional top-level fields for node identification and data passthrough:
144+
145+
```json
146+
{
147+
"type": "prompt",
148+
"file": "hello.wav",
149+
"step_id": "1000602002200750100",
150+
"step_name": "欢迎语",
151+
"extra": {
152+
"tenantId": "didi",
153+
"gvpFlow": "CTCDaiJiaKeFu",
154+
"callPath": "F_11,F",
155+
"businessType": "6",
156+
"customerType": "1",
157+
"routePoint": "39325"
158+
}
159+
}
160+
```
161+
162+
| Field | Type | Description |
163+
|-------|------|-------------|
164+
| `step_id` | `string` or null | Node identifier — stored and emitted in `ivr_step_trace` events as `step_id` |
165+
| `step_name` | `string` or null | Node name — stored and emitted as `step_name` |
166+
| `extra` | `JSON Object` or null | Transparent passthrough data — provider returns the complete object each time; RustPBX stores it and includes it verbatim in every subsequent `ivr_step_trace` event |
167+
168+
> **Passthrough behavior**: After `session_start`, the provider should include `extra` in every response. RustPBX stores the latest `extra` value and echoes it in all `ivr_step_trace` events until the provider updates it. The `step_id` and `step_name` from the most recent provider response are used for the current step's trace.
169+
141170
### Next Chaining
142171

143172
Non-terminal actions can include a `next` field to chain multiple actions without a round-trip:

0 commit comments

Comments
 (0)