``` async def transfer_sip_participant( ...
# ask-ai
n
Copy code
async def transfer_sip_participant(
        self, transfer: TransferSIPParticipantRequest
    ) -> SIPParticipantInfo:
        """Transfer a SIP participant to a different room.

        Args:
            transfer: Request containing transfer details

        Returns:
            Updated SIP participant information
        """
        return await self._client.request(
            SVC,
            "TransferSIPParticipant",
            transfer,
            self._auth_header(
                VideoGrants(
                    room_admin=True,
                    room=transfer.room_name,
                ),
                sip=SIPGrants(call=True),
            ),
            SIPParticipantInfo,
        )
what does above
transfer_sip_participant
do ?
✅ 1
t
Thanks for reaching out, Darshak. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’ll explain what the
transfer_sip_participant
function does and the important details to know. What this function does • It initiates a SIP transfer (a cold transfer using SIP REFER) for a SIP participant who is currently in a LiveKit room. • It sends a request to the LiveKit service method named "TransferSIPParticipant" with a
TransferSIPParticipantRequest
payload and returns the updated
SIPParticipantInfo
. Key inputs and behaviour • Parameter:
transfer
is a
TransferSIPParticipantRequest
that includes fields such as
room_name
,
participant_identity
, and
transfer_to
(a SIP or tel: URI that the call should be redirected to). It may include optional flags like
play_dialtone
. • Permissions: The call is authorized with a token granting
room_admin=True
for the target room and SIP call privileges (
sip=SIPGrants(call=True)
), so the caller must have room-admin level rights to perform the transfer. • Transfer semantics: The transfer is performed via SIP REFER and redirects the participant’s call to the external destination. The call is transferred outside LiveKit (the participant leaves the LiveKit media session and connects to the external SIP/phone endpoint). • Return value: On success the method returns a
SIPParticipantInfo
object reflecting the participant’s updated state after the transfer. When you’d use it • To move a caller out of LiveKit and into an external IVR, payment gateway, or a third-party contact center (for example, Genesys or Five9). • To hand off calls to PSTN/SIP endpoints specified by a SIP or tel URI. If you want, I can: • Walk through the fields of
TransferSIPParticipantRequest
and what to set for common transfer targets. • Show an example
TransferSIPParticipantRequest
payload. • Explain how to confirm the participant’s final state using the returned
SIPParticipantInfo
. Which follow-up would you like? Sources: Agents telephony integration | LiveKit Documentation | Pass UUI data to Genesys Cloud during SIP transfers | LiveKit | server-sdk-kotlin | livekit/livekit_composite | DeepWiki | Handling payments with PCI compliance | LiveKit | How to do call transfers with Five9 | LiveKit, with interactive elements
n
can i transfer sip participant to Teams ?
t
Thanks — I’m responding to your question about whether you can transfer a SIP participant to Microsoft Teams using
transfer_sip_participant
. Short answer • Yes — in principle you can transfer a SIP participant to Teams because
transfer_sip_participant
issues a SIP REFER to a SIP or tel: URI, and Teams can accept calls routed via a SIP trunk or Direct Routing that supports REFER. • LiveKit does not list Microsoft Teams as a specifically tested/guaranteed target, so success depends on your SIP trunk and Teams configuration. What needs to be true for the transfer to work • The destination you pass in
transfer_to
must be a SIP or tel: URI that ultimately routes to Teams (for example, via your PSTN provider or Direct Routing gateway). • The SIP trunk/gateway between LiveKit and Teams must accept SIP REFER transfers and be configured to forward them to the Teams environment. • Caller ID, SDP, and other SIP headers must be compatible with the Teams setup (some gateways require specific header formats or caller-ID preservation settings). • The trunk/gateway must allow calls from the source IP/host used by your LiveKit SIP gateway (allow-listing or similar). Common obstacles • Some PSTN/SIP providers or Teams Direct Routing setups do not accept REFER or require special handling for transfers. • Teams may require particular header fields, caller ID formats, or authentication that need matching in the SIP path. • If the transfer endpoint is a tel: URI, the intermediary PSTN provider must bridge the SIP REFER to the phone network and route into Teams. How I can help next • If you already have a Teams Direct Routing or SIP trunk in place, tell me: ◦ the form of the URI you plan to use for
transfer_to
(example:
sip:user@your-gateway.com
or
tel:+1555...
), and ◦ whether your SIP trunk/gateway supports SIP REFER and accepts calls into Teams. • If you don’t have a trunk yet, I can outline the exact SIP behaviors to verify with your PSTN/provider or Teams admin (REFER support, caller-ID rules, allowed sources, SDP expectations), or give an example
TransferSIPParticipantRequest
payload to test. Which would you like to do next — test a specific URI now, or get a checklist of SIP/gateway requirements to share with your Teams/trunk provider? Sources: Company directory phone assistant | LiveKit Documentation | Agents telephony integration | LiveKit Documentation | How to do call transfers with Five9 | LiveKit | Preserve caller ID during SIP transfers with Twilio | LiveKit | Preserving Caller ID During SIP Transfers in LiveKit Agents, with interactive elements