assistant: refactor linphone rc files

This commit is contained in:
Gautier Pelloux-Prayer 2015-12-18 15:02:37 +01:00
parent cf07453fc8
commit 0567231d58
8 changed files with 59 additions and 120 deletions

View file

@ -92,6 +92,10 @@ static UICompositeViewDescription *compositeDescription = nil;
selector:@selector(configuringUpdate:)
name:kLinphoneConfiguringStateUpdate
object:nil];
// we will set the new default proxy config in the assistant
previous_default_config = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
linphone_core_set_default_proxy_config([LinphoneManager getLc], NULL);
new_config = NULL;
[self resetTextFields];
[self changeView:_welcomeView back:FALSE animation:FALSE];
@ -147,9 +151,6 @@ static UICompositeViewDescription *compositeDescription = nil;
[[LinphoneManager instance] lpConfigSetInt:1 forKey:@"transient_provisioning" forSection:@"misc"];
[self resetLiblinphone];
// we will set the new default proxy config in the assistant
previous_default_config = linphone_core_get_default_proxy_config([LinphoneManager getLc]);
linphone_core_set_default_proxy_config([LinphoneManager getLc], NULL);
}
- (void)reset {
@ -354,12 +355,21 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)resetTextFields {
[AssistantView cleanTextField:_welcomeView];
[AssistantView cleanTextField:_createAccountView];
[AssistantView cleanTextField:_linphoneLoginView];
[AssistantView cleanTextField:_loginView];
[AssistantView cleanTextField:_createAccountActivationView];
[AssistantView cleanTextField:_remoteProvisioningLoginView];
for (UIView *view in @[
_welcomeView,
_createAccountView,
_linphoneLoginView,
_loginView,
_createAccountActivationView,
_remoteProvisioningLoginView
]) {
[AssistantView cleanTextField:view];
#if DEBUG
UIAssistantTextField *atf =
(UIAssistantTextField *)[self findView:ViewElement_Domain inView:view ofType:UIAssistantTextField.class];
atf.text = @"test.linphone.org";
#endif
}
}
- (void)displayUsernameAsPhoneOrUsername {

View file

@ -1440,7 +1440,6 @@ static BOOL libStarted = FALSE;
}
linphone_core_set_log_collection_path([[LinphoneManager cacheDirectory] UTF8String]);
[self setLogsEnabled:[self lpConfigBoolForKey:@"debugenable_preference"]];
LOGI(@"Create linphonecore");
connectivity = none;
ms_init(); // Need to initialize mediastreamer2 before loading the plugins
@ -1463,6 +1462,7 @@ static BOOL libStarted = FALSE;
theLinphoneCore =
linphone_core_new_with_config(&linphonec_vtable, configDb, (__bridge void *)(self) /* user_data */);
LOGI(@"Create linphonecore %p", theLinphoneCore);
/* set the CA file no matter what, since the remote provisioning could be hitting an HTTPS server */
const char *lRootCa = [[LinphoneManager bundleFile:@"rootca.pem"] UTF8String];
@ -1509,8 +1509,8 @@ static BOOL libStarted = FALSE;
}
[_fileTransferDelegates removeAllObjects];
LOGI(@"Destroy linphonecore");
linphone_core_destroy(theLinphoneCore);
LOGI(@"Destroy linphonecore %p", theLinphoneCore);
theLinphoneCore = nil;
ms_exit(); // Uninitialize mediastreamer2

View file

@ -2,40 +2,16 @@
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
<section name="proxy_default_values">
<entry name="dial_escape_plus" overwrite="true">0</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="reg_expires" overwrite="true">3600</entry>
<entry name="reg_identity" overwrite="true"></entry>
<entry name="reg_proxy" overwrite="true"></entry>
<entry name="reg_route" overwrite="true"></entry>
<entry name="reg_identity" overwrite="true"></entry>
<entry name="reg_expires" overwrite="true">3600</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>
</section>
<section name="assistant">
<entry name="xmlrpc_url" overwrite="true"></entry>
<entry name="sharing_server" overwrite="true"></entry>
</section>
<section name="app">
<entry name="pushnotification_preference" overwrite="true">0</entry>
<entry name="ice_preference" overwrite="true">1</entry>
<entry name="stun_preference" overwrite="true">stun.linphone.org</entry>
<entry name="random_port_preference" overwrite="true">1</entry>
<entry name="file_transfer_migration_done" overwrite="true">1</entry>
</section>
<section name="net">
<entry name="firewall_policy" overwrite="true">none</entry>
<entry name="stun_server" overwrite="true"></entry>
</section>
<section name="sip">
<entry name="sip_port" overwrite="true">-1</entry>
<entry name="sip_tcp_port" overwrite="true">-1</entry>
<entry name="sip_tls_port" overwrite="true">-1</entry>
</section>
<section name="misc">
<entry name="file_transfer_server_url" overwrite="true"></entry>
</section>
</config>
</config>

View file

@ -2,44 +2,20 @@
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
<section name="proxy_default_values">
<entry name="reg_identity" overwrite="true">sip:?@sip.linphone.org</entry>
<entry name="reg_expires" overwrite="true">1314000</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>
<entry name="avpf" overwrite="true">1</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="quality_reporting_collector" overwrite="true">sip:voip-metrics@sip.linphone.org;transport=tls</entry>
<entry name="quality_reporting_enabled" overwrite="true">1</entry>
<entry name="quality_reporting_interval" overwrite="true">180</entry>
<entry name="reg_expires" overwrite="true">1314000</entry>
<entry name="reg_identity" overwrite="true">sip:?@sip.linphone.org</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
</section>
<section name="assistant">
<entry name="username_regex" overwrite="true">^[a-z0-9_.\-]*$</entry>
<entry name="domain" overwrite="true">sip.linphone.org</entry>
<entry name="username_regex" overwrite="true">^[a-z0-9_.\-]*$</entry>
<entry name="xmlrpc_url" overwrite="true">https://www.linphone.org/assistant.php</entry>
<entry name="sharing_server" overwrite="true">https://www.linphone.org:444/lft.php</entry>
</section>
<section name="app">
<entry name="pushnotification_preference" overwrite="true">1</entry>
<entry name="ice_preference" overwrite="true">1</entry>
<entry name="stun_preference" overwrite="true">stun.linphone.org</entry>
<entry name="random_port_preference" overwrite="true">1</entry>
<entry name="file_transfer_migration_done" overwrite="true">1</entry>
</section>
<section name="net">
<entry name="firewall_policy" overwrite="true">ice</entry>
<entry name="stun_server" overwrite="true">stun.linphone.org</entry>
</section>
<section name="sip">
<entry name="sip_port" overwrite="true">-1</entry>
<entry name="sip_tcp_port" overwrite="true">-1</entry>
<entry name="sip_tls_port" overwrite="true">-1</entry>
</section>
<section name="misc">
<entry name="file_transfer_server_url" overwrite="true">https://www.linphone.org:444/lft.php</entry>
</section>
</config>

View file

@ -2,45 +2,20 @@
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
<section name="proxy_default_values">
<entry name="reg_identity" overwrite="true">sip:?@sip.linphone.org</entry>
<entry name="reg_expires" overwrite="true">1314000</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>
<entry name="avpf" overwrite="true">1</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="quality_reporting_collector" overwrite="true">sip:voip-metrics@sip.linphone.org;transport=tls</entry>
<entry name="quality_reporting_enabled" overwrite="true">1</entry>
<entry name="quality_reporting_interval" overwrite="true">180</entry>
<entry name="realm" overwrite="true">sip.linphone.org</entry>
<entry name="reg_expires" overwrite="true">1314000</entry>
<entry name="reg_identity" overwrite="true">sip:?@sip.linphone.org</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
</section>
<section name="assistant">
<entry name="username_regex" overwrite="true">^[a-z0-9_.\-]*$</entry>
<entry name="domain" overwrite="true">sip.linphone.org</entry>
<entry name="username_regex" overwrite="true">^[a-z0-9_.\-]*$</entry>
<entry name="xmlrpc_url" overwrite="true">https://www.linphone.org/assistant.php</entry>
<entry name="sharing_server" overwrite="true">https://www.linphone.org:444/lft.php</entry>
</section>
<section name="app">
<entry name="pushnotification_preference" overwrite="true">1</entry>
<entry name="ice_preference" overwrite="true">1</entry>
<entry name="stun_preference" overwrite="true">stun.linphone.org</entry>
<entry name="random_port_preference" overwrite="true">1</entry>
<entry name="file_transfer_migration_done" overwrite="true">1</entry>
</section>
<section name="net">
<entry name="firewall_policy" overwrite="true">ice</entry>
<entry name="stun_server" overwrite="true">stun.linphone.org</entry>
</section>
<section name="sip">
<entry name="sip_port" overwrite="true">-1</entry>
<entry name="sip_tcp_port" overwrite="true">-1</entry>
<entry name="sip_tls_port" overwrite="true">-1</entry>
</section>
<section name="misc">
<entry name="file_transfer_server_url" overwrite="true">https://www.linphone.org:444/lft.php</entry>
</section>
</config>

View file

@ -2,26 +2,15 @@
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
<section name="proxy_default_values">
<entry name="dial_escape_plus" overwrite="true">0</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="reg_expires" overwrite="true">3600</entry>
<entry name="reg_identity" overwrite="true"></entry>
<entry name="reg_proxy" overwrite="true"></entry>
<entry name="reg_route" overwrite="true"></entry>
<entry name="reg_identity" overwrite="true"></entry>
<entry name="reg_expires" overwrite="true">3600</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
<entry name="publish" overwrite="true">0</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>
</section>
<section name="assistant">
<entry name="xmlrpc_url" overwrite="true"></entry>
<entry name="sharing_server" overwrite="true"></entry>
</section>
<section name="app">
<entry name="pushnotification_preference" overwrite="true">0</entry>
<entry name="ice_preference" overwrite="true"></entry>
<entry name="stun_preference" overwrite="true"></entry>
<entry name="file_transfer_migration_done" overwrite="true">1</entry>
</section>
<section name="misc">
<entry name="file_transfer_server_url" overwrite="true"></entry>
</section>
</config>
</config>

View file

@ -40,9 +40,10 @@ automatically_initiate=0
automatically_accept=0
[net]
firewall_policy=0
download_bw=380
upload_bw=380
firewall_policy=ice
stun_server=stun.linphone.org
[sound]
playback_dev_id=AU: Audio Unit Receiver
@ -58,9 +59,15 @@ backgroundmode_preference=1
autoanswer_notif_preference=1
voiceproc_preference=1
enable_log_collect=0
file_transfer_migration_done=1
pushnotification_preference=1
ice_preference=1
stun_preference=stun.linphone.org
random_port_preference=1
[default_values]
reg_expires=1314000
[misc]
max_calls=3
file_transfer_server_url=https://www.linphone.org:444/lft.php

View file

@ -40,9 +40,10 @@ automatically_initiate=0
automatically_accept=0
[net]
firewall_policy=0
download_bw=512
upload_bw=512
firewall_policy=ice
stun_server=stun.linphone.org
[sound]
playback_dev_id=AU: Audio Unit Receiver
@ -58,10 +59,15 @@ backgroundmode_preference=1
autoanswer_notif_preference=1
voiceproc_preference=1
enable_log_collect=0
file_transfer_migration_done=1
pushnotification_preference=1
ice_preference=1
stun_preference=stun.linphone.org
random_port_preference=1
[default_values]
reg_expires=1314000
[misc]
max_calls=3
file_transfer_server_url=https://www.linphone.org:444/lft.php