Skip to content

Commit

Permalink
Get Turn server info v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Oct 26, 2024
1 parent 2801e30 commit 0a21f26
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/push_service/calling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,28 @@ impl PushService {
.json()
.await?)
}

pub async fn get_turn_server_info_v2(
&mut self,
) -> Result<Vec<TurnServerInfo>, ServiceError> {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct GetRelaysResponse {
relays: Vec<TurnServerInfo>,
}

Ok(self
.request(
Method::GET,
Endpoint::service("/v2/calling/relays"),
HttpAuthOverride::NoOverride,
)?
.send()
.await?
.service_error_for_status()
.await?
.json::<GetRelaysResponse>()
.await?
.relays)
}
}

0 comments on commit 0a21f26

Please sign in to comment.