The live Twilio call-control client. Originates outbound calls via Twilio's Calls.json API (TwiML <Connect><Stream> instructs Twilio to fork audio back to our /twilio/media-stream WSS endpoint); hangs up via Status=completed. HTTP basic auth over HTTPS; auth_token is NEVER logged (ADR-0009 -- provider credentials never reach the brain) -- tracing fields expose only caller- controlled values (to, from) + the CallSid's last 4 chars. Feature-gated behind `twilio-live` so the routine CI gate stays feature- default-off: MockCallControlClient is the per-PR test surface; the maintainer runs cargo test --features=twilio-live when validating a release. reqwest + tracing + serde_json are optional deps (dep:foo syntax) -- pulled in only when the feature is on, keeping the default resolve lean. The env parser (config::twilio_credentials) follows slice-5/seams' pure- function pattern: takes Option<String> inputs (testable without env mutation), returns Ok(None) when all four RUTSTER_TWILIO_* vars are unset (WebRTC-only mode), Ok(Some) when all four present + parse, Err on partial config (fail- fast at startup) or malformed values. TwilioCredentials is imported by the binary but never re-exported through the workspace (ADR-0009). T6 of slice-5. Depends on T2 (TwilioCredentials + CallControlClient trait). Signed-off-by: Aaron D. Lee <himself@adlee.work>
57 KiB
57 KiB