@@ -201,6 +201,20 @@ var (
201201 roomFlag ,
202202 },
203203 },
204+ {
205+ Name : "forward" ,
206+ Usage : "Forward a participant to a different room" ,
207+ Before : createRoomClient ,
208+ Action : forwardParticipant ,
209+ Flags : []cli.Flag {
210+ roomFlag ,
211+ identityFlag ,
212+ & cli.StringFlag {
213+ Name : "destination-room" ,
214+ Usage : "`NAME` of the destination room" ,
215+ },
216+ },
217+ },
204218 {
205219 Name : "update" ,
206220 Usage : "Change the metadata and permissions for a room participant" ,
@@ -1020,6 +1034,27 @@ func removeParticipant(ctx context.Context, cmd *cli.Command) error {
10201034 return nil
10211035}
10221036
1037+ func forwardParticipant (ctx context.Context , cmd * cli.Command ) error {
1038+ roomName , identity := participantInfoFromArgOrFlags (cmd )
1039+ destinationRoomName := cmd .String ("destination-room" )
1040+ if destinationRoomName == "" {
1041+ return fmt .Errorf ("destination-room is required" )
1042+ }
1043+
1044+ _ , err := roomClient .ForwardParticipant (ctx , & livekit.ForwardParticipantRequest {
1045+ Room : roomName ,
1046+ Identity : identity ,
1047+ DestinationRoom : destinationRoomName ,
1048+ })
1049+ if err != nil {
1050+ return err
1051+ }
1052+
1053+ fmt .Println ("successfully forwarded participant" , identity , "from" , roomName , "to" , destinationRoomName )
1054+
1055+ return nil
1056+ }
1057+
10231058func muteTrack (ctx context.Context , cmd * cli.Command ) error {
10241059 roomName , identity := participantInfoFromFlags (cmd )
10251060 muted := cmd .Bool ("mute" ) || ! cmd .Bool ("unmute" )
0 commit comments