Diagnostics Toolkit
The Diagnostics page and companion APIs concentrate reload workflows, routing simulations, registration introspection, and web-based test calls—this is the primary entrypoint for day-to-day troubleshooting.
1. Reload & preflight checks
- How to trigger:
- UI:
Settings → Reload, with switches to reload Routing, ACL, or the full application. - API: management endpoints such as
/reload/acl,/reload/app, etc., suitable for scripted deployments.
- UI:
- Preflight logic:
preflight::validate_reloadblocks unsafe changes (removing the[console]section, deleting in-use trunks, ACL syntax errors). - Common hints:
Reload would disable the consolemeans[console]is missing inconfig.toml; trunk-related errors require restoring the trunk record in the database or TOML files.
(Add a Reload panel screenshot here.)
2. Reading the Diagnostics tabs
Implemented in templates/console/diagnostics.html, the page exposes multiple tabs:
- Connection: shows realm, enabled transports (UDP/TCP/TLS/WebSocket), sample credentials, plus a WebRTC ICE probe that validates
[ice_servers]entries. - Trunks: renders a runtime trunk snapshot.
/diagnostics/trunks/testverifies whether an IP or domain matchesinbound_hosts/destand sends carrier OPTIONS probes. - Routing:
/diagnostics/routes/evaluatesimulates rule matching forruntimeordatabasedatasets, returning the hit route, selected trunk, rewrite result, queue/IVR action, and optional abort code. - SIP:
- Active SIP dialogs: lists active INVITE dialogs and lets you inspect SDP offer/answer pairs.
- Locator registry:
/diagnostics/locator/*queries or removes bindings to debug registration issues.
- Web Dialer: embeds JsSIP so you can dial directly in the browser using the credentials from Connection; it captures the latest ~80 WebSocket frames for signaling analysis.
(Add per-tab screenshots here.)
3. Logs, health checks, and external tooling
- Logging: configure
log_level,log_file, andhttp_access_skip_pathsinconfig.toml. File logs usetracing's structured format. - Call records: the
callrecordmodule writes CDRs and recording URLs; the console’s Call Records view reads frommodels::call_recordfor reconciliation. - Health probe:
handler::amiexposes/health, reporting database, SIP core, and task runner status; load balancers orperfcli --pingcan consume it. - Traffic capture: no built-in packet capture button—run
sngrep,tcpdump, or reproduce scenarios via Web Dialer then capture RTP/SIP manually on the host.
4. Typical troubleshooting paths
| Scenario | Playbook |
|---|---|
| Routing changes not effective | Settings → Reload → Diagnostics → Routing (Evaluate database & runtime) → inspect config/routes/*.toml |
| Registration failures | Diagnostics → SIP → Locator registry → confirm bindings → review proxy.acl_rules for blocked IPs |
| Inbound trunk rejected | Diagnostics → Trunks → test peer IP/domain → adjust inbound_hosts in config/trunks/*.toml if mismatched |
| One-way audio or media issues | Verify rtp_start_port/rtp_end_port exposure → reproduce via Web Dialer or a handset → capture RTP and inspect NAT/firewall |
| Billing or queue anomalies | Compare Call Records with billing templates → Diagnostics → Routing to confirm expected queue/route |
5. Automation & scripting
- Reload pipeline: CI jobs that modify
config/orconfig.tomlcan call/reload/acland/reload/app, parsing HTTP responses to ensure preflight success. - Health monitoring:
curl http://<host>:8080/health; alert or remove the instance ifstatus != ok. - Performance baselines:
examples/perfcli.rsperforms bulk registrations/calls; compare results with Diagnostics → Routing output to validate optimizations.
Mastering this trio—change, reload, validate—keeps incident loops within minutes and dramatically reduces carrier operations overhead.