expose TCPFallbackRTTThreshold and AllowUDPUnstableFallback via config (#4556)
This commit is contained in:
@@ -114,6 +114,12 @@ rtc:
|
|||||||
# allow_pause: true
|
# allow_pause: true
|
||||||
# # allows automatic connection fallback to TCP and TURN/TLS (if configured) when UDP has been unstable, default true
|
# # allows automatic connection fallback to TCP and TURN/TLS (if configured) when UDP has been unstable, default true
|
||||||
# allow_tcp_fallback: true
|
# allow_tcp_fallback: true
|
||||||
|
# # signaling RTT (in milliseconds) below which ICE/TCP is attempted on a UDP failure; at or above it,
|
||||||
|
# # supporting clients fall back directly to TURN/TLS. 0 (default) disables the check (ICE/TCP always tried).
|
||||||
|
# # a positive value also enables allow_udp_unstable_fallback.
|
||||||
|
# tcp_fallback_rtt_threshold: 0
|
||||||
|
# # migrate an established-but-lossy UDP connection to ICE/TCP or TURN/TLS. requires tcp_fallback_rtt_threshold > 0, default false
|
||||||
|
# allow_udp_unstable_fallback: false
|
||||||
# # number of packets to buffer in the SFU for video, defaults to 500
|
# # number of packets to buffer in the SFU for video, defaults to 500
|
||||||
# packet_buffer_size_video: 500
|
# packet_buffer_size_video: 500
|
||||||
# # number of packets to buffer in the SFU for audio, defaults to 200
|
# # number of packets to buffer in the SFU for audio, defaults to 200
|
||||||
|
|||||||
@@ -116,6 +116,18 @@ type RTCConfig struct {
|
|||||||
// allow TCP and TURN/TLS fallback
|
// allow TCP and TURN/TLS fallback
|
||||||
AllowTCPFallback *bool `yaml:"allow_tcp_fallback,omitempty"`
|
AllowTCPFallback *bool `yaml:"allow_tcp_fallback,omitempty"`
|
||||||
|
|
||||||
|
// Signaling RTT threshold (in milliseconds) governing ICE/TCP fallback. On a UDP
|
||||||
|
// failure, ICE/TCP is attempted only while the measured signaling RTT is below this
|
||||||
|
// value; at or above it, supporting clients fall back directly to TURN/TLS. When 0
|
||||||
|
// (the default), the RTT check is disabled and ICE/TCP is always attempted (for
|
||||||
|
// clients that support it). A positive value also gates allow_udp_unstable_fallback.
|
||||||
|
TCPFallbackRTTThreshold int `yaml:"tcp_fallback_rtt_threshold,omitempty"`
|
||||||
|
|
||||||
|
// When enabled, an established UDP connection reporting sustained high packet loss is
|
||||||
|
// migrated to ICE/TCP or TURN/TLS. Requires tcp_fallback_rtt_threshold to be set
|
||||||
|
// (> 0). Disabled by default.
|
||||||
|
AllowUDPUnstableFallback bool `yaml:"allow_udp_unstable_fallback,omitempty"`
|
||||||
|
|
||||||
// force a reconnect on a publication error
|
// force a reconnect on a publication error
|
||||||
ReconnectOnPublicationError *bool `yaml:"reconnect_on_publication_error,omitempty"`
|
ReconnectOnPublicationError *bool `yaml:"reconnect_on_publication_error,omitempty"`
|
||||||
|
|
||||||
|
|||||||
+30
-28
@@ -471,34 +471,36 @@ func (r *RoomManager) StartSession(
|
|||||||
}
|
}
|
||||||
|
|
||||||
participant, err = rtc.NewParticipant(rtc.ParticipantParams{
|
participant, err = rtc.NewParticipant(rtc.ParticipantParams{
|
||||||
Identity: pi.Identity,
|
Identity: pi.Identity,
|
||||||
Name: pi.Name,
|
Name: pi.Name,
|
||||||
SID: sid,
|
SID: sid,
|
||||||
Config: &rtcConf,
|
Config: &rtcConf,
|
||||||
Sink: responseSink,
|
Sink: responseSink,
|
||||||
AudioConfig: r.config.Audio,
|
AudioConfig: r.config.Audio,
|
||||||
VideoConfig: r.config.Video,
|
VideoConfig: r.config.Video,
|
||||||
LimitConfig: r.config.Limit,
|
LimitConfig: r.config.Limit,
|
||||||
ProtocolVersion: pv,
|
ProtocolVersion: pv,
|
||||||
SessionStartTime: sessionStartTime,
|
SessionStartTime: sessionStartTime,
|
||||||
SessionTimer: observability.NewSessionTimer(sessionStartTime),
|
SessionTimer: observability.NewSessionTimer(sessionStartTime),
|
||||||
TelemetryListener: room.ParticipantTelemetryListener(),
|
TelemetryListener: room.ParticipantTelemetryListener(),
|
||||||
Trailer: room.Trailer(),
|
Trailer: room.Trailer(),
|
||||||
PLIThrottleConfig: r.config.RTC.PLIThrottle,
|
PLIThrottleConfig: r.config.RTC.PLIThrottle,
|
||||||
CongestionControlConfig: r.config.RTC.CongestionControl,
|
CongestionControlConfig: r.config.RTC.CongestionControl,
|
||||||
PublishEnabledCodecs: enabledCodecs,
|
PublishEnabledCodecs: enabledCodecs,
|
||||||
SubscribeEnabledCodecs: enabledCodecs,
|
SubscribeEnabledCodecs: enabledCodecs,
|
||||||
Grants: pi.Grants,
|
Grants: pi.Grants,
|
||||||
Reconnect: pi.Reconnect,
|
Reconnect: pi.Reconnect,
|
||||||
Logger: pLogger,
|
Logger: pLogger,
|
||||||
Reporter: roomobs.NewNoopParticipantSessionReporter(),
|
Reporter: roomobs.NewNoopParticipantSessionReporter(),
|
||||||
ClientConf: clientConf,
|
ClientConf: clientConf,
|
||||||
ClientInfo: rtc.ClientInfo{ClientInfo: pi.Client},
|
ClientInfo: rtc.ClientInfo{ClientInfo: pi.Client},
|
||||||
Region: pi.Region,
|
Region: pi.Region,
|
||||||
AdaptiveStream: pi.AdaptiveStream,
|
AdaptiveStream: pi.AdaptiveStream,
|
||||||
AllowTCPFallback: allowFallback,
|
AllowTCPFallback: allowFallback,
|
||||||
TURNSEnabled: r.config.IsTURNSEnabled(),
|
TCPFallbackRTTThreshold: r.config.RTC.TCPFallbackRTTThreshold,
|
||||||
ParticipantListener: room.LocalParticipantListener(),
|
AllowUDPUnstableFallback: r.config.RTC.AllowUDPUnstableFallback,
|
||||||
|
TURNSEnabled: r.config.IsTURNSEnabled(),
|
||||||
|
ParticipantListener: room.LocalParticipantListener(),
|
||||||
ParticipantHelper: &roomManagerParticipantHelper{
|
ParticipantHelper: &roomManagerParticipantHelper{
|
||||||
room: room,
|
room: room,
|
||||||
codecRegressionThreshold: r.config.Video.CodecRegressionThreshold,
|
codecRegressionThreshold: r.config.Video.CodecRegressionThreshold,
|
||||||
|
|||||||
Reference in New Issue
Block a user