Commit e6d43310 authored by jehan's avatar jehan
Browse files

-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;
}
......
......@@ -67,9 +67,6 @@ static void group_chat_lime_x3dh_create_lime_user (void) {
// Check encryption status for both participants
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(marie->lc));
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
linphone_core_manager_destroy(marie);
......@@ -118,10 +115,6 @@ static void group_chat_lime_x3dh_change_server_url(void) {
paulineEncryptedCr = check_creation_chat_room_client_side(coresList, pauline, &initialPaulineStats, encryptedConfAddr, initialSubject, 1, 0);
BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(paulineEncryptedCr) & LinphoneChatRoomCapabilitiesEncrypted);
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
if (marieEncryptedCr) linphone_core_manager_delete_chat_room(marie, marieEncryptedCr, coresList);
if (paulineEncryptedCr) linphone_core_manager_delete_chat_room(pauline, paulineEncryptedCr, coresList);
......@@ -269,9 +262,6 @@ static void group_chat_lime_x3dh_encrypted_chatrooms (void) {
linphone_address_unref(encryptedConfAddr);
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, mariePlainCr, coresList);
......@@ -378,10 +368,6 @@ static void group_chat_lime_x3dh_basic_chat_rooms (void) {
linphone_address_unref(marieAddr);
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(pauline, paulineBasicCr, coresList);
linphone_core_manager_delete_chat_room(marie, marieEncryptedCr, coresList);
......@@ -470,9 +456,6 @@ static void lime_x3dh_message_test (bool_t with_composing, bool_t with_response)
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(paulineCr), LinphoneChatRoomSecurityLevelEncrypted, int, "%d");
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -560,11 +543,6 @@ static void group_chat_lime_x3dh_encrypted_message_to_devices_with_and_without_k
BC_ASSERT_FALSE(wait_for_list(coresList, &laure->stat.number_of_LinphoneMessageReceived, initialLaureStats.number_of_LinphoneMessageReceived + 1, 1000));
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
linphone_core_delete_local_encryption_db(laure->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
linphone_core_manager_delete_chat_room(pauline, paulineCr, coresList);
......@@ -642,11 +620,6 @@ static void group_chat_lime_x3dh_send_encrypted_file_with_or_without_text (bool_
_receive_file(coresList, chloe, &initialChloeStats, receiveChloeFilepath, sendFilepath);
}
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
linphone_core_delete_local_encryption_db(chloe->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
linphone_core_manager_delete_chat_room(chloe, chloeCr, coresList);
......@@ -794,9 +767,6 @@ end:
remove(bc_tester_file("tmpZIDCacheMarie.sqlite"));
remove(bc_tester_file("tmpZIDCachePauline.sqlite"));
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
......@@ -926,10 +896,6 @@ end:
remove(bc_tester_file("tmpZIDCacheMarie.sqlite"));
remove(bc_tester_file("tmpZIDCachePauline.sqlite"));
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
bctbx_list_free(coresList);
bctbx_list_free(coresManagerList);
linphone_core_manager_destroy(marie);
......@@ -1041,9 +1007,6 @@ end:
remove(bc_tester_file("tmpZIDCacheMarie.sqlite"));
remove(bc_tester_file("tmpZIDCachePauline.sqlite"));
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
if (marieCr) linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -1161,9 +1124,6 @@ end:
remove(bc_tester_file("tmpZIDCacheMarie.sqlite"));
remove(bc_tester_file("tmpZIDCachePauline.sqlite"));
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -1297,11 +1257,6 @@ static void group_chat_lime_x3dh_chatroom_security_level_upgrade (void) {
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(chloeCr), LinphoneChatRoomSecurityLevelEncrypted, int, "%d");
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
linphone_core_delete_local_encryption_db(laure->lc);
linphone_core_delete_local_encryption_db(chloe->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -1434,11 +1389,6 @@ static void group_chat_lime_x3dh_chatroom_security_level_downgrade_adding_partic
BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_SecurityLevelDowngraded, initialLaureStats.number_of_SecurityLevelDowngraded + 1, 3000));
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
linphone_core_delete_local_encryption_db(laure->lc);
linphone_core_delete_local_encryption_db(chloe->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -1556,10 +1506,6 @@ static void group_chat_lime_x3dh_chatroom_security_level_downgrade_resetting_zrt
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_ManInTheMiddleDetected, initialPaulineStats.number_of_ManInTheMiddleDetected + 1, 3000));
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
linphone_core_delete_local_encryption_db(laure->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -1585,7 +1531,12 @@ static void group_chat_lime_x3dh_chatroom_security_alert (void) {
coresManagerList = bctbx_list_append(coresManagerList, pauline1);
coresManagerList = bctbx_list_append(coresManagerList, laure);
int dummy = 0;
// Change the value of max_nb_device_per_participant to disallow multidevice
linphone_config_set_int(linphone_core_get_config(marie->lc), "lime", "max_nb_device_per_participant", 1);
linphone_config_set_int(linphone_core_get_config(pauline1->lc), "lime", "max_nb_device_per_participant", 1);
linphone_config_set_int(linphone_core_get_config(laure->lc), "lime", "max_nb_device_per_participant", 1);
bctbx_list_t *coresList = init_core_for_conference(coresManagerList);
start_core_for_conference(coresManagerList);
participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(pauline1->lc)));
......@@ -1682,6 +1633,7 @@ static void group_chat_lime_x3dh_chatroom_security_alert (void) {
// Create second device for Pauline
pauline2 = linphone_core_manager_create("pauline_lime_x3dh_rc");
linphone_config_set_int(linphone_core_get_config(pauline2->lc), "lime", "max_nb_device_per_participant", 1);
stats initialPauline2Stats = pauline2->stat;
bctbx_list_t *newCoresManagerList = bctbx_list_append(NULL, pauline2);
bctbx_list_t *newCoresList = init_core_for_conference(newCoresManagerList);
......@@ -1722,11 +1674,6 @@ static void group_chat_lime_x3dh_chatroom_security_alert (void) {
}
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline1->lc);
if (pauline2) linphone_core_delete_local_encryption_db(pauline2->lc);
linphone_core_delete_local_encryption_db(laure->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -1810,9 +1757,6 @@ static void group_chat_lime_x3dh_call_security_alert (void) {
BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_ManInTheMiddleDetected, initialPaulineStats.number_of_ManInTheMiddleDetected + 1, 3000));
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -1932,10 +1876,6 @@ static void group_chat_lime_x3dh_send_multiple_successive_encrypted_messages (vo
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(laureCr), LinphoneChatRoomSecurityLevelEncrypted, int, "%d");
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
linphone_core_delete_local_encryption_db(laure->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -2005,8 +1945,6 @@ static void group_chat_lime_x3dh_send_encrypted_message_to_disabled_lime_x3dh (v
// Clean local LIME X3DH databases
linphone_core_enable_lime_x3dh(pauline->lc, TRUE);
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -2070,8 +2008,6 @@ static void group_chat_lime_x3dh_send_plain_message_to_enabled_lime_x3dh (void)
// Clean local LIME X3DH databases
linphone_core_enable_lime_x3dh(marie->lc, TRUE);
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -2191,6 +2127,9 @@ static void group_chat_lime_x3dh_send_encrypted_message_to_multidevice_participa
stats initialPauline3Stats = pauline3->stat;
_start_core(pauline3);
// Wait for lime users to be created on x3dh server
wait_for_list(coresList, &dummy, 1, x3dhServerDelay);
// Check that the chat room is correctly created on Laure's side and that the participants are added
paulineCr3 = check_creation_chat_room_client_side(coresList, pauline3, &initialPauline3Stats, confAddr, initialSubject, 2, 0);
......@@ -2208,14 +2147,6 @@ static void group_chat_lime_x3dh_send_encrypted_message_to_multidevice_participa
BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text(pauline3LastMsg), marie1Message2);
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie1->lc);
linphone_core_delete_local_encryption_db(marie2->lc);
linphone_core_delete_local_encryption_db(pauline1->lc);
linphone_core_delete_local_encryption_db(pauline2->lc);
if (pauline3)
linphone_core_delete_local_encryption_db(pauline3->lc);
linphone_core_delete_local_encryption_db(laure->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie1, marieCr1, coresList);
......@@ -2297,9 +2228,6 @@ static void group_chat_lime_x3dh_message_while_network_unreachable (void) {
BC_ASSERT_EQUAL(linphone_chat_room_get_security_level(paulineCr), LinphoneChatRoomSecurityLevelEncrypted, int, "%d");
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......@@ -2394,9 +2322,6 @@ static void group_chat_lime_x3dh_update_keys (void) {
BC_ASSERT_GREATER(newUpdateTime, (int)oldUpdateTime, int, "%d");
end:
// Clean local LIME X3DH databases
linphone_core_delete_local_encryption_db(marie->lc);
linphone_core_delete_local_encryption_db(pauline->lc);
// Clean db from chat room
linphone_core_manager_delete_chat_room(marie, marieCr, coresList);
......
......@@ -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