mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
takes default expire from linphonerc
This commit is contained in:
parent
d10205ebc3
commit
3c3ad88b84
4 changed files with 12 additions and 5 deletions
|
|
@ -102,7 +102,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
|
||||
[self setString: linphone_address_get_username(addr) forKey:@"username_preference"];
|
||||
[self setString: linphone_address_get_domain(addr) forKey:@"domain_preference"];
|
||||
[self setInteger: lp_config_get_int(linphone_core_get_config(lc),"app","default_expires",3600) forKey:@"expire_preference"];
|
||||
[self setInteger: lp_config_get_int(linphone_core_get_config(lc),"default_values","reg_expires",600) forKey:@"expire_preference"];
|
||||
[self setString:linphone_proxy_config_get_dial_prefix(cfg) forKey:@"prefix_preference"];
|
||||
if (strcmp(linphone_address_get_domain(addr),linphone_address_get_domain(proxy_addr))!=0
|
||||
|| port!=NULL){
|
||||
|
|
@ -355,7 +355,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
|
|||
|
||||
|
||||
int expire = [self integerForKey:@"expire_preference"];
|
||||
lp_config_set_int(linphone_core_get_config(lc),"app","default_expires",expire);
|
||||
lp_config_set_int(linphone_core_get_config(lc),"default_values","reg_expires",expire);
|
||||
|
||||
BOOL isWifiOnly = [self boolForKey:@"wifi_only_preference"];
|
||||
|
||||
|
|
|
|||
|
|
@ -501,7 +501,10 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
&& (lLinphoneMgr.connectivity == newConnectivity || lLinphoneMgr.connectivity == none)) {
|
||||
linphone_proxy_config_expires(proxy, 0);
|
||||
} else if (proxy){
|
||||
linphone_proxy_config_expires(proxy, lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]),"app","default_expires",3600));
|
||||
int defaultExpire = [[LinphoneManager instance] lpConfigIntForKey:@"default_expires"];
|
||||
if (defaultExpire>=0)
|
||||
linphone_proxy_config_expires(proxy, defaultExpire);
|
||||
//else keep default value from linphonecore
|
||||
}
|
||||
|
||||
if (lLinphoneMgr.connectivity != newConnectivity) {
|
||||
|
|
@ -1066,6 +1069,10 @@ static LinphoneCoreVTable linphonec_vtable = {
|
|||
lp_config_set_string(linphone_core_get_config(theLinphoneCore),"app",value?[key UTF8String]:NULL, [value UTF8String]);
|
||||
}
|
||||
-(NSString*)lpConfigStringForKey:(NSString*) key {
|
||||
if (!theLinphoneCore) {
|
||||
[LinphoneLogger log:LinphoneLoggerError format:@"cannot read configuration because linphone core not ready yet"];
|
||||
return nil;
|
||||
};
|
||||
const char* value=lp_config_get_string(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String],NULL);
|
||||
if (value)
|
||||
return [NSString stringWithCString:value encoding:[NSString defaultCStringEncoding]];
|
||||
|
|
|
|||
|
|
@ -20,3 +20,5 @@ display_filter_auto_rotate=1
|
|||
|
||||
|
||||
|
||||
[default_values]
|
||||
reg_expires=600
|
||||
|
|
@ -30,5 +30,3 @@ history_max_size=30
|
|||
max_calls=3
|
||||
|
||||
|
||||
[default_values]
|
||||
reg_expires=600
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue