diff --git a/AUTHORS b/AUTHORS index 4d43519bda..590a4c0874 100644 --- a/AUTHORS +++ b/AUTHORS @@ -58,6 +58,7 @@ Silviu Caragea Stefan Gula Steve Reid Tarun Chawla +Uladzislau Susha Vladimir Beloborodov Vicken Simonian Victor Costan diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.h b/sdk/objc/api/peerconnection/RTCConfiguration.h index 9f41fd28d2..fcaa07a4f5 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.h +++ b/sdk/objc/api/peerconnection/RTCConfiguration.h @@ -92,6 +92,19 @@ RTC_OBJC_EXPORT @property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy; @property(nonatomic, assign) RTCContinualGatheringPolicy continualGatheringPolicy; +/** If set to YES, don't gather IPv6 ICE candidates. + * Default is NO. + */ +@property(nonatomic, assign) BOOL disableIPV6; + +/** If set to YES, don't gather IPv6 ICE candidates on Wi-Fi. + * Only intended to be used on specific devices. Certain phones disable IPv6 + * when the screen is turned off and it would be better to just disable the + * IPv6 ICE candidates on Wi-Fi in those cases. + * Default is NO. + */ +@property(nonatomic, assign) BOOL disableIPV6OnWiFi; + /** By default, the PeerConnection will use a limited number of IPv6 network * interfaces, in order to avoid too many ICE candidate pairs being created * and delaying ICE completion. diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.mm b/sdk/objc/api/peerconnection/RTCConfiguration.mm index c17ce24ae4..83f32b4c12 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.mm +++ b/sdk/objc/api/peerconnection/RTCConfiguration.mm @@ -31,6 +31,8 @@ @synthesize tcpCandidatePolicy = _tcpCandidatePolicy; @synthesize candidateNetworkPolicy = _candidateNetworkPolicy; @synthesize continualGatheringPolicy = _continualGatheringPolicy; +@synthesize disableIPV6 = _disableIPV6; +@synthesize disableIPV6OnWiFi = _disableIPV6OnWiFi; @synthesize maxIPv6Networks = _maxIPv6Networks; @synthesize disableLinkLocalNetworks = _disableLinkLocalNetworks; @synthesize audioJitterBufferMaxPackets = _audioJitterBufferMaxPackets; @@ -88,6 +90,8 @@ config.continual_gathering_policy; _continualGatheringPolicy = [[self class] continualGatheringPolicyForNativePolicy:nativePolicy]; + _disableIPV6 = config.disable_ipv6; + _disableIPV6OnWiFi = config.disable_ipv6_on_wifi; _maxIPv6Networks = config.max_ipv6_networks; _disableLinkLocalNetworks = config.disable_link_local_networks; _audioJitterBufferMaxPackets = config.audio_jitter_buffer_max_packets; @@ -129,9 +133,9 @@ } - (NSString *)description { - static NSString *formatString = - @"RTCConfiguration: " - @"{\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%@\n%@\n%d\n%d\n%d\n%@\n}\n"; + static NSString *formatString = @"RTCConfiguration: " + @"{\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n" + @"%d\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%@\n}\n"; return [NSString stringWithFormat:formatString, @@ -153,6 +157,8 @@ _iceCheckMinInterval, _iceRegatherIntervalRange, _disableLinkLocalNetworks, + _disableIPV6, + _disableIPV6OnWiFi, _maxIPv6Networks, _activeResetSrtpParams, _useMediaTransport]; @@ -181,6 +187,8 @@ nativeCandidateNetworkPolicyForPolicy:_candidateNetworkPolicy]; nativeConfig->continual_gathering_policy = [[self class] nativeContinualGatheringPolicyForPolicy:_continualGatheringPolicy]; + nativeConfig->disable_ipv6 = _disableIPV6; + nativeConfig->disable_ipv6_on_wifi = _disableIPV6OnWiFi; nativeConfig->max_ipv6_networks = _maxIPv6Networks; nativeConfig->disable_link_local_networks = _disableLinkLocalNetworks; nativeConfig->audio_jitter_buffer_max_packets = _audioJitterBufferMaxPackets;