Thanks — responding to your confirmation that you need bidirectional audio streaming from telephony → model → call.
Short answer: Yes — but not by streaming raw media over a client WebSocket. You should run a server-side agent (Node/Python) that bridges telephony, LiveKit, and your custom realtime model:
• Agent joins a LiveKit room as a participant using WebRTC (handles media routing to/from callers).
• Agent sends client audio to your custom model over a WebSocket (or whatever model protocol) and receives model audio back.
• Agent forwards model audio into the LiveKit room so callers hear responses (true bidirectional streaming).
• Optionally use Track Egress to stream raw PCM out to your server if you only need one-way export, but egress alone can’t return audio into the room — the agent is required for true two-way.
If you’d like, I can outline: 1) A minimal architecture diagram and data flow. 2) Example steps or sample code (Node or Python) for: joining LiveKit, capturing audio, opening a WebSocket to your model, forwarding PCM/Opus frames, and injecting model audio back into the room.
Quick questions to tailor the examples:
• How is telephony connected today (SIP gateway, PSTN provider, WebRTC client)?
• Which realtime model/protocol does your model expect (raw PCM frames, Opus, RTP over WebSocket, custom JSON framing)?
• Do you need low-level audio format conversion (e.g., 16kHz PCM ↔️ model) or codec passthrough?
Pick one or two answers and I’ll give a focused architecture and code snippets.
, with interactive elements