-
Notifications
You must be signed in to change notification settings - Fork 3
Add coturn integration #20
Conversation
- add coturn
@Kirguir , Нам нужно иметь два варианта запуска всех связанных приложений:
Для первого milestone достаточно первого варианта. Roadmap задачи обновил. |
т.е. надо в конфиг добавить секцию (или в server) с параметрами
username & credential - это уже к |
@Kirguir , Итого, по результатам обсуждения:
Значит в конфиг прокидывыаем:
|
# Conflicts: # src/api/client/server.rs
- add docker-compose with COTURN for offline dev
# Conflicts: # src/api/client/rpc_connection.rs # src/api/protocol.rs
# Conflicts: # Cargo.lock # Cargo.toml # proto/client-api/src/lib.rs # src/api/client/rpc_connection.rs # src/signalling/participants.rs # src/signalling/room.rs
# Conflicts: # config.toml # src/conf/mod.rs
bc5cb78
to
a29e0a1
Compare
Подтянул master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
Также, хочу отметить, что не компилируется jason.
/// Representation of [`iceServers`] field of [`RTCConfiguration`] dictionary. | ||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
#[cfg_attr(test, derive(PartialEq))] | ||
pub struct IceServer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
Требуется использовать conditional компиляцию по аналогии с другими структурами.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я так понял что при feature = "medea", derive(Serialize);
При "jason" - Deserialize
src/signalling/participants.rs
Outdated
|
||
pub mod test { | ||
use super::*; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
Тоже удаляйте, зачем пустому модулю висеть?
src/signalling/participants.rs
Outdated
self.room_id, | ||
self.members.iter().map(|(id, _)| *id).collect(), | ||
) | ||
.map_err(|_| ()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
То есть из базы Вы credentials'ы удаляете, но у нас (в Member.ice_user
) их оставляете? Не надо так.
pub enum ParticipantServiceErr { | ||
TurnServiceErr(TurnServiceErr), | ||
MailBoxErr(MailboxError), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
Прикрутите Fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я добавил, но я не совсем понимаю где его возвращать
remove_all_users_fut
возвращает ()
, чтобы потом запустить ctx.wait() в Handler в Room
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
#[allow(clippy::module_name_repetitions)] | ||
/// Manages Turn server credentials. | ||
pub trait TurnAuthService: fmt::Debug + Send { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
Давайте лучше: create()
, delete()
, delete_batch()
.
src/turn/repo.rs
Outdated
let client = redis::Client::open(connection_info.clone().into())?; | ||
let connection_manager = RedisConnectionManager::new(client)?; | ||
let mut runtime = | ||
tokio::runtime::Runtime::new().expect("Unable to create a runtime"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
А в каком случае тут ошибка вылетит?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, тут будет паника
Добавлю IOError в TurnDatabaseErr и верну его если не получилось запустить runtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
Так а ошибка тут в каком случае вылетает? Просто, это же у нас инициализация тред-пула, грубо говоря. Достаточно неожиданно, что эта операция может заошибить.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я думаю что если кончилась память для хранения этого пула или не удалось зарегистрировать пул в памяти
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
В этом случае можно не предполагать, а просто пройтись по исходникам и узнать наверняка :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В исходниках после вызова new я вижу возможные ошибки в tokio-reactor в let io = mio::Poll::new()
и io.register
=> ошибка может произойти если невозможно получить handle памяти
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nWacky ,
Обсудили, добавил тудушки.
У меня появилась пара вопросов:
|
@nWacky ,
Вы, вероятно, имеете в виду, что мы, при генерации
У него нет room_id. В текущей реализации, static IceUser прокидывается через конфиг Coturn'а. Соответственно, нам его не нужно его сохранять в redis'е.
Clippy говорит не о поле структуры IceUser, а о параметре функции |
jason/src/api/room.rs
Outdated
@@ -86,6 +86,7 @@ impl EventHandler for InnerRoom { | |||
_peer_id: u64, | |||
_sdp_offer: Option<String>, | |||
_tracks: Vec<Track>, | |||
_ice_servers: Vec<IceServer>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_
is preferred to user over _name
as allows compiler to opt-out those at all, while _name
just silences warnings.
FCM
|
Part of #10.
coturn_ip
,coturn_port
,coturn_user
,coturn_pass
.ice_servers
inPeerCreated
event.