mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Add ipv6 reflectors
This commit is contained in:
parent
0a632393ce
commit
edc46167b3
@ -18,12 +18,19 @@ private func callConnectionDescription(_ connection: CallSessionConnection) -> O
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func callConnectionDescriptionWebrtc(_ connection: CallSessionConnection) -> OngoingCallConnectionDescriptionWebrtc? {
|
private func callConnectionDescriptionsWebrtc(_ connection: CallSessionConnection) -> [OngoingCallConnectionDescriptionWebrtc] {
|
||||||
switch connection {
|
switch connection {
|
||||||
case .reflector:
|
case .reflector:
|
||||||
return nil
|
return []
|
||||||
case let .webRtcReflector(reflector):
|
case let .webRtcReflector(reflector):
|
||||||
return OngoingCallConnectionDescriptionWebrtc(connectionId: reflector.id, hasStun: reflector.hasStun, hasTurn: reflector.hasTurn, ip: reflector.ip.isEmpty ? reflector.ipv6 : reflector.ip, port: reflector.port, username: reflector.username, password: reflector.password)
|
var result: [OngoingCallConnectionDescriptionWebrtc] = []
|
||||||
|
if !reflector.ip.isEmpty {
|
||||||
|
result.append(OngoingCallConnectionDescriptionWebrtc(connectionId: reflector.id, hasStun: reflector.hasStun, hasTurn: reflector.hasTurn, ip: reflector.ip, port: reflector.port, username: reflector.username, password: reflector.password))
|
||||||
|
}
|
||||||
|
if !reflector.ipv6.isEmpty {
|
||||||
|
result.append(OngoingCallConnectionDescriptionWebrtc(connectionId: reflector.id, hasStun: reflector.hasStun, hasTurn: reflector.hasTurn, ip: reflector.ipv6, port: reflector.port, username: reflector.username, password: reflector.password))
|
||||||
|
}
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,12 +594,7 @@ public final class OngoingCallContext {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
processedConnections.append(connection)
|
processedConnections.append(connection)
|
||||||
if let mapped = callConnectionDescriptionWebrtc(connection) {
|
filteredConnections.append(contentsOf: callConnectionDescriptionsWebrtc(connection))
|
||||||
if mapped.ip.isEmpty {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
filteredConnections.append(mapped)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let context = OngoingCallThreadLocalContextWebrtc(version: version, queue: OngoingCallThreadLocalContextQueueImpl(queue: queue), proxy: voipProxyServer, networkType: ongoingNetworkTypeForTypeWebrtc(initialNetworkType), dataSaving: ongoingDataSavingForTypeWebrtc(dataSaving), derivedState: derivedState.data, key: key, isOutgoing: isOutgoing, connections: filteredConnections, maxLayer: maxLayer, allowP2P: allowP2P, logPath: logPath, sendSignalingData: { [weak callSessionManager] data in
|
let context = OngoingCallThreadLocalContextWebrtc(version: version, queue: OngoingCallThreadLocalContextQueueImpl(queue: queue), proxy: voipProxyServer, networkType: ongoingNetworkTypeForTypeWebrtc(initialNetworkType), dataSaving: ongoingDataSavingForTypeWebrtc(dataSaving), derivedState: derivedState.data, key: key, isOutgoing: isOutgoing, connections: filteredConnections, maxLayer: maxLayer, allowP2P: allowP2P, logPath: logPath, sendSignalingData: { [weak callSessionManager] data in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user