Implement turn server settings

this fills out the infos in /_matrix/client/r0/voip/turnServer with
values specified in the server config
This commit is contained in:
Moritz Bitsch 2021-10-01 15:53:16 +02:00
parent 24a835647c
commit 109892b4b7
3 changed files with 35 additions and 7 deletions

View file

@ -74,6 +74,14 @@ pub struct Config {
trusted_servers: Vec<Box<ServerName>>,
#[serde(default = "default_log")]
pub log: String,
#[serde(default)]
turn_username: String,
#[serde(default)]
turn_password: String,
#[serde(default = "Vec::new")]
turn_uris: Vec<String>,
#[serde(default = "default_turn_ttl")]
turn_ttl: u64,
#[serde(flatten)]
catchall: BTreeMap<String, IgnoredAny>,
@ -131,6 +139,10 @@ fn default_log() -> String {
"info,state_res=warn,rocket=off,_=off,sled=off".to_owned()
}
fn default_turn_ttl() -> u64 {
60 * 60 * 24
}
#[cfg(feature = "sled")]
pub type Engine = abstraction::sled::Engine;