can livekit do cold transfer with SIP REFER, but w...
# ask-ai
o
can livekit do cold transfer with SIP REFER, but with SIP URI? https://docs.livekit.io/sip/transfer-cold/ here the only option shown as example is: transfer_to = 'tel:+14155550100'
t
Thanks for reaching out, Jaivarsan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking whether LiveKit's cold transfer (SIP REFER) can use a SIP URI instead of the tel: example shown. Yes — LiveKit supports cold transfers to a SIP URI. Use the
transfer_to
parameter with either an E.164 telephone URI (
tel:+14155550100
) or a SIP URI (
sip:user@domain
), for example: •
sip:alice@example.com
•
sip:+15105550100@sip.telnyx.com
If you want, tell me which SDK/language you're using (Node, Python, or direct API) and the exact SIP URI form you plan to use, and I’ll provide a concrete example. Sources: SIP APIs | LiveKit docs | SIP overview | LiveKit docs | Using Wavix to accept and make calls | LiveKit docs | Call forwarding | LiveKit docs
o
python
t
You're using Python — below is a concise example showing how to perform a cold transfer (SIP REFER) to a SIP URI using LiveKit's TransferSIPParticipant API. Replace the placeholders with your room name, participant identity, and the target SIP URI.
Copy code
from livekit_client import RoomServiceClient, TransferSIPParticipantRequest

# Instantiate RoomServiceClient with your LiveKit server URL and API key/secret
client = RoomServiceClient(
    base_url="https://your-livekit-server",
    api_key="LIVEKIT_API_KEY",
    api_secret="LIVEKIT_API_SECRET"
)

room_name = "your_room"
participant_identity = "participant_identity"

# SIP URI target examples:
# sip:alice@example.com
# sip:+15105550100@sip.telnyx.com
transfer_to = "sip:alice@example.com"

req = TransferSIPParticipantRequest(
    room=room_name,
    participant_identity=participant_identity,
    transfer_to=transfer_to
)

resp = client.transfer_sip_participant(req)
print("Transfer initiated:", resp)
If you want, tell me: • the exact SIP URI format you plan to use (user@domain vs. phone@host), and • whether you need an example using authentication headers or a specific SIP gateway — I’ll adapt the snippet.
o
how does SIP REFER work with an IP? it should be just sent back to the same IP but with different extension right?
t
You're asking whether a SIP REFER to an IP simply returns to the same IP with a different extension. It does not. • SIP REFER contains a Refer-To header with the target URI (e.g.,
sip:alice@host
or
tel:+15105550100
). • LiveKit sends the REFER to your SIP trunk/provider (not directly to an IP you control). The provider reads
Refer-To
and performs a new INVITE to that URI. • That means the new call leg can be to any endpoint the provider can reach (another SIP domain, a PSTN number, or an IP-based SIP URI). It does not implicitly reuse the original caller's IP and change only an "extension." • If you want to target an IP-based SIP URI, use a full SIP URI with host/IP and optional user/port, e.g.
sip:100@203.0.113.5
or
sip:alice@203.0.113.5:5060
. The provider will attempt to route to that address when processing the REFER. If you want, tell me the exact SIP URI format you plan to use (user@IP, phone@SIP-gateway, port included, or a domain) and your SIP provider/gateway — I’ll explain any provider-specific routing considerations or give a concrete example. Sources: Company directory phone assistant | LiveKit docs | Using Wavix to accept and make calls | LiveKit docs | Call forwarding | LiveKit docs