Commit 3208279e authored by Simon Morlat's avatar Simon Morlat

Work in progress - no longer use sip2.linphone.org as outbound proxy. This is causing issues.

Indeed, many tester are using sip.example.org and REGISTER to this domain. However, the flexisip server advertises itself as "sip2.linphone.org" in Record-Routes.
This causes ACK to be delayed, because a DNS resolution is requested and a new TCP/TLS connection will be made for it.
This is unefficient for nothing (the use case of having a proxy that doesn't advertises itself the same way as the client knows them is unusual).
In practice, this problem was causing the failure of many tests in "Call recovery" suite, because these tests were simulating network disconnections just after call establishment.
Due to the time needed for the ACK to be send, the ACK was never sent because network was cut before.
parent edbf1330
......@@ -184,12 +184,13 @@ void CorePrivate::insertChatRoom (const shared_ptr<AbstractChatRoom> &chatRoom)
void CorePrivate::insertChatRoomWithDb (const shared_ptr<AbstractChatRoom> &chatRoom, unsigned int notifyId) {
L_ASSERT(chatRoom->getState() == ChatRoom::State::Created);
mainDb->insertChatRoom(chatRoom, notifyId);
if (mainDb->isInitialized()) mainDb->insertChatRoom(chatRoom, notifyId);
}
void CorePrivate::loadChatRooms () {
chatRooms.clear();
chatRoomsById.clear();
if (!mainDb->isInitialized()) return;
for (auto &chatRoom : mainDb->getChatRooms()) {
insertChatRoom(chatRoom);
chatRoom->getPrivate()->sendDeliveryNotifications();
......@@ -351,7 +352,7 @@ void Core::deleteChatRoom (const shared_ptr<const AbstractChatRoom> &chatRoom) {
L_ASSERT(chatRoomsIt != d->chatRooms.end());
d->chatRooms.erase(chatRoomsIt);
d->chatRoomsById.erase(chatRoomsByIdIt);
d->mainDb->deleteChatRoom(conferenceId);
if (d->mainDb->isInitialized()) d->mainDb->deleteChatRoom(conferenceId);
} else
L_ASSERT(find(d->chatRooms, chatRoom) == d->chatRooms.end());
}
......
......@@ -54,7 +54,7 @@ void CorePrivate::init () {
AbstractDb::Backend backend;
string uri = L_C_TO_STRING(lp_config_get_string(linphone_core_get_config(L_GET_C_BACK_PTR(q)), "storage", "uri", nullptr));
if (!uri.empty())
backend = strcmp(lp_config_get_string(linphone_core_get_config(L_GET_C_BACK_PTR(q)), "storage", "backend", nullptr), "mysql") == 0
backend = strcmp(lp_config_get_string(linphone_core_get_config(L_GET_C_BACK_PTR(q)), "storage", "backend", "sqlite3"), "mysql") == 0
? MainDb::Mysql
: MainDb::Sqlite3;
else {
......
......@@ -36,6 +36,7 @@ private:
void safeInit ();
AbstractDb::Backend backend;
bool initialized = false;
L_DECLARE_PUBLIC(AbstractDb);
};
......
......@@ -48,6 +48,7 @@ void AbstractDbPrivate::safeInit () {
dbSession.enableForeignKeys(false);
q->init();
dbSession.enableForeignKeys(true);
initialized = true;
}
AbstractDb::AbstractDb (AbstractDbPrivate &p) : Object(p) {}
......@@ -138,6 +139,11 @@ void AbstractDb::init () {
// Nothing.
}
bool AbstractDb::isInitialized() const{
L_D();
return d->initialized;
}
std::ostream& operator<<(std::ostream& os, AbstractDb::Backend b){
switch(b){
case AbstractDb::Mysql:
......
......@@ -47,6 +47,7 @@ public:
virtual bool import (Backend backend, const std::string &parameters);
bool isInitialized() const;
protected:
explicit AbstractDb (AbstractDbPrivate &p);
......
......@@ -186,6 +186,8 @@ set(SOURCE_FILES_C
call_multi_tester.c
call_single_tester.c
call_video_tester.c
call_recovery.c
call_ice.c
complex_sip_case_tester.c
dtmf_tester.c
eventapi_tester.c
......
......@@ -20,7 +20,7 @@
#include "tester_utils.h"
#include <ctype.h>
static const char XMLRPC_URL[] = "http://subscribe.example.org/flexisip-account-manager/xmlrpc.php";
static const char XMLRPC_URL[] = "http://subscribe.example.org:8082/flexisip-account-manager/xmlrpc.php";
static const int TIMEOUT_REQUEST = 10000;
......
......@@ -373,7 +373,7 @@ static LinphoneAddress *account_manager_check_account(AccountManager *m, Linphon
linphone_core_get_config(lc),
"misc",
"xmlrpc_server_url",
"http://subscribe.example.org/flexisip-account-manager/xmlrpc.php"
"http://subscribe.example.org:8082/flexisip-account-manager/xmlrpc.php"
);
account_create_in_db(account, cfg, xmlrpc_url);
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -82,6 +82,8 @@ extern test_suite_t tunnel_test_suite;
extern test_suite_t upnp_test_suite;
extern test_suite_t utils_test_suite;
extern test_suite_t video_test_suite;
extern test_suite_t call_recovery_test_suite;
extern test_suite_t call_with_ice_test_suite;
#ifdef VCARD_ENABLED
extern test_suite_t vcard_test_suite;
......@@ -429,6 +431,7 @@ LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, const ch
void liblinphone_tester_set_next_video_frame_decoded_cb(LinphoneCall *call);
void call_paused_resumed_base(bool_t multicast,bool_t with_losses);
void simple_call_base(bool_t enable_multicast_recv_side);
void _call_with_rtcp_mux(bool_t caller_rtcp_mux, bool_t callee_rtcp_mux, bool_t with_ice,bool_t with_ice_reinvite);
void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel, const char *marie_rc, const char *pauline_rc);
void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel);
bool_t call_with_caller_params(LinphoneCoreManager* caller_mgr,LinphoneCoreManager* callee_mgr, const LinphoneCallParams *params);
......
127.0.0.1 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org conf.example.org subscribe.example.org x3dh.linphone.org
127.0.0.1 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org sipv4.example.org conf.example.org subscribe.example.org x3dh.linphone.org http-proxy.example.org
::1 sip2.linphone.org sip.example.org sipopen.example.org auth.example.org auth1.example.org auth2.example.org altname.linphone.org sip.wildcard1.linphone.org altname.wildcard2.linphone.org
188.165.46.90 tunnel.wildcard2.linphone.org
64:ff9b::94.23.19.176 sipv4-nat64.example.org
192.168.7.13 http-proxy.example.org
......@@ -252,8 +252,8 @@ static void single_route(void) {
BC_ASSERT_PTR_NOT_NULL(routes);
BC_ASSERT_EQUAL(bctbx_list_size(routes), 1, int, "%d");
const char *route = (const char *)bctbx_list_get_data(routes);
BC_ASSERT_STRING_EQUAL(linphone_proxy_config_get_route(marie_cfg), "sip:sip.example.org;transport=tcp;lr");
BC_ASSERT_STRING_EQUAL(route, "sip:sip.example.org;transport=tcp;lr");
BC_ASSERT_STRING_EQUAL(linphone_proxy_config_get_route(marie_cfg), "<sip:sip.example.org;transport=tcp>");
BC_ASSERT_STRING_EQUAL(route, "<sip:sip.example.org;transport=tcp>");
linphone_proxy_config_set_route(marie_cfg, "sip.linphone.org");
routes = linphone_proxy_config_get_routes(marie_cfg);
......
......@@ -23,8 +23,8 @@ realm=sip.example.org
[proxy_0]
realm=sip.example.org
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=<sip:sip.example.org;transport=tls>
reg_route=<sip:sip.example.org;transport=tls>
reg_identity=sip:chloe@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -14,8 +14,8 @@ realm=sip.example.org
[proxy_0]
realm=sip.example.org
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=<sip:sip.example.org;transport=tls>
reg_route=<sip:sip.example.org;transport=tls>
reg_identity=sip:chloe@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -18,8 +18,8 @@ passwd=secret
realm=sip.example.org
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity="Super Marie" <sip:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity=sip:marie@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -11,12 +11,12 @@ composing_idle_timeout=1
username=marie
userid=marie
passwd=secret
realm=sip2.linphone.org
realm=sip.example.org
[proxy_0]
reg_proxy=sips:sip2.linphone.org
reg_route=sips:sip2.linphone.org
reg_proxy=sips:sip.example.org
reg_route=sips:sip.example.org
reg_identity="Super Marie" <sips:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
......@@ -24,7 +24,7 @@ publish=0
dial_escape_plus=0
[friend_0]
url="Paupoche" <sip:pauline@sip2.linphone.org>
url="Paupoche" <sip:pauline@sip.example.org>
pol=accept
subscribe=0
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sipv4.example.org;transport=tcp
reg_route=sipv4.example.org;transport=tcp;lr
reg_proxy=<sip:sipv4.example.org;transport=tcp>
reg_route=<sip:sipv4.example.org;transport=tcp>
reg_identity="Super Marie" <sip:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity="Super Marie" <sip:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity="Super Marie" <sip:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
......
......@@ -17,8 +17,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity="Super Marie" <sip:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
......
......@@ -18,8 +18,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip.example.org;transport=tcp>
reg_identity="Super Marie" <sip:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp;lr
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity="Super Marie" <sip:marie@sip.example.org>
reg_expires=3600
reg_sendregister=1
......
......@@ -29,7 +29,7 @@ passwd=secret
realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tls
reg_proxy=<sip:sip.example.org;transport=tls>
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......@@ -37,7 +37,7 @@ publish=0
dial_escape_plus=0
[proxy_1]
reg_proxy=sip.example.org;transport=tcp
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_identity=sip:marie@sip.example.org
reg_expires=3600
reg_sendregister=1
......@@ -45,7 +45,7 @@ publish=0
dial_escape_plus=0
[proxy_2]
reg_proxy=auth1.example.org
reg_proxy=sip:auth1.example.org
reg_identity=sip:liblinphone_tester@auth1.example.org
reg_expires=3600
reg_sendregister=1
......@@ -54,7 +54,7 @@ dial_escape_plus=0
realm=auth1.example.org
[proxy_3]
reg_proxy=auth1.example.org
reg_proxy=sip:auth1.example.org
reg_identity=sip:liblinphone_tester@auth1.example.org
reg_expires=600
reg_sendregister=1
......
......@@ -13,7 +13,7 @@ realm=sip.example.org
[proxy_0]
reg_proxy=altname.linphone.org:5062;transport=tls
reg_proxy=<sip:altname.linphone.org:5062;transport=tls>
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -23,8 +23,8 @@ realm=sip.example.org
[proxy_0]
realm=sip.example.org
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=<sip:sip.example.org;transport=tls>
reg_route=<sip:sip.example.org;transport=tls>
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sipv4-nat64.example.org;transport=tcp
reg_route=sipv4-nat64.example.org;transport=tcp
reg_proxy=<sip:sipv4-nat64.example.org;transport=tcp>
reg_route=<sip:sipv4-nat64.example.org;transport=tcp>
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -14,8 +14,8 @@ realm=sip.example.org
[proxy_0]
realm=sip.example.org
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=<sip:sip.example.org;transport=tls>
reg_route=<sip:sip.example.org;transport=tls>
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sips:sip2.linphone.org
reg_route=sips:sip2.linphone.org
reg_proxy=sips:sip.example.org
reg_route=sips:sip.example.org
reg_identity=sips:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -14,8 +14,8 @@ realm=sip.example.org
[proxy_0]
realm=sip.example.org
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
realm=sip.example.org
reg_proxy=sip2.linphone.org:5063;transport=tls
reg_route=sip2.linphone.org:5063;transport=tls
reg_proxy=sip.example.org:5063;transport=tls
reg_route=sip.example.org:5063;transport=tls
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -15,8 +15,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tls
reg_route=sip2.linphone.org;transport=tls
reg_proxy=sip.example.org;transport=tls
reg_route=sip.example.org;transport=tls
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -17,8 +17,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -18,8 +18,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_proxy=sip.example.org;transport=tcp
reg_route=sip.example.org;transport=tcp
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -16,8 +16,8 @@ realm=sip.example.org
[proxy_0]
reg_proxy=sip2.linphone.org;transport=tcp
reg_route=sip2.linphone.org;transport=tcp
reg_proxy=<sip:sip.example.org;transport=tcp>
reg_route=<sip:sip.example.org;transport=tcp>
reg_identity=sip:pauline@sip.example.org
reg_expires=3600
reg_sendregister=1
......
......@@ -111,7 +111,7 @@ static void register_with_refresh_base_3_for_algo(
linphone_core_set_default_proxy(lc,proxy_cfg);
while (counters->number_of_LinphoneRegistrationOk<1+(refresh!=0)
&& retry++ <(1100 /*only wait 11 s if final state is progress*/+(expected_final_state==LinphoneRegistrationProgress?0:2000))) {
&& retry++ <(7000 /*only wait 7 s if final state is progress*/+(expected_final_state==LinphoneRegistrationProgress?0:4000))) {
linphone_core_iterate(lc);
if (counters->number_of_auth_info_requested>0 && linphone_proxy_config_get_state(proxy_cfg) == LinphoneRegistrationFailed && late_auth_info) {
if (!linphone_core_get_auth_info_list(lc)) {
......
......@@ -658,6 +658,8 @@ void liblinphone_tester_add_suites() {
bc_tester_add_suite(&tunnel_test_suite);
bc_tester_add_suite(&offeranswer_test_suite);
bc_tester_add_suite(&call_test_suite);
bc_tester_add_suite(&call_recovery_test_suite);
bc_tester_add_suite(&call_with_ice_test_suite);
#ifdef VIDEO_ENABLED
bc_tester_add_suite(&call_video_test_suite);
#endif // ifdef VIDEO_ENABLED
......
......@@ -253,6 +253,7 @@ static void friends_sqlite_storage(void) {
LinphoneFriend *lf2 = NULL;
LinphoneVcard *lvc = linphone_factory_create_vcard(linphone_factory_get());
LinphoneAddress *addr = linphone_address_new("sip:sylvain@sip.linphone.org");
LinphoneCoreManager *lcm;
const bctbx_list_t *friends = NULL;
bctbx_list_t *friends_from_db = NULL;
bctbx_list_t *friends_lists_from_db = NULL;
......@@ -264,7 +265,9 @@ static void friends_sqlite_storage(void) {
cbs = linphone_factory_create_core_cbs(linphone_factory_get());
linphone_core_cbs_set_friend_list_created(cbs, friend_list_created_cb);
linphone_core_cbs_set_friend_list_removed(cbs, friend_list_removed_cb);
lc = linphone_factory_create_core_2(linphone_factory_get(), cbs, NULL, liblinphone_tester_get_empty_rc(), NULL, system_context);
lcm = linphone_core_manager_new2("stun_rc",FALSE);
lc = lcm->lc;
linphone_core_add_callbacks(lc, cbs);
linphone_core_cbs_unref(cbs);
friends = linphone_friend_list_get_friends(linphone_core_get_default_friend_list(lc));
lfl = linphone_core_create_friend_list(lc);
......@@ -351,9 +354,9 @@ static void friends_sqlite_storage(void) {
end:
ms_free(stats);
linphone_address_unref(addr);
linphone_core_unref(lc);
unlink(friends_db);
bc_free(friends_db);
linphone_core_manager_destroy(lcm);
}
static void friends_sqlite_store_lot_of_friends(void) {
......
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