[Fix] Calls, Spelling

This commit is contained in:
Alex Emmet 2026-05-03 15:02:15 +02:00
commit fc85e9377e
10 changed files with 246 additions and 177 deletions

View file

@ -1,3 +1,4 @@
use livekit_api::services::room::CreateRoomOptions;
use livekit_api::{
access_token::{self},
services::room::RoomClient,
@ -35,6 +36,20 @@ pub fn get_livekit() -> Result<(String, String, String), ()> {
Ok((hostname, api_key, api_secret))
}
pub async fn create_room(call_id: Uuid) -> Result<(), ()> {
let (hostname, api_key, api_secret) = get_livekit()?;
let room_service = RoomClient::with_api_key(&hostname, &api_key, &api_secret);
let options = CreateRoomOptions::default();
room_service
.create_room(&call_id.to_string(), options)
.await
.map_err(|_| ())?;
Ok(())
}
pub fn create_token(user_id: u64, call_id: Uuid, has_admin: bool) -> Result<String, ()> {
let (_, api_key, api_secret) = get_livekit()?;