Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nanpa/forward-participant.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
minor type="added" "Implement Forward Participant API"
3 changes: 3 additions & 0 deletions livekit-api/src/access_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ pub struct VideoGrants {
pub room_join: bool,
#[serde(default)]
pub room: String,
#[serde(default)]
pub destination_room: String,

// permissions within a room
#[serde(default = "default_true")]
Expand Down Expand Up @@ -102,6 +104,7 @@ impl Default for VideoGrants {
room_admin: false,
room_join: false,
room: "".to_string(),
destination_room: "".to_string(),
can_publish: true,
can_subscribe: true,
can_publish_data: true,
Expand Down
8 changes: 8 additions & 0 deletions livekit-api/src/services/egress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ impl EgressClient {
image_outputs,
output: None, // Deprecated
await_start_signal: options.await_start_signal,
// TODO: egress webhooks
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
Expand Down Expand Up @@ -184,6 +186,8 @@ impl EgressClient {
stream_outputs,
segment_outputs,
image_outputs,
// TODO: egress webhooks
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
Expand Down Expand Up @@ -215,6 +219,8 @@ impl EgressClient {
segment_outputs,
image_outputs,
output: None, // Deprecated
// TODO: egress webhooks
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
Expand Down Expand Up @@ -244,6 +250,8 @@ impl EgressClient {
}
},
track_id: track_id.to_string(),
// TODO: egress webhooks
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
Expand Down
20 changes: 20 additions & 0 deletions livekit-api/src/services/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,26 @@ impl RoomClient {
.map_err(Into::into)
}

pub async fn forward_participant(
&self,
room: &str,
identity: &str,
destination_room: &str,
) -> ServiceResult<(proto::ForwardParticipantResponse)> {
self.client
.request(
SVC,
"ForwardParticipant",
proto::ForwardParticipantRequest{ room: room.to_owned(), identity: identity.to_owned(), destination_room: destination_room.to_owned() },
self.base.auth_header(
VideoGrants { room_admin: true, room: room.to_owned(), destination_room: destination_room.to_owned(), ..Default::default() },
None,
)?,
)
.await
.map_err(Into::into)
}

pub async fn mute_published_track(
&self,
room: &str,
Expand Down
22 changes: 11 additions & 11 deletions livekit-api/src/services/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,17 +346,17 @@ impl SIPClient {
SVC,
"CreateSIPDispatchRule",
proto::CreateSipDispatchRuleRequest {
name: options.name,
metadata: options.metadata,
attributes: options.attributes,
trunk_ids: options.trunk_ids.to_owned(),
inbound_numbers: options.allowed_numbers.to_owned(),
hide_phone_number: options.hide_phone_number,
rule: Some(proto::SipDispatchRule { rule: Some(rule.to_owned()) }),

// TODO: support these attributes
room_preset: Default::default(),
room_config: Default::default(),
dispatch_rule: Some(proto::SipDispatchRuleInfo {
name: options.name,
metadata: options.metadata,
attributes: options.attributes,
trunk_ids: options.trunk_ids.to_owned(),
inbound_numbers: options.allowed_numbers.to_owned(),
hide_phone_number: options.hide_phone_number,
rule: Some(proto::SipDispatchRule { rule: Some(rule.to_owned()) }),
..Default::default()
}),
..Default::default()
},
self.base.auth_header(
Default::default(),
Expand Down
2 changes: 2 additions & 0 deletions livekit-ffi/protocol/participant.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,6 @@ enum DisconnectReason {
USER_REJECTED = 12;
// SIP protocol failure or unexpected response
SIP_TRUNK_FAILURE = 13;
// server timed out a participant session
ConnectionTimeout = 14;
}
1 change: 1 addition & 0 deletions livekit-ffi/src/conversion/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ impl From<DisconnectReason> for proto::DisconnectReason {
DisconnectReason::UserUnavailable => proto::DisconnectReason::UserUnavailable,
DisconnectReason::UserRejected => proto::DisconnectReason::UserRejected,
DisconnectReason::SipTrunkFailure => proto::DisconnectReason::SipTrunkFailure,
DisconnectReason::ConnectionTimeout => proto::DisconnectReason::ConnectionTimeout,
}
}
}
1 change: 1 addition & 0 deletions livekit-ffi/src/conversion/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ impl From<DisconnectReason> for proto::DisconnectReason {
DisconnectReason::UserUnavailable => Self::UserUnavailable,
DisconnectReason::UserRejected => Self::UserRejected,
DisconnectReason::SipTrunkFailure => Self::SipTrunkFailure,
DisconnectReason::ConnectionTimeout => Self::ConnectionTimeout,
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions livekit-ffi/src/livekit.proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,8 @@ pub enum DisconnectReason {
UserRejected = 12,
/// SIP protocol failure or unexpected response
SipTrunkFailure = 13,
/// server timed out a participant session
ConnectionTimeout = 14,
}
impl DisconnectReason {
/// String value of the enum field names used in the ProtoBuf definition.
Expand All @@ -1716,6 +1718,7 @@ impl DisconnectReason {
DisconnectReason::UserUnavailable => "USER_UNAVAILABLE",
DisconnectReason::UserRejected => "USER_REJECTED",
DisconnectReason::SipTrunkFailure => "SIP_TRUNK_FAILURE",
DisconnectReason::ConnectionTimeout => "ConnectionTimeout",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand All @@ -1735,6 +1738,7 @@ impl DisconnectReason {
"USER_UNAVAILABLE" => Some(Self::UserUnavailable),
"USER_REJECTED" => Some(Self::UserRejected),
"SIP_TRUNK_FAILURE" => Some(Self::SipTrunkFailure),
"ConnectionTimeout" => Some(Self::ConnectionTimeout),
_ => None,
}
}
Expand Down
2 changes: 1 addition & 1 deletion livekit-protocol/protocol
Submodule protocol updated 97 files
+5 −0 .changeset/blue-birds-add.md
+0 −5 .changeset/chilly-years-obey.md
+6 −0 .changeset/clever-jars-invent.md
+6 −0 .changeset/nervous-ways-yawn.md
+5 −0 .changeset/olive-tools-decide.md
+6 −0 .changeset/popular-dodos-study.md
+5 −0 .changeset/pretty-gifts-look.md
+5 −0 .changeset/real-rockets-rescue.md
+0 −5 .changeset/red-dogs-love.md
+0 −6 .changeset/sip-dispatch-info.md
+0 −6 .changeset/sip-domain-attr.md
+5 −0 .changeset/sip-status-helper.md
+2 −2 .changeset/sip-transfer-timeout.md
+1 −1 .changeset/sip-update-fix.md
+5 −0 .changeset/thick-pots-cheat.md
+6 −0 .changeset/thick-rivers-mate.md
+6 −0 .changeset/thirty-cougars-dream.md
+5 −0 .changeset/tricky-ties-marry.md
+36 −0 CHANGELOG.md
+5 −0 auth/accesstoken.go
+33 −0 auth/grants.go
+61 −0 egress/notify_options.go
+31 −59 infra/link.pb.go
+5 −2 ingress/token.go
+4 −0 livekit/attrs.go
+118 −210 livekit/livekit_agent.pb.go
+40 −75 livekit/livekit_agent_dispatch.pb.go
+261 −510 livekit/livekit_analytics.pb.go
+1,824 −0 livekit/livekit_cloud_agent.pb.go
+3,103 −0 livekit/livekit_cloud_agent.twirp.go
+503 −796 livekit/livekit_egress.pb.go
+202 −199 livekit/livekit_egress.twirp.go
+156 −291 livekit/livekit_ingress.pb.go
+512 −354 livekit/livekit_internal.pb.go
+56 −137 livekit/livekit_metrics.pb.go
+1,008 −1,130 livekit/livekit_models.pb.go
+259 −277 livekit/livekit_room.pb.go
+371 −86 livekit/livekit_room.twirp.go
+275 −576 livekit/livekit_rtc.pb.go
+1,290 −1,070 livekit/livekit_sip.pb.go
+1,216 −351 livekit/livekit_sip.twirp.go
+21 −39 livekit/livekit_webhook.pb.go
+304 −0 livekit/sip.go
+135 −0 livekit/sip_test.go
+55 −0 livekit/types.go
+4 −44 logger/medialogutils/cmd.go
+1 −0 magefile.go
+1 −1 package.json
+36 −0 packages/javascript/CHANGELOG.md
+1 −1 packages/javascript/package.json
+190 −0 protobufs/livekit_cloud_agent.proto
+21 −0 protobufs/livekit_egress.proto
+58 −19 protobufs/livekit_internal.proto
+29 −7 protobufs/livekit_models.proto
+17 −0 protobufs/livekit_room.proto
+70 −10 protobufs/livekit_sip.proto
+1 −1 protobufs/livekit_webhook.proto
+10 −0 protobufs/rpc/participant.proto
+3 −0 protobufs/rpc/sip.proto
+4 −15 psrpc/errors.go
+1 −1 replay/cloud_replay.pb.go
+30 −68 rpc/agent.pb.go
+11 −32 rpc/agent_dispatch.pb.go
+8 −27 rpc/analytics.pb.go
+29 −71 rpc/egress.pb.go
+51 −113 rpc/ingress.pb.go
+136 −298 rpc/io.pb.go
+9 −17 rpc/keepalive.pb.go
+29 −54 rpc/participant.pb.go
+42 −20 rpc/participant.psrpc.go
+12 −29 rpc/room.pb.go
+8 −18 rpc/roommanager.pb.go
+85 −0 rpc/rpcfakes/fake_typed_participant_client.go
+16 −36 rpc/signal.pb.go
+5 −4 rpc/sip.go
+87 −178 rpc/sip.pb.go
+62 −62 rpc/sip.psrpc.go
+573 −13 sdp/sdp.go
+185 −0 sdp/sdp_test.go
+33 −0 sip/sip.go
+7 −0 utils/error.go
+21 −17 utils/guid/id.go
+10 −0 utils/hwstats/cpu.go
+1 −0 utils/hwstats/cpu_null.go
+41 −0 utils/hwstats/memory.go
+33 −0 utils/hwstats/memory_all.go
+160 −0 utils/hwstats/memory_linux.go
+21 −0 utils/hwstats/memory_nonlinux.go
+21 −17 utils/id.go
+35 −6 utils/promise.go
+42 −0 utils/promise_test.go
+45 −0 webhook/filter.go
+270 −14 webhook/notifier.go
+121 −0 webhook/resource_queue.go
+368 −0 webhook/resource_url_notifier.go
+80 −172 webhook/url_notifier.go
+648 −15 webhook/webhook_test.go
Loading
Loading