From b5fbabd64bf4f95dd9d371942004c9b3f1a69331 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Wed, 29 Jan 2014 17:11:18 +0100 Subject: [PATCH] Add "enable ipv6" setting in Network Conflicts: Classes/LinphoneCoreSettingsStore.m --- Classes/LinphoneCoreSettingsStore.m | 13 ++++++++++++- Settings/InAppSettings.bundle/Network.plist | 10 ++++++++++ .../InAppSettings.bundle/en.lproj/Network.strings | 3 +++ .../InAppSettings.bundle/fr.lproj/Network.strings | 3 +++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 460aaae33..6a91d6492 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -219,6 +219,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "animations_preference", 1) forKey:@"animations_preference"]; [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "wifi_only_preference", 0) forKey:@"wifi_only_preference"]; [self setString: lp_config_get_string(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "sharing_server_preference", NULL) forKey:@"sharing_server_preference"]; + + [self setBool:lp_config_get_int(linphone_core_get_config(lc), "sip", "use_ipv6", 0) forKey:@"use_ipv6"]; /*keep this one also in the standardUserDefaults so that it can be read before starting liblinphone*/ BOOL start_at_boot = TRUE; @@ -347,7 +349,15 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [LinphoneLogger logc:LinphoneLoggerError format:"cannot set transport"]; } } - + + BOOL enable_ipv6 = [self boolForKey:@"use_ipv6"]; + lp_config_set_int(linphone_core_get_config(lc), "sip", "use_ipv6", enable_ipv6); + if( linphone_core_ipv6_enabled(lc) != enable_ipv6){ + [LinphoneLogger logc:LinphoneLoggerDebug format:"%@ IPV6", enable_ipv6?@"ENABLING":@"DISABLING"]; + linphone_core_enable_ipv6(lc, enable_ipv6); + } + + //configure sip account //mandatory parameters @@ -496,6 +506,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); || [self valueChangedForKey:@"random_port_preference"] || [self valueChangedForKey:@"prefix_preference"] || [self valueChangedForKey:@"substitute_+_by_00_preference"] + || [self valueChangedForKey:@"use_ipv6"] || [self valueChangedForKey:@"pushnotification_preference"]; if (account_changed) diff --git a/Settings/InAppSettings.bundle/Network.plist b/Settings/InAppSettings.bundle/Network.plist index cfac45da1..f6224b9ad 100644 --- a/Settings/InAppSettings.bundle/Network.plist +++ b/Settings/InAppSettings.bundle/Network.plist @@ -124,6 +124,16 @@ tls + + Title + Use IPv6 + Key + use_ipv6 + Type + PSToggleSwitchSpecifier + DefaultValue + + DefaultValue None diff --git a/Settings/InAppSettings.bundle/en.lproj/Network.strings b/Settings/InAppSettings.bundle/en.lproj/Network.strings index 555c0b493..0d4466218 100644 --- a/Settings/InAppSettings.bundle/en.lproj/Network.strings +++ b/Settings/InAppSettings.bundle/en.lproj/Network.strings @@ -60,3 +60,6 @@ /* Download bandwidth */ "Download bandwidth" = "Download bandwidth"; + +/* IPv6 */ +"Use IPv6" = "Use IPv6"; \ No newline at end of file diff --git a/Settings/InAppSettings.bundle/fr.lproj/Network.strings b/Settings/InAppSettings.bundle/fr.lproj/Network.strings index 51e9f6ef5..ef05be608 100644 --- a/Settings/InAppSettings.bundle/fr.lproj/Network.strings +++ b/Settings/InAppSettings.bundle/fr.lproj/Network.strings @@ -60,3 +60,6 @@ /* Download bandwidth */ "Download bandwidth" = "Débit descendant"; + +/* IPv6 */ +"Use IPv6" = "Utiliser IPv6"; \ No newline at end of file