Add AVPF setting in the Proxy config section.

Also setup a migration for linphone.org accounts
This commit is contained in:
Guillaume BIENKOWSKI 2014-06-12 11:26:50 +02:00
parent 574a24264b
commit 6ba957dbcb
3 changed files with 64 additions and 29 deletions

View file

@ -111,6 +111,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
[self setBool: (linphone_proxy_config_get_route(cfg)!=NULL) forKey:@"outbound_proxy_preference"];
[self setBool:linphone_proxy_config_get_dial_escape_plus(cfg) forKey:@"substitute_+_by_00_preference"];
[self setBool:linphone_proxy_config_is_avpf_enabled(cfg) forKey:@"avpf_preference"];
}
} else {
@ -121,6 +122,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
[self setObject:@"" forKey:@"password_preference"];
[self setBool:FALSE forKey:@"outbound_proxy_preference"];
[self setString:"udp" forKey:@"transport_preference"];
[self setBool:FALSE forKey:@"avpf_preference"];
}
@ -326,6 +328,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
linphone_core_enable_ipv6(lc, enable_ipv6);
}
//configure sip account
//mandatory parameters
@ -334,7 +337,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
NSString* transport = [self stringForKey:@"transport_preference"];
NSString* accountHa1 = [self stringForKey:@"ha1_preference"];
NSString* accountPassword = [self stringForKey:@"password_preference"];
bool isOutboundProxy = [self boolForKey:@"outbound_proxy_preference"];
bool isOutboundProxy = [self boolForKey:@"outbound_proxy_preference"];
BOOL use_avpf = [self boolForKey:@"avpf_preference"];
//clear auth info list
linphone_core_clear_all_auth_info(lc);
@ -377,6 +381,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
linphone_proxy_config_set_identity(proxyCfg, identity);
linphone_proxy_config_set_server_addr(proxyCfg, proxy);
linphone_proxy_config_enable_register(proxyCfg, true);
linphone_proxy_config_enable_avpf(proxyCfg, use_avpf);
// add username password
LinphoneAddress *from = linphone_address_new(identity);
@ -485,6 +491,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|| [self valueChangedForKey:@"prefix_preference"]
|| [self valueChangedForKey:@"substitute_+_by_00_preference"]
|| [self valueChangedForKey:@"use_ipv6"]
|| [self valueChangedForKey:@"avpf_preference"]
|| [self valueChangedForKey:@"pushnotification_preference"];
if (account_changed)

View file

@ -1093,6 +1093,24 @@ static LinphoneCoreVTable linphonec_vtable = {
linphone_core_set_chat_database_path(theLinphoneCore, [chatDBFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
}
/* AVPF migration */
if( [self lpConfigBoolForKey:@"avpf_migration_done" forSection:@"app"] == FALSE ){
const MSList* proxies = linphone_core_get_proxy_config_list(theLinphoneCore);
while(proxies){
LinphoneProxyConfig* proxy = (LinphoneProxyConfig*)proxies->data;
const char* addr = linphone_proxy_config_get_addr(proxy);
// we want to enable AVPF for the proxies
if( addr && strstr(addr, "sip.linphone.org") != 0 ){
linphone_proxy_config_enable_avpf(proxy, TRUE);
}
proxies = proxies->next;
}
[self lpConfigSetBool:TRUE forKey:@"avpf_migration_done"];
} else {
;
}
[self setupNetworkReachabilityCallback];
NSString* path = [LinphoneManager bundleFile:@"nowebcamCIF.jpg"];

View file

@ -113,12 +113,22 @@
</array>
</dict>
<dict>
<key>Title</key>
<string>Outbound proxy</string>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>outbound_proxy_preference</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>Title</key>
<string>Outbound proxy</string>
<string>AVPF</string>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>avpf_preference</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
@ -158,34 +168,34 @@
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>call_menu</string>
<key>File</key>
<string>Call</string>
<key>Title</key>
<string>Call</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>network_menu</string>
<key>File</key>
<string>Network</string>
<key>Title</key>
<string>Network</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>tunnel_menu</string>
<key>File</key>
<string>Tunnel</string>
<key>Title</key>
<string>Tunnel</string>
<key>Type</key>
<key>Key</key>
<string>call_menu</string>
<key>File</key>
<string>Call</string>
<key>Title</key>
<string>Call</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>network_menu</string>
<key>File</key>
<string>Network</string>
<key>Title</key>
<string>Network</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>tunnel_menu</string>
<key>File</key>
<string>Tunnel</string>
<key>Title</key>
<string>Tunnel</string>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
</dict>
<dict>