Commit 59c56393 authored by Erwan Croze's avatar Erwan Croze 👋🏻

Add new rcfile for test

parent be6603fd
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
......@@ -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.
......
......@@ -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
......
......@@ -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\
......
......@@ -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,
......
<?xml version="1.0" encoding="UTF-8"?>
<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="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">31536000</entry>
<entry name="reg_identity" overwrite="true">sip:?@sip.linphone.org</entry>
<entry name="reg_sendregister" overwrite="true">1</entry>
<entry name="refkey" overwrite="true">push_notification</entry>
<entry name="realm" overwrite="true">sip.linphone.org</entry>
</section>
<section name="sip">
<entry name="rls_uri" overwrite="true">sips:rls@sip.linphone.org</entry>
</section>
<section name="assistant">
<entry name="domain" overwrite="true">sip.linphone.org</entry>
<entry name="password_max_length" overwrite="true">-1</entry>
<entry name="password_min_length" overwrite="true">1</entry>
<entry name="username_length" overwrite="true">-1</entry>
<entry name="username_max_length" overwrite="true">64</entry>
<entry name="username_min_length" overwrite="true">1</entry>
<entry name="username_regex" overwrite="true">^[a-z0-9+_.\-]*$</entry>
<entry name="xmlrpc_url" overwrite="true">https://sip3.linphone.org:444/wizard.php</entry>
</section>
</config>
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