m
hi
t
Thanks for reaching out, Rahib. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you out! Could you please share a bit more about your question or the issue you're experiencing? I'm here to support you every step of the way.
m
how is move_participant implemented in the livekit ?
t
I'm happy to help you understand the
MoveParticipant
functionality in LiveKit! This feature is implemented as a server-side RPC operation accessible through the
RoomService
interface. To use it, you'll need
roomAdmin
and
destinationRoom
permissions. Essentially, it lets you move a connected participant from one room to another by calling this method:
Copy code
MoveParticipant(context.Context, *MoveParticipantRequest) (*MoveParticipantResponse, error)
The
MoveParticipantRequest
requires three important fields: • Room: The current room where the participant is located. • Identity: The unique identity of the participant you want to move. • DestinationRoom: The room you want to move the participant to. This request is defined in the
livekit_room.proto
schema and is accessible via Twirp-based JSON and Protobuf HTTP endpoints. You can use the JSON endpoint at
/twirp/livekit.RoomService/MoveParticipant
. It’s also implemented using psRPC, where the participant’s identity acts as the routing topic, helping with efficient message delivery in distributed systems. When you execute this operation, the participant is removed from their current room and added to the destination room. Other participants will see the moved participant disconnect from the original room and join the new one. If your application listens for the
RoomEvent.Moved
event, it will receive the new
RoomInfo
, indicating the move has been completed successfully. If you have any questions or would like some guidance on implementing this, please don’t hesitate to ask—I’m here to help! Sources: livekit/livekit_room.pb.go | livekit/src/room/mod.rs | Rooms, participants, and tracks | LiveKit Docs | Agent-assisted warm transfer | LiveKit Docs | Managing participants | LiveKit Docs
m
why is this not available for self hosted environments ?
t
I wanted to let you know that the
MoveParticipant
feature isn’t available for self-hosted LiveKit environments. This is because it’s specifically designed for LiveKit Cloud and Private Cloud setups. The reason behind this is the architectural difference: LiveKit Cloud uses a globally distributed mesh SFU architecture, which makes moving participants across rooms on different edge servers smooth and easy. On the other hand, self-hosted deployments usually run as a single-home SFU, which doesn’t support this feature out of the box. If you have any more questions or if you’d like help exploring other options, please don’t hesitate to reach out—I’m here to help! Sources: livekit-api/livekit/api/room_service.py | LiveKit Cloud | LiveKit Docs
m
how would one implement this feature for self hosted environment if they have to ?
t
I’m happy to help you with implementing a feature similar to
MoveParticipant
in your self-hosted LiveKit environment! Since the built-in functionality is available only in LiveKit Cloud and Private Cloud deployments, you’ll need to handle participant movement manually. Here’s a friendly step-by-step approach you can try: 1. First, use the
RemoveParticipant
API to disconnect the participant from their current room. 2. Next, generate a new access token for the participant so they can join the destination room. 3. Finally, have the participant’s client use that new token to connect to the new room. This way, you can manage the participant’s state and help ensure a smooth transition between rooms. If you’d like, I’m here to guide you through any part of this process—just let me know! Sources: livekit-api/livekit/api/room_service.py | livekit/livekit_room.twirp.go | packages/livekit-server-sdk/src/RoomServiceClient.ts | Managing participants | LiveKit Docs
m
how will this work in telephony though ?
t
When it comes to telephony use cases, the
MoveParticipant
functionality is a great tool to smoothly transition a caller between different communication contexts—like moving them from an AI agent room to a human agent room. This can be super helpful for dynamic call routing, such as escalating a call from an IVR to a live agent or transferring between departments. For SIP integrations, LiveKit offers a
TransferSIPParticipant
API that uses SIP REFER to perform a cold transfer. This means it ends the LiveKit session and transfers the call to another phone number or SIP endpoint. It’s a bit different from
MoveParticipant
, which keeps the participant within LiveKit rooms but moves them around. If you’re working in a self-hosted environment, you’ll want to manually manage the participant’s state by disconnecting them from the current room and reconnecting them to the destination room with a new access token. If you’d like, I’m here to help with more details on how to do this—just let me know! Sources: Transferring calls | LiveKit Docs | packages/livekit-server-sdk/src/RoomServiceClient.ts | livekit/livekit_room.twirp.go
m
yeah so how will manually managing it work in telephony without disconnecting call ?
t
When it comes to telephony use cases, I completely understand that trying to implement a manual version of
MoveParticipant
without disconnecting the call in a self-hosted environment can feel quite tricky. This is because the built-in functionality is designed to keep the session continuous, which isn’t something self-hosted setups support out of the box. But don’t worry, here’s a potential way to approach it: 1. First, use the
RemoveParticipant
API to disconnect the participant from the current room. 2. Next, quickly generate a new access token so the participant can join the destination room. 3. Make sure your client application smoothly handles this transition by reconnecting to the new room without any noticeable interruption. That said, for telephony, this method might not fully capture the seamless experience that
MoveParticipant
offers in LiveKit Cloud, since the participant will experience a brief disconnection. To truly avoid that, you’d need to dive into custom signaling and state management to mimic session continuity, which can get a bit complex. If you’re aiming for a smoother, more seamless solution, LiveKit Cloud’s
MoveParticipant
feature is built just for this kind of scenario, keeping the participant’s session uninterrupted. I’m here to help if you want to explore that option or need any further guidance! Sources: packages/livekit-server-sdk/src/SipClient.ts | Agents telephony integration | LiveKit Docs | Managing participants | LiveKit Docs | Transferring calls | LiveKit Docs | Agent-assisted warm transfer | LiveKit Docs