Thanks — I hear you: you want a recording that reflects the phone caller’s perspective (both sides at the phone-quality and with real-world latency), not the LiveKit room’s mixed/room-side egress.
Short answer: LiveKit cannot natively record the actual phone call from the user’s side. Egress records the LiveKit room (the WebRTC session) so agent audio (TTS) will be high quality and the telephone-side audio will reflect how it’s bridged into the room, not the raw PSTN handset mix or exact caller-side latency.
Options you can consider:
• Use your telephony provider’s call recording (records the call from the PSTN side). This is the only way to capture the caller’s true phone-side audio and timing.
• If the provider can’t record, create an external bridge that records both sides before/while bridging into LiveKit:
◦ Terminate the PSTN call into a media server or SIP gateway you control, record both legs there, and also bridge that media into the LiveKit room.
◦ Or run a media relay that captures the RTP/SRTP streams from the telephony leg and writes them to a file while also forwarding into LiveKit.
• If your goal is simply to avoid extra audio at the end of a recording, stop/clean up egress when the human participant leaves (for example delete the room or stop the egress) to avoid post-call artifacts. This doesn’t change perspective or quality, only trimming.
If you want, tell me:
• which telephony provider or SIP gateway you’re using, and
• whether you can route calls through a server you control,
and I’ll suggest the most practical bridge/recording approach and outline the steps.
Sources:
sip | livekit/livekit_composite | DeepWiki