# rtcprobe > Online SIP / RTP / WebRTC diagnostic service. Dial built-in test lines, then > read machine-readable reports: SIP flow (swimlane + raw messages), SDP > diagnostics, RTP/RTCP statistics (loss, jitter, **RTT**), MOS / audio quality. > No authentication. - Base URL: `https://probe.rustpbx.com` - SIP domain: `probe.rustpbx.com` - Pages: `/` (dashboard) · `/test` (interactive diagnostics) · `/about` - This file: `/llm.txt` (also `/llms.txt`) ## Transports & media security - SIP signalling: `5060/udp`, `5060/tcp`, `5061/tls` (**SIPS**, SIP over TLS). - Media auto-adapts to the caller's offer — every line accepts plain RTP, **SRTP/SDES** (offer carries `a=crypto`) and **WebRTC (ICE + DTLS-SRTP)** (offer carries `a=fingerprint`). The report states which mode was negotiated (`transport.mode` / checks `srtp_sdes` / `dtls_fingerprint`). - WebRTC caveat: some networks / SIP-ALG firewalls drop UDP SIP offers whose SDP advertises `m=audio 9` (every WebRTC offer). If a WebRTC call gets no response, retry with TCP or TLS signalling: `sips:echo@probe.rustpbx.com` (or append `;transport=tcp`). ## Built-in test lines Dial `sip:@probe.rustpbx.com` (use `sips:@probe.rustpbx.com` for TLS, or append `;transport=tcp`). | user | mode | behavior | |---|---|---| | `echo` | echo | 180 → 200, echoes received audio | | `voicemail` | voicemail | 180 (~5s) → 200, greeting + beep | | `ivr` | ivr | 183 menu → 200, collects DTMF | | `prompt` | prompt | 183 prompt → 200 (SSRC jump) | | `reject` | reject | rejects with 486 Busy Here (no media; a skeleton result is saved) | | `busy` | busy | 200 → busy tone (~3s) → server hangs up | | `offline` | offline | 200 → number-unavailable tone (~3s) → server hangs up | | `early` | echo | 183 early media → 200, echo | | `ring180` | echo | 180 Ringing → 200, echo | | `ring183` | echo | 183 ringback tone → 200, echo | | `hi`, `hello`, `welcome` | announce | 183 + 200, spoken greeting, hangup | | `sip`, `probe` | announce | announcement line, hangup | Greetings are localized by caller source IP (en/zh/ja/es/fr/de); the busy / offline signals are language-neutral tones. ## HTTP API | method | path | purpose | |---|---|---| | GET | `/api/stats` | counters + service list (user/mode/ring/code/engine/remark) | | GET | `/api/test/state` | diagnostics config + scenarios + rules | | POST | `/api/test/sessions` | create a session; body `{scenario, overrides:{target,total,cps,transport}}` → `{token, sip_uri, role, engine, session}` | | GET | `/api/test/sessions/{token}?since=N` | live session detail (state, call_id, events, stats, report) | | DELETE | `/api/test/sessions/{token}` | stop/remove a session | | GET | `/api/result/{call_id}` | full JSON report **+ `sip_flow`** | | GET | `/result/{call_id}` | HTML report (SIP flow, SDP, RTP/RTCP, waveform audio) | | GET | `/result/{call_id}/audio/{rx,tx}.wav` | captured audio | | POST/PUT | `/api/test/scenarios`, `/api/test/rules`, `/api/test/config` | edit scenarios / callee rules / global config | | WS | `/ws` | live events, RTP stats, PCM audio, control | `call_id` is the bare SIP Call-ID of the call — **from/to tags are not needed** (the older dialog-id form `-[-]` still resolves). Results are persisted server-side and are retrievable by id (there is no public list endpoint — the `/test` page keeps its own history in the browser). ## Report JSON (`/api/result/{call_id}`) - `call_id`, `saved_at`, `scenario`/`service`, `from_uri`, `to_uri`, `codec`, `engine` (rtp|srtp|webrtc), `sip_transport` (udp|tcp|tls|…) - `score` (0–100), `mos` (1–5) - `checks[]`: `{name, status: pass|warn|fail|skip, detail}` — media: `one_way_media`, `packet_loss`, `jitter`, `duplicate_delivery`, `reorder`, `ssrc_jump`, `rtcp_feedback` (remote receiver reports: loss/jitter/delay), `dtmf_events` (RFC 4733 keypresses seen in RTP), `voice_quality`; security: `srtp_sdes`, `dtls_fingerprint`, `dtls_setup`, `ice_candidates` (skipped with an explanation when not used); session: `sdp_connection`, `sdp_codec_offer`, `sdp_codec_negotiated`, `sdp_port`, `sdp_reinvite`; SDP conformance: `sdp_required_lines` (v/o/s/t/m/c), `sdp_pt_rtpmap` (dynamic PT needs a=rtpmap, static PT redefinition), `sdp_pt_order` (answer ⊆ offer, preference order), `sdp_telephone_event` (dynamic PT / 8000 Hz), `sdp_direction`, `sdp_ptime`, `sdp_connection_nat` (private `c=` vs a public peer); SIP conformance: `sip_required_headers`, `sip_max_forwards`, `sip_via_transport` (Via token vs `sips:`/`transport=` and the real transport), `sip_via_param` (nonstandard `;transport=` in Via), `sip_contact_scheme` (`sips:` dialog needs a `sips:` Contact), `sip_cseq`, `sip_via_branch`, `sip_content_length`, `sip_via_rport`, `sip_source_mismatch`, `sip_nat_private_addr`; live: `ice_connectivity` (state, connect time, latch, ICE restarts) and `dtls_handshake` (webrtc mode) - `transport`: live snapshot — `mode`, `peer_state`, `ice_state`, `ice_role`, `t_connect_ms`, `ice_restarts`, `latch` (symmetric-RTP address + switches), `selected_pair` (local→remote addresses), `transitions[]` state timeline - `capture`: `{streams[], rtt_ms, rtcp_packets, rtcp_rr_rx, rtcp_sr_tx, rtcp_feedback[], dtmf[], ssrc_jumps}`; each stream has `kind (rtp_rx|rtp_tx), ssrc, packets, bytes, gap_lost, reorder, duplicates, jitter_ms`; `rtcp_feedback` aggregates remote receiver reports (`source_ssrc, reports, loss_pct_max, lost_cum, jitter_ms_max, dlsr_ms`); `dtmf` lists key presses `{t_ms, dir, digit, duration_ms, volume, packets}` - `sdp`: `{offers[], answers[], reinvites[], checks[], ...}` — per m-line `codec, connection, audio_port, direction, srtp, ice, dtls, crypto_suites, fingerprint, setup, ice_ufrag, candidates, rtcp_mux` - `sip`: `{messages[], checks[]}` — parsed message summaries (`{t_ms, dir, summary, transport, peer}`) plus the SIP conformance checks - `audio`: RMS / clipping / DC / spectral stats - `sip_flow`: `{endpoints:[local,remote], messages:[{t_ms, dir:in|out, summary, src, dst, raw}]}` — use this to reconstruct the signalling ladder Calls that never reach 200 OK also produce a result: `reject` saves a skeleton record (check `call_setup` explains the rejection), and caller-mode sessions save a `call_setup: fail` report per failed dial attempt. ## Session timer rtcprobe runs its own watchdog on every call (default 60s, env `RTPROBE_SESSION_TIMER`, 0 = off): if **no media is received** for the whole window it hangs the call up proactively and marks it — a `session-timer` entry appears in `report.transport.transitions` and a `session_timer` check (status `warn`) is added to the report; the call also ends with reason `session timeout: no media for Ns`. ## Examples ```bash # List services curl -s https://probe.rustpbx.com/api/stats # Create a callee session (temp number) with TLS dial-in curl -s -X POST https://probe.rustpbx.com/api/test/sessions \ -H 'Content-Type: application/json' \ -d '{"scenario":"echo","overrides":{"transport":"sips"}}' # -> { "token": "ab12cd", "sip_uri": "sips:ab12cd@probe.rustpbx.com", ... } # Fetch a call report (JSON incl. sip_flow) curl -s https://probe.rustpbx.com/api/result/ # Place calls with sipbot (media auto-adapts: RTP / --srtp / --webrtc) sipbot call -t sip:echo@probe.rustpbx.com --hangup 5 sipbot call -t sips:echo@probe.rustpbx.com --srtp sipbot call -t 'sip:echo@probe.rustpbx.com;transport=tcp' --webrtc ``` ## Notes for agents - To validate connectivity to a target, dial a built-in line and read the final `Status: [..]`, `TX/RX` packets and the report `score`/`checks`. - Expected outcomes: `echo`/`early`/`ring*` → 200 with media; `busy`/`offline` → 200, signal tone, then server-side hangup; `reject` → 486 (result saved); `announce*` → 183+200 then hangup. All lines accept RTP / SRTP / WebRTC offers — send `--srtp` or `--webrtc` to probe encrypted media. - Signaling over `;transport=tcp` or `sips:` bypasses UDP SIP-ALG/DPI that drops WebRTC (`m=audio 9`) offers or oversized UDP messages. - RTT is measured from RTCP SR/RR and reported as `capture.rtt_ms`. - Input handling: `call_id` path parameters are sanitized server-side (lookup charset `[A-Za-z0-9._@-]`; no path traversal, no glob/HTML/script injection); scenario `play` file steps cannot escape the wav directory; dial `target`s must be `sip:`/`sips:`/`tel:` URIs without whitespace or control characters; callee rules reject invalid or nested-quantifier regexes. - Concurrency limits: HTTP/WS connections are capped (503 beyond, default 10); SIP dialogs per UA are capped across udp/tcp/sips (default 10, env `RTPROBE_MAX_SIP_CONCURRENCY`) — excess INVITEs are answered `503 Service Unavailable` (Retry-After: 5) before any resource is allocated, so call floods / stress tools cannot exhaust the service.