Commit 7d64dedf authored by Sylvain Berfini's avatar Sylvain Berfini

Fixed missing init in proxy config creation + added test for proxy_default_values in lpconfig

parent 6f819de1
......@@ -52,6 +52,7 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *ob
memset(obj, 0, sizeof(LinphoneProxyConfig));
obj->magic = linphone_proxy_config_magic;
obj->expires = lc ? lp_config_get_default_int(lc->config, "proxy", "reg_expires", 3600) : 3600;
obj->reg_sendregister = lc ? lp_config_get_default_int(lc->config, "proxy", "reg_sendregister", 0) : 0;
obj->dial_prefix = dial_prefix ? ms_strdup(dial_prefix) : NULL;
obj->dial_escape_plus = lc ? lp_config_get_default_int(lc->config, "proxy", "dial_escape_plus", 0) : 0;
obj->privacy = lc ? lp_config_get_default_int(lc->config, "proxy", "privacy", LinphonePrivacyDefault) : LinphonePrivacyDefault;
......
[misc]
config-uri=http://smtp.linphone.org/marie_default
......@@ -76,13 +76,25 @@ static void remote_provisioning_invalid(void) {
linphone_core_manager_destroy(marie);
}
static void remote_provisioning_default_values(void) {
LinphoneCoreManager* marie = linphone_core_manager_new2("marie_remote_default_values_rc", FALSE);
CU_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneConfiguringSuccessful,1));
LinphoneProxyConfig *lpc = linphone_core_create_proxy_config(marie->lc);
CU_ASSERT_TRUE(lpc->reg_sendregister == 1);
CU_ASSERT_TRUE(lpc->expires == 604800);
CU_ASSERT_TRUE(strcmp(lpc->reg_proxy, "<sip:sip.linphone.org:5223;transport=tls>") == 0);
CU_ASSERT_TRUE(strcmp(lpc->reg_identity, "sip:?@sip.linphone.org") == 0);
linphone_core_manager_destroy(marie);
}
test_t remote_provisioning_tests[] = {
{ "Remote provisioning skipped", remote_provisioning_skipped },
{ "Remote provisioning successful behind http", remote_provisioning_http },
{ "Remote provisioning successful behind https", remote_provisioning_https },
{ "Remote provisioning 404 not found", remote_provisioning_not_found },
{ "Remote provisioning invalid", remote_provisioning_invalid },
{ "Remote provisioning transient successful", remote_provisioning_transient }
{ "Remote provisioning transient successful", remote_provisioning_transient },
{ "Remote provisioning default values", remote_provisioning_default_values }
};
test_suite_t remote_provisioning_test_suite = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment