Is there a way to transfer a call without using SI...
# ask-ai
g
Is there a way to transfer a call without using SIP refer?
t
Thanks for reaching out, Aumesh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! I wanted to share some helpful info about call transfers in LiveKit. They use SIP REFER as the core method to make things work smoothly. When you use the
TransferSIPParticipant
API to transfer calls, it specifically relies on SIP REFER to guide the provider in connecting the caller to a new number or SIP endpoint. At the moment, there isn’t another documented way to transfer calls without using SIP REFER, but if you have any questions or need further assistance, I’m here to help! Sources: SIP overview | LiveKit Docs | sip-refer/agent.py | agent.py | SIP troubleshooting guide | LiveKit Docs | Transferring calls | LiveKit Docs
g
If I transfer without using a SIP URI and instead a <telnumber|telnumber> would that still use sip refer?
t
I'm happy to clarify this for you! When you transfer a call using
tel:number
instead of a SIP URI, LiveKit still uses the SIP REFER method behind the scenes. So, if you start a transfer with a
tel:
prefixed number (like
tel:+15105550100
), LiveKit will send a SIP REFER request through your configured SIP trunk, and the
Refer-To
header will include that
tel:
number. Just a quick note: for this to work smoothly, SIP REFER needs to be enabled on your SIP trunk provider. Other than that, the transfer works just the same way as it does with SIP URIs. If you have any more questions or need help with this setup, feel free to ask—I’m here to help! Sources: Transferring calls | LiveKit Docs | SIP overview | LiveKit Docs | SIP APIs | LiveKit Docs | pkg/sip/inbound.go | Agents telephony integration | LiveKit Docs
g
We use secure trunking, but sip refer doesn’t work with secure trunking, so how do we transfer
t
I understand that when using secure trunking with TLS, SIP REFER-based call transfers aren’t supported in LiveKit, and that can feel a bit limiting. But don’t worry! There are alternative ways to handle secure call transfers by establishing new encrypted sessions, and I’m here to guide you through them: 1. Agent-Assisted DTMF Transfer (Cold Transfer Simulation): • You can use an AI agent to detect DTMF input and then initiate a new secure call using the
CreateSIPParticipant
API. • Just make sure TLS and SRTP are enabled on your outbound trunk to keep everything encrypted. • This approach simulates a cold transfer without needing SIP REFER. 2. Warm Handoff with Bridged Sessions: • Here, you’d use
CreateSIPParticipant
to dial the target number securely. • Once the new participant is connected, the AI agent can gracefully disconnect itself, leaving the original caller and the new participant in a secure, encrypted session. Both of these methods help you maintain secure call handling while working around the SIP REFER limitations with TLS. If you’d like, I’m happy to provide more details or walk you through the implementation—just let me know! Sources: Secure trunking | LiveKit Docs | sip-refer/agent.py | telephony/warm_handoff.py
g
We need the end recipient to see the original caller id
t
Thanks for reaching out! Could you please let me know if keeping the original caller ID is something required for compliance, or is it more about creating a better experience for your users? Also, are you working with a particular SIP trunk provider that allows custom caller ID settings? Understanding this will really help us explore the best configuration options or alternative solutions to meet your needs. I'm here to help every step of the way!
g
It’s needed for compliance and better user experience. We use twilio
t
I'm glad you're looking to preserve the original caller ID during secure call transfers with Twilio! You can achieve this by using the
CreateSIPParticipantRequest
API and setting the
sip_number
field to the original caller's number. This way, the recipient will see the correct caller ID, and your secure signaling (TLS/SRTP) stays intact. Here’s a simple way to do it: 1. First, configure your Twilio trunk to allow caller ID passthrough by setting
--transfer-caller-id from-transferee
. 2. Next, use
CreateSIPParticipantRequest
to start a new secure call, making sure to specify the original caller's number in the
sip_number
field. 3. Finally, double-check that your trunk is set up for TLS and SRTP to keep everything encrypted. This method helps you avoid using SIP REFER, which isn’t supported with TLS, while still meeting compliance and ensuring a smooth user experience. If you’d like, I’m here to help you with any part of the implementation—just let me know! Sources: Preserving Caller ID During SIP Transfers in LiveKit Agents | Transferring calls | LiveKit Docs | Secure trunking | LiveKit Docs