Commit e6d43310 authored by jehan's avatar jehan

-few changes to fix lime tester.

-remove macros ENABLE_UPDATE_CHECK
parent ee1e8467
......@@ -7572,7 +7572,6 @@ void linphone_core_remove_content_type_support(LinphoneCore *lc, const char *con
lc->sal->removeContentTypeSupport(content_type);
}
#ifdef ENABLE_UPDATE_CHECK
static void update_check_process_terminated(LinphoneCore *lc, LinphoneVersionUpdateCheckResult result, const char *version, const char *url) {
linphone_core_notify_version_update_check_result_received(lc, result, version, url);
if (lc->update_check_http_listener) {
......@@ -7668,11 +7667,8 @@ static void update_check_process_auth_requested(void *ctx, belle_sip_auth_event_
LinphoneCore *lc = (LinphoneCore *)ctx;
update_check_process_terminated(lc, LinphoneVersionUpdateCheckError, NULL, NULL);
}
#endif /* ENABLE_UPDATE_CHECK */
void linphone_core_check_for_update(LinphoneCore *lc, const char *current_version) {
#ifdef ENABLE_UPDATE_CHECK
int err;
bool_t is_desktop = FALSE;
const char *platform = NULL;
const char *mobilePlatform = NULL;
......@@ -7715,9 +7711,8 @@ void linphone_core_check_for_update(LinphoneCore *lc, const char *current_versio
lc->update_check_current_version = bctbx_strdup(current_version);
lc->update_check_http_listener = belle_http_request_listener_create_from_callbacks(&belle_request_listener, lc);
request = belle_http_request_create("GET", uri, belle_sip_header_create("User-Agent", linphone_core_get_user_agent(lc)), NULL);
err = belle_http_provider_send_request(lc->http_provider, request, lc->update_check_http_listener);
belle_http_provider_send_request(lc->http_provider, request, lc->update_check_http_listener);
}
#endif
}
int linphone_core_get_unread_chat_message_count (const LinphoneCore *lc) {
......
......@@ -79,12 +79,6 @@ void linphone_core_set_lime_x3dh_server_url(LinphoneCore *lc, const char *url) {
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->setX3dhServerUrl(L_C_TO_STRING(url));
}
void linphone_core_delete_local_encryption_db (const LinphoneCore *lc) {
auto encryptionEngine = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getEncryptionEngine();
if (encryptionEngine)
encryptionEngine->cleanDb();
}
//Deprecated
const char *linphone_core_get_linphone_specs (const LinphoneCore *lc) {
return lp_config_get_string(linphone_core_get_config(lc), "sip", "linphone_specs", NULL);
......
......@@ -107,6 +107,9 @@ void CorePrivate::uninit () {
localListEventHandler = nullptr;
AddressPrivate::clearSipAddressesCache();
if (mainDb != nullptr) {
mainDb->disconnect();
}
}
// -----------------------------------------------------------------------------
......@@ -263,7 +266,7 @@ void Core::enableLimeX3dh (bool enable) {
LinphoneConfig *lpconfig = linphone_core_get_config(getCCore());
string serverUrl = lp_config_get_string(lpconfig, "lime", "x3dh_server_url", "");
if (serverUrl.empty()) {
lError() << "Lime X3DH server URL not set, can't enable";
lInfo() << "Lime X3DH server URL not set, can't enable";
//Do not enable encryption engine if url is undefined
return;
}
......
This diff is collapsed.
......@@ -330,6 +330,7 @@ typedef struct _LinphoneCoreManager {
char *phone_alias;
char *rc_path;
char *database_path;
char *lime_database_path;
} LinphoneCoreManager;
typedef struct _LinphoneConferenceServer {
......@@ -438,7 +439,7 @@ bool_t liblinphone_tester_clock_elapsed(const MSTimeSpec *start, int value_ms);
void linphone_core_manager_check_accounts(LinphoneCoreManager *m);
void account_manager_destroy(void);
LinphoneAddress *account_manager_get_identity_with_modified_identity(const LinphoneAddress *modified_identity);
LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, const char *file, void *user_data);
LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, LinphoneConfig *config, void *user_data);
void configure_core_for_callbacks(LinphoneCoreManager *lcm, LinphoneCoreCbs *cbs);
void liblinphone_tester_set_next_video_frame_decoded_cb(LinphoneCall *call);
......
[lime]
x3dh_db_path=chloe.x3dh.sqlite3
lime_update_threshold=86400
max_nb_device_per_participant=1
allow_message_in_unsafe_chatroom=0
unsafe_if_sas_refused=1
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
......
[lime]
#x3dh_db_path=groupchat.x3dh.sqlite3
lime_update_threshold=86400
max_nb_device_per_participant=1000
allow_message_in_unsafe_chatroom=0
......
[lime]
x3dh_db_path=laure.x3dh.sqlite3
lime_update_threshold=86400
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
......
......@@ -3,7 +3,6 @@ enable_basic_to_client_group_chat_room_migration=1
basic_to_client_group_chat_room_migration_timer=180
[lime]
x3dh_db_path=noserver.x3dh.sqlite3
lime_update_threshold=86400
max_nb_device_per_participant=1
allow_message_in_unsafe_chatroom=0
......
......@@ -3,11 +3,9 @@ enable_basic_to_client_group_chat_room_migration=1
basic_to_client_group_chat_room_migration_timer=180
[lime]
x3dh_db_path=marie.x3dh.sqlite3
lime_update_threshold=86400
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
[sip]
sip_port=-1
sip_tcp_port=-1
......
[lime]
x3dh_db_path=pauline.x3dh.sqlite3
lime_update_threshold=86400
x3dh_server_url=http://x3dh.example.org:8082/flexisip-account-manager/x3dh-25519.php
......@@ -27,7 +26,6 @@ reg_expires=3600
reg_sendregister=1
publish=0
dial_escape_plus=0
#[friend_0]
#url="Mariette" <sip:marie@sip.example.org>
#pol=accept
......
......@@ -122,27 +122,14 @@ void reset_counters( stats* counters) {
memset(counters,0,sizeof(stats));
}
LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, const char *file, void *user_data) {
LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, LinphoneConfig *config, void *user_data) {
LinphoneCore *lc;
LinphoneConfig *config = NULL;
char *filepath = NULL;
char *ringpath = NULL;
char *ringbackpath = NULL;
char *rootcapath = NULL;
char *dnsuserhostspath = NULL;
char *nowebcampath = NULL;
if (!path)
path = ".";
if (file){
filepath = bctbx_strdup_printf("%s/%s", path, file);
if (bctbx_file_exist(filepath) != 0) {
ms_fatal("Could not find file %s in path %s, did you configured resources directory correctly?", file, path);
}
config = lp_config_new_with_factory(NULL, filepath);
}
// setup dynamic-path assets
ringpath = ms_strdup_printf("%s/sounds/oldphone.wav",path);
ringbackpath = ms_strdup_printf("%s/sounds/ringback.wav", path);
......@@ -156,8 +143,7 @@ LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, const ch
lp_config_set_string(config, "sip", "root_ca" , rootcapath);
lc = linphone_factory_create_core_with_config_3(linphone_factory_get(), config, system_context);
} else {
lc = linphone_factory_create_core_3(linphone_factory_get(), NULL, (filepath && (filepath[0] != '\0')) ? filepath :
liblinphone_tester_get_empty_rc(), system_context);
lc = linphone_factory_create_core_3(linphone_factory_get(), NULL, liblinphone_tester_get_empty_rc(), system_context);
linphone_core_set_ring(lc, ringpath);
linphone_core_set_ringback(lc, ringbackpath);
linphone_core_set_root_ca(lc,rootcapath);
......@@ -180,13 +166,6 @@ LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, const ch
ms_free(nowebcampath);
ms_free(rootcapath);
ms_free(dnsuserhostspath);
if (filepath)
bctbx_free(filepath);
if (config)
linphone_config_unref(config);
return lc;
}
......@@ -317,8 +296,17 @@ static void avoid_pulseaudio_hack(LinphoneCoreManager *mgr){
void linphone_core_manager_configure (LinphoneCoreManager *mgr) {
LinphoneImNotifPolicy *im_notif_policy;
char *hellopath = bc_tester_res("sounds/hello8000.wav");
mgr->lc = configure_lc_from(mgr->cbs, bc_tester_get_resource_dir_prefix(), mgr->rc_path, mgr);
const char * filepath = mgr->rc_path?bctbx_strdup_printf("%s/%s", bc_tester_get_resource_dir_prefix() ,mgr->rc_path):NULL;
if (filepath && bctbx_file_exist(filepath) != 0) {
ms_fatal("Could not find file %s in path %s, did you configured resources directory correctly?", mgr->rc_path, bc_tester_get_resource_dir_prefix());
}
LinphoneConfig * config = linphone_factory_create_config_with_factory(linphone_factory_get(), NULL, filepath);
linphone_config_set_string(config, "storage", "backend", "sqlite3");
linphone_config_set_string(config, "storage", "uri", mgr->database_path);
linphone_config_set_string(config, "lime", "x3dh_db_path", mgr->lime_database_path);
mgr->lc = configure_lc_from(mgr->cbs, bc_tester_get_resource_dir_prefix(), config, mgr);
linphone_config_unref(config);
linphone_core_manager_check_accounts(mgr);
im_notif_policy = linphone_core_get_im_notif_policy(mgr->lc);
if (im_notif_policy != NULL) {
......@@ -374,9 +362,6 @@ void linphone_core_manager_configure (LinphoneCoreManager *mgr) {
/*for now, we need the periodical updates facility to compute bandwidth measurements correctly during tests*/
linphone_core_enable_send_call_stats_periodical_updates(mgr->lc, TRUE);
LinphoneConfig *config = linphone_core_get_config(mgr->lc);
linphone_config_set_string(config, "storage", "backend", "sqlite3");
linphone_config_set_string(config, "storage", "uri", mgr->database_path);
}
static void generate_random_database_path (LinphoneCoreManager *mgr) {
......@@ -385,6 +370,9 @@ static void generate_random_database_path (LinphoneCoreManager *mgr) {
char *database_path_format = bctbx_strdup_printf("linphone_%s.db", random_id);
mgr->database_path = bc_tester_file(database_path_format);
bctbx_free(database_path_format);
database_path_format = bctbx_strdup_printf("lime_%s.db", random_id);
mgr->lime_database_path = bc_tester_file(database_path_format);
bctbx_free(database_path_format);
}
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
......@@ -567,7 +555,11 @@ void linphone_core_manager_uninit(LinphoneCoreManager *mgr) {
bctbx_free(mgr->rc_path);
if (mgr->database_path) {
unlink(mgr->database_path);
bctbx_free(mgr->database_path);
bc_free(mgr->database_path);
}
if (mgr->lime_database_path) {
unlink(mgr->lime_database_path);
bc_free(mgr->lime_database_path);
}
if (mgr->cbs)
......
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