freezing-businessperson-25963
07/11/2025, 5:21 AMtall-airline-16756
07/11/2025, 5:21 AMfreezing-businessperson-25963
07/11/2025, 5:21 AMtall-airline-16756
07/11/2025, 5:22 AMtimeout = aiohttp.ClientTimeout(total=60)
in Python.
β’ Verify that SIP REFER is enabled on your SIP trunk (and for Twilio, "Enable PSTN Transfer" should be active).
β’ Check with your SIP provider to ensure they process REFER requests as expected and there is no unnecessary delay on their end.
The 408 status code points to a SIP-level timeout, suggesting the issue is more likely with the SIP infrastructure or configuration than with LiveKit's systems directly. Monitoring SIP provider logs for REFER handling may help pinpoint the delay.
If you need detailed troubleshooting steps based on your SIP provider/platform, let me know which provider you are using and any further relevant details about your setup.
Sources: pkg/service/sip.go | sipclient.go | packages/livekit-server-sdk/src/SipClient.ts | Agents telephony integration | LiveKit Docs | agent.py | livekit-protocol/livekit/protocol/sip.pyi | livekit/livekit_sip.pb.gofreezing-businessperson-25963
07/11/2025, 5:28 AMtall-airline-16756
07/11/2025, 5:29 AMroom_name
isn't empty, participant_identity
is correct (SIP, not WebRTC), and the transfer_to
destination looks good.
β’ Double-check that SIP REFER is enabled with your provider and in your trunk settings.
β’ Turn on debug logging in your LiveKit server - this will help us see exactly what's happening during the transfer.
β’ Watch out for duplicate transfer attempts - these can sometimes cause hiccups.
β’ Network connections: Make sure LiveKit can reach your SIP provider and your firewall/NAT settings are set up correctly.
It sounds like the transfer might be getting stuck because LiveKit isn't connecting your request to an active SIP session. Let's dig into the details and get this sorted out!
If you can share the participant identity, room name, and the SIP state right before the transfer, I can help you pinpoint the exact issue. We've got this! πͺ
Sources: Agents telephony integration | LiveKit Docs | pkg/sip/service.go | pkg/service/sip.go | sip-refer/agent.pyfreezing-businessperson-25963
07/11/2025, 5:33 AMtall-airline-16756
07/11/2025, 5:35 AMsip.callID
that uniquely tags each SIP call session.
Python example:
if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP:
call_id = participant.attributes.get('sip.callID')
print(f"SIP Call ID: {call_id}")
Where to find:
β’ In most SDKs, the SIP participant's attributes
dictionary/object will have sip.callID
and sip.callStatus
.
β’ Via the LiveKit management API: retrieve SIP participant info for sip_call_id
in the response.
β’ With LiveKit CLI tools, SIP call IDs are shown in participant info and diagnostics output.
Pro tip: If you're troubleshooting a transfer issue, double-check this value for the participant. If sip.callID
is missing or empty, the system might get a bit stuck, so you'll want to resolve that first. We're here to help make things smooth!
Sources: telephony/sip_lifecycle.py | protobufs/rpc/io.proto | cmd/lk/sip.go | pkg/service/sip.go | SIP participant | LiveKit Docsfreezing-businessperson-25963
07/11/2025, 5:46 AMtall-airline-16756
07/11/2025, 5:47 AMfrom livekit import rtc
# Then you can check participant kind:
if participant.kind == rtc.ParticipantKind.PARTICIPANT_KIND_SIP:
# Handle SIP participant
pass
This approach is totally standard and you'll see it used all over the LiveKit Python SDK documentation and examples. Pretty straightforward, right? Happy coding! π
Sources: livekit-agents/livekit/agents/job.py | livekit-protocol/livekit/protocol/models.py | evaluating-agents/agent_to_test.pyfreezing-businessperson-25963
07/11/2025, 5:50 AMtall-airline-16756
07/11/2025, 5:51 AMfreezing-businessperson-25963
07/11/2025, 5:54 AMtall-airline-16756
07/11/2025, 5:55 AMfreezing-businessperson-25963
07/11/2025, 5:59 AMtall-airline-16756
07/11/2025, 6:00 AMfreezing-businessperson-25963
07/11/2025, 6:01 AMfreezing-businessperson-25963
07/21/2025, 10:09 AM