diff --git a/libsignal-service/src/push_service.rs b/libsignal-service/src/push_service.rs index 4724ce81f..99ee2896f 100644 --- a/libsignal-service/src/push_service.rs +++ b/libsignal-service/src/push_service.rs @@ -314,6 +314,16 @@ pub enum VerificationTransport { Voice, } +#[derive(Debug, Clone, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TurnServerInfo { + pub username: String, + pub password: String, + pub hostname: String, + pub urls: Vec, + pub urls_with_ips: Vec, +} + impl VerificationTransport { pub fn as_str(&self) -> &str { match self { @@ -1407,4 +1417,16 @@ pub trait PushService: MaybeSend { .await?; Ok(res) } + + async fn get_turn_server_info( + &mut self, + ) -> Result { + self.get_json( + Endpoint::Service, + "/v1/calling/relays", + &[], + HttpAuthOverride::NoOverride, + ) + .await + } }