icy-apple-74167
11/22/2025, 3:48 PMtall-airline-16756
11/22/2025, 3:48 PMtall-airline-16756
11/22/2025, 3:49 PMsession = get_google_realtime_session(...)).
2. Connect to the room: await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY).
3. Wait for participant: participant = await ctx.wait_for_participant().
4. Start the session: await session.start(...).
5. Send the greeting: await session.generate_reply(...) (or use await session.say(...) for direct TTS).
Why: ctx.connect() and wait_for_participant() must occur before session.start() so the agent joins a ready room and has a participant to address. generate_reply() must be awaited and called after session.start() so the session and audio pipeline are ready to play the greeting.
If your greeting still doesn’t play, check these common causes
• Use session.say() for realtime sessions if generate_reply() doesn't trigger speech (realtime LLMs sometimes expect live input; session.say() plays TTS directly).
• Confirm await session.start(...) completed without exceptions (your logs should show success).
• Ensure the agent token/connection allows publishing audio (publish audio permissions).
• Add a small delay or readiness check after session.start() if the realtime model needs extra time before producing audio.
If you want, paste the exact log lines around session.start() and your generate_reply() call and I’ll help pinpoint which of the above is happening.
Sources: Job lifecycle | LiveKit docs | Voice AI quickstart | LiveKit docs | Agents v0.x migration guide - Node.js | LiveKit Docs | Agent speech and audio | LiveKit docs | Connecting to LiveKit | LiveKit docsicy-apple-74167
11/22/2025, 5:04 PMtall-airline-16756
11/22/2025, 5:04 PMTransferSIPParticipant) which issues a SIP REFER to your trunk.
What to verify (step-by-step)
1. SIP REFER enabled on your provider
◦ Ensure your SIP trunk (Twilio, Telnyx, etc.) allows SIP REFER / PSTN transfer. If REFER is disabled the transfer request will be ignored.
1. You are calling the transfer API (not just doing an agent handoff)
◦ Use job_ctx.api.sip.transfer_sip_participant(...) / TransferSIPParticipantRequest with the target number. Agent handoffs alone won’t move the call.
1. Dispatch / agent routing configuration
◦ If transferring to another LiveKit agent endpoint/phone, ensure the destination agent has agent_name set in its entrypoint and a matching dispatch rule mapping the number to that agent.
1. Caller ID and trunk restrictions
◦ Some trunks reject transfers if caller ID is missing or invalid. Use the `sip_number`/caller fields when creating/transfering participants and verify your provider allows the caller ID you send.
1. Check logs and SIP response codes
◦ Look for SIP errors (408, 503, or 4xx/5xx) or silent rejections in your logs — they show why the remote endpoint didn’t accept the REFER or invite.
1. Race conditions / timing
◦ Ensure the transfer request runs after the room/participant state is stable. Add logging around the transfer call and confirm transfer_sip_participant returns success.
Concrete example (transfer API)
await job_ctx.api.sip.transfer_sip_participant(
api.TransferSIPParticipantRequest(
room_name=job_ctx.room.name,
participant_identity=participant_identity,
transfer_to=f"tel:+15105550123",
)
)
Next diagnostic steps I can help with
• Paste the transfer-related logs (including any SIP response codes) and the code you use to initiate the transfer.
• Tell me which SIP provider you use (Twilio, Telnyx, etc.) so I can point to provider-specific settings to check.
Tell me which of the above you'd like to start with and share the logs/code if available.
Sources: SIP troubleshooting guide | LiveKit docs | Call forwarding | LiveKit docs | Agents telephony integration | LiveKit Docs | SIP APIs | LiveKit docs | Agent dispatch | LiveKit docs