I am implementing cold transfert an agent behind t...
# ask-ai
g
I am implementing cold transfert an agent behind twilio phone number. I have an error during transfert. Here is the Transfert Requested payload from my livekit call logs (masking to phone number for privacy)
Copy code
{
transferId: "STR_tMnAiugkL8se"
callId: "SCL_4bpebnaB2oan"
transferTo: "tel:+1508XXXXXXX"
transferInitiatedAtNs: "1763628446849084580"
transferCompletedAtNs: "1763628446867145411"
transferStatus: "STS_TRANSFER_FAILED"
error: "sip status: 403: Forbidden"
transferStatusCode: {
code: "SIP_STATUS_FORBIDDEN"
status: "Forbidden"
}
}
t
A SIP 403 Forbidden error during a cold transfer can be a bit frustrating, but don’t worry—we’ll work through it together. This error usually relates to authentication, permission, or regional compliance issues. Here are some friendly steps to help you troubleshoot: • Verify SIP Trunk Credentials: Double-check that the username and password you’ve set up in your LiveKit SIP trunk exactly match what your SIP provider gave you. • Check Call Transfer Permissions: Make sure your SIP trunk supports call transfers. For example, if you’re using Twilio, you’ll want to ensure SIP REFER is enabled for transfers. • Validate Region Pinning Compliance: It’s important that calls follow regional routing rules. Try using the
destination_country
parameter and region-pinned endpoints if that applies to you. • Confirm Valid Transfer Target: Take a moment to verify that the destination number is formatted correctly and can be reached. • Test Outside of LiveKit: If you’re working with Telnyx, testing SIP REFER transfers directly through their Call Control API can help pinpoint where the issue might be. • Ensure Proper API Configuration: When using the
TransferSIPParticipant
API, make sure parameters like
transfer_to
are formatted just right—either
tel:+number
or
sip:uri
. If you try these steps and the problem still sticks around, please don’t hesitate to reach out. I’m here to help you get this sorted! Sources: SIP troubleshooting guide | LiveKit docs | Call forwarding | LiveKit docs
g
• Verify SIP Trunk Credentials: Double-check that the username and password you’ve set up in your LiveKit SIP trunk exactly match what your SIP provider gave you.
Do I need an outbound SIP trunk in livekit for that?
t
Could you please help me understand if you're using LiveKit's SIP integration for making outbound calls, or if the call transfer is being managed completely within your SIP provider's system? Knowing this will really help us figure out if an outbound SIP trunk is needed. I'm here to assist you every step of the way! Sources: Agent-assisted warm transfer | LiveKit docs
g
It's an inbound call from twilio to my livekit endpoint:
Copy code
`sip:${to}@${livekitConfig.sipEndpoint}`
t
For handling inbound calls from Twilio to your LiveKit endpoint, you'll just need an inbound SIP trunk and a dispatch rule. If you're thinking about doing cold transfers, though, it's important to have an outbound SIP trunk set up as well. This is because LiveKit sends the SIP REFER request through the outbound trunk to your provider. So, if cold transfers are part of your plan, make sure your outbound SIP trunk is ready alongside your inbound setup. If you have any questions about this, I'm here to help! Sources: Create and configure a Twilio SIP trunk | LiveKit docs | Inbound calls with Twilio Voice | LiveKit docs | README.md | Call forwarding | LiveKit docs | Agent-assisted warm transfer | LiveKit docs
g
ok, so I need an outbound SIP trunk set up. I have one which I'm able to trigger outbound calls with
So I think credentials are ok
t
Since you already have an outbound SIP trunk set up and working for outbound calls, let's make sure it's all set to support SIP REFER, which is essential for cold transfers. Here are some friendly steps to guide you through: • Enable SIP REFER: It’s a good idea to check with your SIP provider (like Twilio) to confirm that SIP REFER is enabled for your trunk. For Twilio, you can easily do this through their console or CLI. • Verify Trunk Configuration: Double-check that your trunk is properly set up in LiveKit with the right credentials and permissions to handle transfers smoothly. • Test Cold Transfers: Try using the
TransferSIPParticipant
API to initiate a transfer and keep an eye on the transfer status to catch any hiccups early. If you run into any more bumps along the way, please don’t hesitate to reach out—I’m here to help you troubleshoot and get everything working perfectly!