diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index ae08613cd..d757b7a70 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -6003,7 +6003,7 @@ extern "C" void Java_org_linphone_core_LpConfigImpl_sync(JNIEnv *env, jobject th extern "C" void Java_org_linphone_core_LpConfigImpl_loadXmlFile(JNIEnv *env, jobject thiz, jlong lpc, jstring jfilename) { const char *filename = GetStringUTFChars(env, jfilename); LpConfig *lp = (LpConfig *)lpc; - linphone_config_load_from_xml_file(lp, filename, NULL); + linphone_config_load_from_xml_file(lp, filename, NULL, NULL); ReleaseStringUTFChars(env, jfilename, filename); } @@ -8755,15 +8755,6 @@ extern "C" jint Java_org_linphone_core_LinphoneAccountCreatorImpl_updatePassword return status; } -extern "C" jobject Java_org_linphone_core_LinphoneAccountCreatorImpl_configureProxyConfig(JNIEnv *env, jobject thiz, jlong ptr) { - LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; - LinphoneProxyConfig *lpc = linphone_account_creator_configure(account_creator); - LinphoneCore *lc = account_creator->core; - LinphoneCoreVTable *table = linphone_core_get_current_vtable(lc); - LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_v_table_get_user_data(table); - return getProxy(env, lpc, lcData->core); -} - extern "C" jobject Java_org_linphone_core_LinphoneAccountCreatorImpl_configure(JNIEnv *env, jobject thiz, jlong ptr) { LinphoneAccountCreator *account_creator = (LinphoneAccountCreator *)ptr; LinphoneProxyConfig *lpc = linphone_account_creator_configure(account_creator); diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index 1c87904d6..2a1c85520 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -481,14 +481,14 @@ LinphoneStatus linphone_config_read_file(LpConfig *lpconfig, const char *filenam return -1; } -char* linphone_config_load_from_xml_file(LpConfig *lpc, const char *filename, void* ctx) { +char* linphone_config_load_from_xml_file(LpConfig *lpc, const char *filename, void* lc, void* ctx) { xml2lpc_context *context = NULL; char* path = lp_realpath(filename, NULL); char* error_msg = NULL; if (path) { int result = -1; - context = xml2lpc_context_new(NULL, ctx); + context = xml2lpc_context_new(ctx, lc); result = xml2lpc_set_xml_string(context, path); if (result == 0) { result = xml2lpc_convert(context, lpc); diff --git a/coreapi/remote_provisioning.c b/coreapi/remote_provisioning.c index 9da88531a..daadf4163 100644 --- a/coreapi/remote_provisioning.c +++ b/coreapi/remote_provisioning.c @@ -35,7 +35,7 @@ static void xml2lpc_callback(void *ctx, xml2lpc_log_level level, const char *fmt } static void linphone_remote_provisioning_apply(LinphoneCore *lc, const char *xml) { - char* error_msg = linphone_config_load_from_xml_file(linphone_core_get_config(lc), xml, lc); + char* error_msg = linphone_config_load_from_xml_file(linphone_core_get_config(lc), xml, lc, xml2lpc_callback); linphone_configuring_terminated(lc ,error_msg ? LinphoneConfiguringFailed : LinphoneConfiguringSuccessful diff --git a/include/linphone/lpconfig.h b/include/linphone/lpconfig.h index 3f8893e65..72b06213d 100644 --- a/include/linphone/lpconfig.h +++ b/include/linphone/lpconfig.h @@ -87,9 +87,10 @@ LINPHONE_PUBLIC LinphoneStatus linphone_config_read_file(LinphoneConfig *lpconfi * @ingroup misc * @param lpconfig The LinphoneConfig object to fill with the content of the file * @param filename The filename of the config file to read to fill the LinphoneConfig + * @param lc LinphoneCore to share with xml2lpc * @param ctx The context given to xml2lpc callback */ -LINPHONE_PUBLIC char* linphone_config_load_from_xml_file(LpConfig *lpc, const char *filename, void* ctx); +LINPHONE_PUBLIC char* linphone_config_load_from_xml_file(LpConfig *lpc, const char *filename, void* lc, void* ctx); /** * Retrieves a configuration item as a string, given its section, key, and default value. diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index e90af0224..dd24b205a 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -78,6 +78,7 @@ set(CERTIFICATE_FILES ${CERTIFICATE_ALT_FILES} ${CERTIFICATE_CN_FILES} ${CERTIFI set(RC_FILES rcfiles/account_creator_rc + rcfiles/assistant_create.rc rcfiles/carddav_rc rcfiles/conference_focus_rc rcfiles/empty_rc diff --git a/tester/Makefile.am b/tester/Makefile.am index efe2837ed..98634b009 100644 --- a/tester/Makefile.am +++ b/tester/Makefile.am @@ -35,6 +35,7 @@ CERTIFICATE_FILES = $(CERTIFICATE_ALT_FILES) $(CERTIFICATE_CN_FILES) $(CERTIFICA RCFILES = \ rcfiles/account_creator_rc\ + rcfiles/assistant_create.rc\ rcfiles/carddav_rc\ rcfiles/empty_rc\ rcfiles/friends_rc\ diff --git a/tester/proxy_config_tester.c b/tester/proxy_config_tester.c index 6f38c30e6..322034cbc 100644 --- a/tester/proxy_config_tester.c +++ b/tester/proxy_config_tester.c @@ -68,7 +68,7 @@ static void phone_normalization_with_proxy(void) { BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+33 (0) 1 23 45 67 89"), "+33123456789"); BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+90 (903) 1234567"), "+909031234567"); BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0033123456789"), "0033123456789"); - + linphone_proxy_config_set_dial_prefix(proxy, "33"); BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "123456789"), "+33123456789"); BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, " 0123456789"), "+33123456789"); @@ -179,11 +179,20 @@ static void sip_uri_normalization(void) { SIP_URI_CHECK("١", expected); //test that no more invalid memory writes are made (valgrind only) } +static void load_dynamic_proxy_config(void) { + LinphoneProxyConfig *proxy; + + //Load file + + proxy = linphone_proxy_config_new(); +} + test_t proxy_config_tests[] = { TEST_NO_TAG("Phone normalization without proxy", phone_normalization_without_proxy), TEST_NO_TAG("Phone normalization with proxy", phone_normalization_with_proxy), TEST_NO_TAG("Phone normalization with dial escape plus", phone_normalization_with_dial_escape_plus), - TEST_NO_TAG("SIP URI normalization", sip_uri_normalization) + TEST_NO_TAG("SIP URI normalization", sip_uri_normalization), + TEST_NO_TAG("Load new default value for proxy config", load_dynamic_proxy_config) }; test_suite_t proxy_config_test_suite = {"Proxy config", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/rcfiles/assistant_create.rc b/tester/rcfiles/assistant_create.rc new file mode 100644 index 000000000..a4f42a809 --- /dev/null +++ b/tester/rcfiles/assistant_create.rc @@ -0,0 +1,32 @@ + + + +
+ 1 + 0 + 0 + sip:voip-metrics@sip.linphone.org;transport=tls + 1 + 180 + 31536000 + sip:?@sip.linphone.org + 1 + push_notification + sip.linphone.org +
+ +
+ sips:rls@sip.linphone.org +
+ +
+ sip.linphone.org + -1 + 1 + -1 + 64 + 1 + ^[a-z0-9+_.\-]*$ + https://sip3.linphone.org:444/wizard.php +
+