From 5152ddd3a5a3cef6ca760105be03e959fda3c271 Mon Sep 17 00:00:00 2001
From: Andrea Gianarda <andrea.gianarda@belledonne-communications.com>
Date: Thu, 27 Feb 2025 14:33:27 +0100
Subject: [PATCH] Change chatroom API in order to redundancy in the Conference
 constructor as well as public API linphone_core_create_chat_room_7 functions.
 In fact, the conference parameters already have an account member therefore
 it is redundant to take the local address in as it might lead to an
 unexpected behaviour if not set correctly Rework me conference parameter
 member as it is not required anymore as the address of the me participant is
 the account identity address

---
 coreapi/callbacks.c                          |  22 ++-
 coreapi/chat.c                               |  22 ++-
 coreapi/linphonecore.c                       |  15 +-
 include/linphone/core.h                      |  54 +++----
 src/c-wrapper/api/c-conference.cpp           |  37 +++--
 src/call/call.cpp                            |   3 +-
 src/chat/chat-message/chat-message.cpp       |   5 +-
 src/chat/chat-room/chat-room.cpp             |   3 +-
 src/conference/ccmp-conference-scheduler.cpp |   4 +-
 src/conference/ccmp-conference-scheduler.h   |   3 +-
 src/conference/client-conference.cpp         |  32 ++--
 src/conference/client-conference.h           |   1 -
 src/conference/conference-params-interface.h |   7 -
 src/conference/conference-params.cpp         |   6 -
 src/conference/conference-params.h           |   8 -
 src/conference/conference-scheduler.cpp      |   4 +-
 src/conference/conference-scheduler.h        |   3 +-
 src/conference/conference.cpp                |  38 ++++-
 src/conference/conference.h                  |   2 +-
 src/conference/db-conference-scheduler.cpp   |   4 +-
 src/conference/db-conference-scheduler.h     |   3 +-
 src/conference/server-conference.cpp         |  27 ++--
 src/conference/server-conference.h           |   1 -
 src/conference/session/media-session.cpp     |  29 ++--
 src/conference/sip-conference-scheduler.cpp  |   5 +-
 src/conference/sip-conference-scheduler.h    |   3 +-
 src/core/core-chat-room.cpp                  |  46 +++---
 src/core/core-p.h                            |   4 -
 src/core/core.cpp                            |  17 ++-
 src/core/core.h                              |   1 -
 src/db/main-db.cpp                           |   4 +-
 tester/conference-event-tester.cpp           | 145 +++++++++----------
 tester/group_chat_tester.c                   |   3 +-
 tester/local-conference-tester-functions.cpp |  73 ++++++++++
 tester/local-scheduled-conference-tester.cpp |   6 +-
 tester/tester.c                              |   2 +-
 36 files changed, 370 insertions(+), 272 deletions(-)

diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c
index 262353fbaf..dd4cd5470f 100644
--- a/coreapi/callbacks.c
+++ b/coreapi/callbacks.c
@@ -181,6 +181,10 @@ static void call_received(SalCallOp *h) {
 #endif
 
 	auto params = ConferenceParams::create(L_GET_CPP_PTR_FROM_C_OBJECT(lc));
+	LinphoneAccount *account = linphone_core_lookup_account_by_identity(lc, to->toC());
+	if (account) {
+		params->setAccount(Account::toCpp(account)->getSharedFromThis());
+	}
 	params->setUtf8Subject(h->getSubject());
 	if (hasStreams) {
 		params->setAudioVideoDefaults();
@@ -322,7 +326,7 @@ static void call_received(SalCallOp *h) {
 						// The duration is stored in minutes whereas the start time in seconds
 						params->setEndTime(startTime + duration * 60);
 					}
-					conference = (new ServerConference(core, to, nullptr, params))->toSharedPtr();
+					conference = (new ServerConference(core, nullptr, params))->toSharedPtr();
 					conference->init(h);
 				} else
 #endif // HAVE_DB_STORAGE
@@ -338,7 +342,7 @@ static void call_received(SalCallOp *h) {
 							h->release();
 							return;
 						} else {
-							auto serverConference = (new ServerConference(core, to, nullptr, params))->toSharedPtr();
+							auto serverConference = (new ServerConference(core, nullptr, params))->toSharedPtr();
 							serverConference->init(h);
 							static_pointer_cast<ServerConference>(serverConference)->confirmCreation();
 							return;
@@ -985,12 +989,14 @@ static void message_delivery_update(SalOp *op, SalMessageDeliveryStatus status)
 	auto chatRoom = msg->getChatRoom();
 	// Check that the message does not belong to an already destroyed chat room - if so, do not invoke callbacks
 	if (chatRoom) {
-		auto errorInfo = op->getErrorInfo();
-		auto reason = errorInfo ? linphone_reason_from_sal(errorInfo->reason) : LinphoneReasonNone;
-		L_GET_PRIVATE(msg)->setParticipantState(
-		    chatRoom->getMe()->getAddress(),
-		    (LinphonePrivate::ChatMessage::State)chatStatusSal2Linphone(lc, status, errorInfo), ::ms_time(NULL),
-		    reason);
+		const auto &me = chatRoom->getMe();
+		if (me) {
+			auto errorInfo = op->getErrorInfo();
+			auto reason = errorInfo ? linphone_reason_from_sal(errorInfo->reason) : LinphoneReasonNone;
+			L_GET_PRIVATE(msg)->setParticipantState(
+			    me->getAddress(), (LinphonePrivate::ChatMessage::State)chatStatusSal2Linphone(lc, status, errorInfo),
+			    ::ms_time(NULL), reason);
+		}
 	}
 }
 
diff --git a/coreapi/chat.c b/coreapi/chat.c
index 0088ab5365..3efb2eb007 100644
--- a/coreapi/chat.c
+++ b/coreapi/chat.c
@@ -127,27 +127,37 @@ LinphoneChatRoom *linphone_core_create_chat_room_5(LinphoneCore *lc, const Linph
 	return result;
 }
 
+// Deprecated see linphone_core_create_chat_room_7
 LinphoneChatRoom *linphone_core_create_chat_room_6(LinphoneCore *lc,
                                                    const LinphoneChatRoomParams *params,
                                                    const LinphoneAddress *localAddr,
                                                    const bctbx_list_t *participants) {
-	return linphone_core_create_chat_room_7(lc, params, localAddr, participants);
+	LinphoneConferenceParams *cloned_params = NULL;
+	if (params) {
+		cloned_params = linphone_conference_params_clone(params);
+	} else {
+		cloned_params = linphone_core_create_conference_params_2(lc, NULL);
+	}
+	if (!linphone_conference_params_get_account(cloned_params) && localAddr) {
+		linphone_conference_params_set_account(cloned_params, linphone_core_lookup_account_by_identity(lc, localAddr));
+	}
+	LinphoneChatRoom *chat_room = linphone_core_create_chat_room_7(lc, cloned_params, participants);
+	if (cloned_params) {
+		linphone_conference_params_unref(cloned_params);
+	}
+	return chat_room;
 }
 
 LinphoneChatRoom *linphone_core_create_chat_room_7(LinphoneCore *lc,
                                                    const LinphoneConferenceParams *params,
-                                                   const LinphoneAddress *localAddr,
                                                    const bctbx_list_t *participants) {
 	CoreLogContextualizer logContextualizer(lc);
 	shared_ptr<LinphonePrivate::ConferenceParams> conferenceParams =
 	    params ? LinphonePrivate::ConferenceParams::toCpp(params)->clone()->toSharedPtr() : nullptr;
 	const list<std::shared_ptr<LinphonePrivate::Address>> participantsList =
 	    LinphonePrivate::Utils::bctbxListToCppSharedPtrList<LinphoneAddress, Address>(participants);
-	shared_ptr<const LinphonePrivate::Address> localAddress =
-	    localAddr ? LinphonePrivate::Address::toCpp(localAddr)->getSharedFromThis()
-	              : L_GET_PRIVATE_FROM_C_OBJECT(lc)->getDefaultLocalAddress(nullptr, false);
 	shared_ptr<LinphonePrivate::AbstractChatRoom> room =
-	    L_GET_PRIVATE_FROM_C_OBJECT(lc)->createChatRoom(conferenceParams, localAddress, participantsList);
+	    L_GET_PRIVATE_FROM_C_OBJECT(lc)->createChatRoom(conferenceParams, participantsList);
 	if (room) {
 		auto cRoom = room->toC();
 		linphone_chat_room_ref(cRoom);
diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c
index 026b02f60d..0827aae812 100644
--- a/coreapi/linphonecore.c
+++ b/coreapi/linphonecore.c
@@ -4742,7 +4742,7 @@ LinphoneProxyConfig *linphone_core_lookup_proxy_by_identity(LinphoneCore *lc, co
 }
 
 /*
- * Returns an account matching the given identity address
+ * Returns an account matching the given conference factory address
  * Prefers registered, then first registering matching, otherwise first matching
  * returns NULL if none is found
  */
@@ -9333,16 +9333,10 @@ LinphoneConference *linphone_core_create_conference_with_params(LinphoneCore *lc
 	linphone_conference_params_enable_audio(params2, TRUE);
 	LinphoneAccount *conference_account = linphone_conference_params_get_account(params2);
 	LinphoneAccount *default_account = linphone_core_get_default_account(lc);
-	const std::shared_ptr<LinphonePrivate::Address> &meAddress =
-	    LinphonePrivate::ConferenceParams::toCpp(params2)->getMe();
-	bool isMeValid = (meAddress && meAddress->isValid());
 	if (!conference_account) {
 		lWarning() << "The application didn't explicitely specified the account to use to create a conference, "
-		              "therefore the core is going to find the one matching the me address or the default account";
+		              "therefore the core is going to use the default account";
 		conference_account = linphone_core_get_default_account(lc);
-		if (isMeValid) {
-			conference_account = linphone_core_lookup_account_by_identity(lc, meAddress->toC());
-		}
 		linphone_conference_params_set_account(params2, conference_account);
 	}
 	const LinphoneAddress *factory_uri_const = linphone_conference_params_get_conference_factory_address(params2);
@@ -9354,10 +9348,7 @@ LinphoneConference *linphone_core_create_conference_with_params(LinphoneCore *lc
 		// backward compatibility : use default identity even if set in conference parameters
 		identity = linphone_address_new(core_identity);
 	} else {
-		if (isMeValid) {
-			lInfo() << "Creating conference with identity from conference params : " << *meAddress;
-			identity = linphone_address_clone(meAddress->toC());
-		} else if (conference_account) {
+		if (conference_account) {
 			identity = linphone_address_clone(
 			    linphone_account_params_get_identity_address(linphone_account_get_params(conference_account)));
 			lInfo() << "Creating conference with identity from conference " << *Account::toCpp(conference_account);
diff --git a/include/linphone/core.h b/include/linphone/core.h
index b977c58fc9..aa0be62b24 100644
--- a/include/linphone/core.h
+++ b/include/linphone/core.h
@@ -6209,36 +6209,17 @@ LINPHONE_PUBLIC bctbx_list_t *linphone_core_get_linphone_specs_list(LinphoneCore
  * @addtogroup chatroom
  * @{
  */
-
-/**
- * Create a chat room.
- *
- * @param core A #LinphoneCore object @notnil
- * @param params The chat room creation parameters #LinphoneChatRoomParams @notnil
- * @param localAddr #LinphoneAddress of a local #LinphoneAccount identity or NULL @maybenil
- * @param participants The initial list of participants of the chat room. \bctbx_list{LinphoneAddress} @notnil
- * @return The newly created chat room (can be an existing one if backend is Basic) or NULL. @maybenil
- * @deprecated 22/10/2024, use linphone_core_create_chat_room_7() instead
- * @ingroup chatroom
- */
-LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_create_chat_room_6(LinphoneCore *core,
-                                                                   const LinphoneChatRoomParams *params,
-                                                                   const LinphoneAddress *localAddr,
-                                                                   const bctbx_list_t *participants);
-
 /**
  * Create a chat room.
  *
  * @param core A #LinphoneCore object @notnil
  * @param params The chat room creation parameters #LinphoneConferenceParams @notnil
- * @param localAddr #LinphoneAddress of a local #LinphoneAccount identity or NULL @maybenil
  * @param participants The initial list of participants of the chat room. \bctbx_list{LinphoneAddress} @notnil
  * @return The newly created chat room (can be an existing one if backend is Basic) or NULL. @maybenil
  * @ingroup chatroom
  */
 LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_create_chat_room_7(LinphoneCore *core,
                                                                    const LinphoneConferenceParams *params,
-                                                                   const LinphoneAddress *localAddr,
                                                                    const bctbx_list_t *participants);
 
 /**
@@ -7807,13 +7788,15 @@ LINPHONE_PUBLIC bool_t linphone_core_get_register_only_when_network_is_up(const
  * @return #LinphoneCall or NULL if no match is found. @maybenil
  * @deprecated 27/10/2020. Use linphone_core_get_call_by_remote_address2() instead.
  */
-LINPHONE_PUBLIC LinphoneCall *linphone_core_find_call_from_uri(const LinphoneCore *core, const char *uri);
+LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneCall *linphone_core_find_call_from_uri(const LinphoneCore *core,
+                                                                                   const char *uri);
 
 /**
  * Create some default conference parameters for instanciating a conference with
  *linphone_core_create_conference_with_params().
  * @param core the #LinphoneCore object @notnil
  * @return a #LinphoneConferenceParams object. @notnil
+ * @deprecated 23/07/2024. Use linphone_core_create_conference_params_2() instead.
  **/
 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneConferenceParams *
 linphone_core_create_conference_params(LinphoneCore *core);
@@ -9002,7 +8985,7 @@ LINPHONE_PUBLIC void linphone_core_enable_database(LinphoneCore *core, bool_t va
  * @param fallback Boolean value telling whether we should plan on being able to fallback to a basic chat room if the
  * client-side group chat room creation fails
  * @return The newly created client-side group chat room. @maybenil
- * @deprecated 02/07/2020, use linphone_core_create_chat_room_6() instead
+ * @deprecated 02/07/2020, use linphone_core_create_chat_room_7() instead
  * @ingroup chatroom
  */
 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *
@@ -9022,7 +9005,7 @@ linphone_core_create_client_group_chat_room(LinphoneCore *core, const char *subj
  * @param encrypted Boolean value telling whether we should apply encryption or not on chat messages sent and received
  * on this room.
  * @return The newly created client-side group chat room. @maybenil
- * @deprecated 02/07/2020, use linphone_core_create_chat_room_6() instead
+ * @deprecated 02/07/2020, use linphone_core_create_chat_room_7() instead
  * @ingroup chatroom
  */
 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *linphone_core_create_client_group_chat_room_2(LinphoneCore *core,
@@ -9040,7 +9023,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *linphone_core_create_clien
  * @param subject The subject of the group chat room @notnil
  * @param participants The initial list of participants of the chat room \bctbx_list{LinphoneAddress} @notnil
  * @return The newly created chat room. @maybenil
- * @deprecated 02/07/2020, use linphone_core_create_chat_room_6() instead
+ * @deprecated 02/07/2020, use linphone_core_create_chat_room_7() instead
  * @ingroup chatroom
  */
 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *
@@ -9058,7 +9041,7 @@ linphone_core_create_chat_room(LinphoneCore *core,
  * @param subject The subject of the group chat room @notnil
  * @param participants The initial list of participants of the chat room. \bctbx_list{LinphoneAddress} @notnil
  * @return The newly created chat room. @maybenil
- * @deprecated 02/07/2020, use linphone_core_create_chat_room_6() instead
+ * @deprecated 02/07/2020, use linphone_core_create_chat_room_7() instead
  * @ingroup chatroom
  */
 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *linphone_core_create_chat_room_2(
@@ -9070,7 +9053,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *linphone_core_create_chat_
  * @param subject The subject of the group chat room @notnil
  * @param participants The initial list of participants of the chat room. \bctbx_list{LinphoneAddress} @notnil
  * @return The newly created chat room. @maybenil
- * @deprecated 02/07/2020, use linphone_core_create_chat_room_6() instead
+ * @deprecated 02/07/2020, use linphone_core_create_chat_room_7() instead
  * @ingroup chatroom
  */
 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *
@@ -9084,7 +9067,7 @@ linphone_core_create_chat_room_3(LinphoneCore *core, const char *subject, const
  * @notnil
  * @param participant #LinphoneAddress representing the initial participant to add to the chat room @notnil
  * @return The newly created chat room. @maybenil
- * @deprecated 02/07/2020, use linphone_core_create_chat_room_6() instead
+ * @deprecated 02/07/2020, use linphone_core_create_chat_room_7() instead
  * @ingroup chatroom
  */
 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *
@@ -9098,12 +9081,29 @@ linphone_core_create_chat_room_4(LinphoneCore *core,
  * @param core A #LinphoneCore object @notnil
  * @param participant #LinphoneAddress representing the initial participant to add to the chat room @notnil
  * @return The newly created chat room. @maybenil
- * @deprecated 02/07/2020, use linphone_core_create_chat_room_6() instead
+ * @deprecated 02/07/2020, use linphone_core_create_chat_room_7() instead
  * @ingroup chatroom
  */
 LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *
 linphone_core_create_chat_room_5(LinphoneCore *core, const LinphoneAddress *participant);
 
+/**
+ * Create a chat room.
+ *
+ * @param core A #LinphoneCore object @notnil
+ * @param params The chat room creation parameters #LinphoneChatRoomParams @notnil
+ * @param localAddr #LinphoneAddress of a local #LinphoneAccount identity or NULL @maybenil
+ * @param participants The initial list of participants of the chat room. \bctbx_list{LinphoneAddress} @notnil
+ * @return The newly created chat room (can be an existing one if backend is Basic) or NULL. @maybenil
+ * @deprecated 22/10/2024, use linphone_core_create_chat_room_7() instead
+ * @ingroup chatroom
+ */
+LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneChatRoom *
+linphone_core_create_chat_room_6(LinphoneCore *core,
+                                 const LinphoneChatRoomParams *params,
+                                 const LinphoneAddress *localAddr,
+                                 const bctbx_list_t *participants);
+
 /**
  * Get a chat room whose peer is the supplied address. If it does not exist yet, it will be created as a basic chat
  *room. No reference is transferred to the application. The #LinphoneCore keeps a reference on the chat room.
diff --git a/src/c-wrapper/api/c-conference.cpp b/src/c-wrapper/api/c-conference.cpp
index 15b6c5e258..45b90f6d1e 100644
--- a/src/c-wrapper/api/c-conference.cpp
+++ b/src/c-wrapper/api/c-conference.cpp
@@ -71,12 +71,22 @@ LinphoneConference *linphone_local_conference_new(LinphoneCore *core, LinphoneAd
 LinphoneConference *linphone_local_conference_new_with_params(LinphoneCore *core,
                                                               LinphoneAddress *addr,
                                                               const LinphoneConferenceParams *params) {
+
+	LinphoneConferenceParams *cloned_params = NULL;
+	if (params) {
+		cloned_params = linphone_conference_params_clone(params);
+	} else {
+		cloned_params = linphone_core_create_conference_params_2(core, NULL);
+	}
+	if (!linphone_conference_params_get_account(cloned_params) && addr) {
+		linphone_conference_params_set_account(cloned_params, linphone_core_lookup_account_by_identity(core, addr));
+	}
+	std::shared_ptr<ConferenceParams> conf_params = ConferenceParams::toCpp(cloned_params)->getSharedFromThis();
 	std::shared_ptr<Conference> localConf =
-	    (new ServerConference(
-	         L_GET_CPP_PTR_FROM_C_OBJECT(core), Address::toCpp(addr)->getSharedFromThis(), nullptr,
-	         params ? ConferenceParams::toCpp(const_cast<LinphoneConferenceParams *>(params))->getSharedFromThis()
-	                : ConferenceParams::create(L_GET_CPP_PTR_FROM_C_OBJECT(core))))
-	        ->toSharedPtr();
+	    (new ServerConference(L_GET_CPP_PTR_FROM_C_OBJECT(core), nullptr, conf_params))->toSharedPtr();
+	if (cloned_params) {
+		linphone_conference_params_unref(cloned_params);
+	}
 	localConf->init();
 	localConf->ref();
 	return localConf->toC();
@@ -90,16 +100,21 @@ LinphoneConference *linphone_remote_conference_new_with_params(LinphoneCore *cor
                                                                LinphoneAddress *focus,
                                                                LinphoneAddress *addr,
                                                                const LinphoneConferenceParams *params) {
-	std::shared_ptr<const ConferenceParams> conf_params = nullptr;
+	LinphoneConferenceParams *cloned_params = NULL;
 	if (params) {
-		conf_params = ConferenceParams::toCpp(params)->getSharedFromThis();
+		cloned_params = linphone_conference_params_clone(params);
 	} else {
-		conf_params = ConferenceParams::create(L_GET_CPP_PTR_FROM_C_OBJECT(core));
+		cloned_params = linphone_core_create_conference_params_2(core, NULL);
 	}
+	if (!linphone_conference_params_get_account(cloned_params) && addr) {
+		linphone_conference_params_set_account(cloned_params, linphone_core_lookup_account_by_identity(core, addr));
+	}
+	std::shared_ptr<const ConferenceParams> conf_params = ConferenceParams::toCpp(cloned_params)->getSharedFromThis();
 	std::shared_ptr<Conference> conference =
-	    (new ClientConference(L_GET_CPP_PTR_FROM_C_OBJECT(core), Address::toCpp(addr)->getSharedFromThis(), nullptr,
-	                          conf_params))
-	        ->toSharedPtr();
+	    (new ClientConference(L_GET_CPP_PTR_FROM_C_OBJECT(core), nullptr, conf_params))->toSharedPtr();
+	if (cloned_params) {
+		linphone_conference_params_unref(cloned_params);
+	}
 	static_pointer_cast<ClientConference>(conference)
 	    ->initWithFocus(Address::toCpp(focus)->getSharedFromThis(), nullptr, nullptr, conference.get());
 	conference->ref();
diff --git a/src/call/call.cpp b/src/call/call.cpp
index 0bc87c07f0..4b698114b5 100644
--- a/src/call/call.cpp
+++ b/src/call/call.cpp
@@ -564,6 +564,7 @@ void Call::createClientConference(const shared_ptr<CallSession> &session) {
 		}
 	} else {
 		auto confParams = ConferenceParams::create(getCore());
+		confParams->setAccount(getParams()->getAccount());
 		std::shared_ptr<SalMediaDescription> md = (op) ? op->getFinalMediaDescription() : nullptr;
 
 		if (op && op->getSal()->mediaDisabled()) md = op->getRemoteMediaDescription();
@@ -576,7 +577,7 @@ void Call::createClientConference(const shared_ptr<CallSession> &session) {
 
 		if (confParams->audioEnabled() || confParams->videoEnabled() || confParams->chatEnabled()) {
 			clientConference = dynamic_pointer_cast<ClientConference>(
-			    (new ClientConference(getCore(), conferenceId.getLocalAddress(), nullptr, confParams))->toSharedPtr());
+			    (new ClientConference(getCore(), nullptr, confParams))->toSharedPtr());
 			clientConference->initWithFocus(remoteContactAddress, session, op);
 		} else {
 			lError() << "Unable to attach call (local address " << *session->getLocalAddress() << " remote address "
diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp
index dd7b2c500f..00160523f6 100644
--- a/src/chat/chat-message/chat-message.cpp
+++ b/src/chat/chat-message/chat-message.cpp
@@ -850,7 +850,10 @@ void ChatMessagePrivate::setChatRoom(const shared_ptr<AbstractChatRoom> &chatRoo
 		fromAddress = peerAddress;
 		toAddress = localAddress;
 	}
-	mMeAddress = chatRoom->getMe()->getAddress()->clone()->toSharedPtr();
+	const auto &me = chatRoom->getMe();
+	if (me) {
+		mMeAddress = me->getAddress()->clone()->toSharedPtr();
+	}
 }
 
 // -----------------------------------------------------------------------------
diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp
index 2a667361cb..eae6947e9e 100644
--- a/src/chat/chat-room/chat-room.cpp
+++ b/src/chat/chat-room/chat-room.cpp
@@ -332,6 +332,7 @@ std::shared_ptr<AbstractChatRoom> ChatRoom::getImdnChatRoom(const std::shared_pt
 		chatRoom = getCore()->getPrivate()->searchChatRoom(getCurrentParams(), getLocalAddress(), peerAddress, {});
 		if (!chatRoom) {
 			shared_ptr<ConferenceParams> params = ConferenceParams::create(getCore());
+			params->setAccount(getCurrentParams()->getAccount());
 			params->setChatDefaults();
 			params->setGroup(false);
 			auto isEncrypted = getCurrentParams()->getChatParams()->isEncrypted();
@@ -345,7 +346,7 @@ std::shared_ptr<AbstractChatRoom> ChatRoom::getImdnChatRoom(const std::shared_pt
 				params->getChatParams()->setBackend(ChatParams::Backend::Basic);
 				params->setSecurityLevel(ConferenceParams::SecurityLevel::None);
 			}
-			chatRoom = getCore()->getPrivate()->createChatRoom(params, getLocalAddress(), peerAddress);
+			chatRoom = getCore()->getPrivate()->createChatRoom(params, peerAddress);
 		}
 	}
 	return chatRoom;
diff --git a/src/conference/ccmp-conference-scheduler.cpp b/src/conference/ccmp-conference-scheduler.cpp
index b4bb771853..d7f6019965 100644
--- a/src/conference/ccmp-conference-scheduler.cpp
+++ b/src/conference/ccmp-conference-scheduler.cpp
@@ -81,10 +81,10 @@ void CCMPConferenceScheduler::handleCCMPResponse(const HttpResponse &response) {
 	}
 }
 
-void CCMPConferenceScheduler::createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo,
-                                                       const std::shared_ptr<Address> &creator) {
+void CCMPConferenceScheduler::createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo) {
 	const auto &account = getAccount() ? getAccount() : getCore()->getDefaultAccount();
 	const auto accountParams = account ? account->getAccountParams() : nullptr;
+	const auto &creator = accountParams->getIdentityAddress();
 
 	if (!accountParams) {
 		lError() << "Aborting creation of conference because the account of conference scheduler [" << this
diff --git a/src/conference/ccmp-conference-scheduler.h b/src/conference/ccmp-conference-scheduler.h
index 32ecd93a04..de55fee907 100644
--- a/src/conference/ccmp-conference-scheduler.h
+++ b/src/conference/ccmp-conference-scheduler.h
@@ -33,8 +33,7 @@ public:
 	CCMPConferenceScheduler(const std::shared_ptr<Core> &core, const std::shared_ptr<Account> &account = nullptr);
 	virtual ~CCMPConferenceScheduler() = default;
 
-	virtual void createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo,
-	                                      const std::shared_ptr<Address> &creator) override;
+	virtual void createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo) override;
 
 	virtual void processResponse(const LinphoneErrorInfo *errorInfo,
 	                             const std::shared_ptr<Address> conferenceAddress) override;
diff --git a/src/conference/client-conference.cpp b/src/conference/client-conference.cpp
index 96e089cbd0..0b1169d2fd 100644
--- a/src/conference/client-conference.cpp
+++ b/src/conference/client-conference.cpp
@@ -53,10 +53,9 @@ using namespace std;
 LINPHONE_BEGIN_NAMESPACE
 
 ClientConference::ClientConference(const shared_ptr<Core> &core,
-                                   const std::shared_ptr<Address> &myAddress,
                                    std::shared_ptr<CallSessionListener> listener,
                                    const std::shared_ptr<const ConferenceParams> params)
-    : Conference(core, myAddress, listener, params) {
+    : Conference(core, listener, params) {
 }
 
 ClientConference::~ClientConference() {
@@ -100,7 +99,7 @@ void ClientConference::initFromDb(const std::shared_ptr<Participant> &me,
                                   bool hasBeenLeft) {
 	const auto &conferenceAddress = mConfParams->getConferenceAddress();
 	createFocus(conferenceAddress, nullptr);
-	mMe = Participant::create(getSharedFromThis(), mConfParams->getMe());
+	mMe = Participant::create(getSharedFromThis(), me->getAddress());
 	mMe->setAdmin(me->isAdmin());
 	for (const auto &device : me->getDevices()) {
 		mMe->addDevice(device);
@@ -143,11 +142,11 @@ void ClientConference::init(SalCallOp *op, BCTBX_UNUSED(ConferenceListener *conf
 	// Local conference sets last notify to 1 in its constructor
 	setLastNotify(0);
 
-	const auto &meAddress = mConfParams->getMe();
-	mMe = Participant::create(getSharedFromThis(), meAddress);
+	inititializeMe();
+
+	const auto &core = getCore();
 	std::shared_ptr<Address> organizerAddress = nullptr;
 	auto conferenceAddress = mFocus ? mFocus->getAddress() : nullptr;
-	const auto &core = getCore();
 	std::shared_ptr<ConferenceInfo> conferenceInfo = nullptr;
 #ifdef HAVE_DB_STORAGE
 	if (conferenceAddress && core->getPrivate()->mainDb && supportsMedia()) {
@@ -203,6 +202,7 @@ void ClientConference::init(SalCallOp *op, BCTBX_UNUSED(ConferenceListener *conf
 	}
 #endif // HAVE_ADVANCED_IM
 
+	const auto &meAddress = mMe->getAddress();
 	if (supportsMedia()) {
 		getMe()->setAdmin((focusSession == nullptr) || (organizerAddress == nullptr) ||
 		                  organizerAddress->weakEqual(*meAddress));
@@ -434,13 +434,20 @@ void ClientConference::setConferenceId(const ConferenceId &conferenceId) {
 	if (mFocus) {
 		shared_ptr<CallSession> session = mFocus->getSession();
 		if (session) {
-			shared_ptr<CallLog> sessionLog = session->getLog();
+			std::shared_ptr<Address> address;
 			if (conferenceId.getPeerAddress()->isValid()) {
-				// Use the peer address of the conference ID because it has also the conf-id param hence the To field
-				// can be used to search in the map of chat rooms
-				sessionLog->setToAddress(conferenceId.getPeerAddress());
+				// Use the peer address of the conference ID because it has also the conf-id param hence the To or From
+				// field can be used to search in the map of conferences or chat rooms
+				address = conferenceId.getPeerAddress();
+			} else {
+				address = mFocus->getAddress();
+			}
+			const auto &direction = session->getDirection();
+			auto sessionLog = session->getLog();
+			if (direction == LinphoneCallIncoming) {
+				sessionLog->setFromAddress(address);
 			} else {
-				sessionLog->setToAddress(mFocus->getAddress());
+				sessionLog->setToAddress(address);
 			}
 		}
 	}
@@ -2035,8 +2042,7 @@ int ClientConference::inviteAddresses(const std::list<std::shared_ptr<Address>>
 
 	// The main session for the time being is the one used to create the conference. It will later replaced by the
 	// actual session used to join the conference
-	auto session =
-	    getCore()->createOrUpdateConferenceOnServer(mConfParams, organizer, invitees, getConferenceAddress(), ref);
+	auto session = getCore()->createOrUpdateConferenceOnServer(mConfParams, invitees, getConferenceAddress(), ref);
 	if (!session) {
 		lInfo() << "Aborting creation of conference " << *this << " because the call session cannot be established";
 		setState(ConferenceInterface::State::CreationFailed);
diff --git a/src/conference/client-conference.h b/src/conference/client-conference.h
index 24285440ce..c0bd05f664 100644
--- a/src/conference/client-conference.h
+++ b/src/conference/client-conference.h
@@ -39,7 +39,6 @@ class LINPHONE_PUBLIC ClientConference : public Conference, public ConferenceLis
 
 public:
 	ClientConference(const std::shared_ptr<Core> &core,
-	                 const std::shared_ptr<Address> &meAddr,
 	                 std::shared_ptr<CallSessionListener> listener,
 	                 const std::shared_ptr<const ConferenceParams> params);
 	virtual ~ClientConference();
diff --git a/src/conference/conference-params-interface.h b/src/conference/conference-params-interface.h
index 0c84e992e4..d1ec03533d 100644
--- a/src/conference/conference-params-interface.h
+++ b/src/conference/conference-params-interface.h
@@ -67,13 +67,6 @@ public:
 	 */
 	virtual void setUtf8Subject(const std::string &subject) = 0;
 
-	/*
-	 *Set participant representing myself in this Conference.
-	 *If set this participant is added to the conference
-	 * @param[in]  participantAddress of the conference focus.
-	 */
-	virtual void setMe(const std::shared_ptr<const Address> &participantAddress) = 0;
-
 	/*
 	 * Enable audio media type for a conference
 	 * @param enable If true, audio will be enabled during conference
diff --git a/src/conference/conference-params.cpp b/src/conference/conference-params.cpp
index 6a4e0a9b40..4eb6b1b7d4 100644
--- a/src/conference/conference-params.cpp
+++ b/src/conference/conference-params.cpp
@@ -113,12 +113,6 @@ void ConferenceParams::updateFromAccount(
 	if (account) {
 		auto accountParams = account->getAccountParams();
 		if (accountParams) {
-			auto identity = accountParams->getIdentityAddress();
-			if (identity) {
-				setMe(identity);
-			} else {
-				setMe(nullptr);
-			}
 			if (mUseDefaultFactoryAddress) {
 				const auto &conferenceFactory = (audioEnabled() || videoEnabled())
 				                                    ? accountParams->getAudioVideoConferenceFactoryAddress()
diff --git a/src/conference/conference-params.h b/src/conference/conference-params.h
index 16dbb3b783..a28d1bf4cd 100644
--- a/src/conference/conference-params.h
+++ b/src/conference/conference-params.h
@@ -128,14 +128,6 @@ public:
 		return mUtf8Subject;
 	}
 	const std::string &getSubject() const;
-
-	virtual void setMe(const std::shared_ptr<const Address> &participantAddress) override {
-		mMe = participantAddress ? participantAddress->clone()->toSharedPtr() : nullptr;
-	};
-	std::shared_ptr<Address> getMe() const {
-		return mMe;
-	};
-
 	void setAccount(const std::shared_ptr<Account> &a);
 	std::shared_ptr<Account> getAccount() const;
 
diff --git a/src/conference/conference-scheduler.cpp b/src/conference/conference-scheduler.cpp
index cd3587b108..fc3326854d 100644
--- a/src/conference/conference-scheduler.cpp
+++ b/src/conference/conference-scheduler.cpp
@@ -206,7 +206,7 @@ void ConferenceScheduler::setInfo(const std::shared_ptr<ConferenceInfo> &info) {
 
 	mConferenceInfo = clone;
 
-	createOrUpdateConference(mConferenceInfo, creator);
+	createOrUpdateConference(mConferenceInfo);
 }
 
 void ConferenceScheduler::onChatMessageStateChanged(const shared_ptr<ChatMessage> &message, ChatMessage::State state) {
@@ -485,7 +485,7 @@ void ConferenceScheduler::sendInvitations(shared_ptr<ConferenceParams> conferenc
 		if (!chatRoom) {
 			lInfo() << "[Conference Scheduler] [" << this << "] Existing chat room between [" << *sender << "] and ["
 			        << *participant << "] wasn't found, creating it.";
-			chatRoom = getCore()->getPrivate()->createChatRoom(conferenceParams, sender, chatRoomParticipantList);
+			chatRoom = getCore()->getPrivate()->createChatRoom(conferenceParams, chatRoomParticipantList);
 		} else {
 			lInfo() << "[Conference Scheduler] [" << this << "] Found existing chat room ["
 			        << *chatRoom->getPeerAddress() << "] between [" << *sender << "] and [" << *participant
diff --git a/src/conference/conference-scheduler.h b/src/conference/conference-scheduler.h
index 02e99fa2b9..0b44d2f8b6 100644
--- a/src/conference/conference-scheduler.h
+++ b/src/conference/conference-scheduler.h
@@ -79,8 +79,7 @@ protected:
 	                                                         bool cancel);
 	void fillCancelList(const ConferenceInfo::participant_list_t &oldList,
 	                    const ConferenceInfo::participant_list_t &newList);
-	virtual void createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo,
-	                                      const std::shared_ptr<Address> &creator) = 0;
+	virtual void createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo) = 0;
 	virtual void processResponse(const LinphoneErrorInfo *errorCode,
 	                             const std::shared_ptr<Address> conferenceAddress) = 0;
 
diff --git a/src/conference/conference.cpp b/src/conference/conference.cpp
index 195f1810ce..939359a956 100644
--- a/src/conference/conference.cpp
+++ b/src/conference/conference.cpp
@@ -61,14 +61,11 @@ const std::string Conference::IsFocusParameter = "isfocus";
 const std::string Conference::TextParameter = "text";
 
 Conference::Conference(const shared_ptr<Core> &core,
-                       const std::shared_ptr<const Address> &myAddress,
                        std::shared_ptr<CallSessionListener> callSessionListener,
                        const std::shared_ptr<const ConferenceParams> params)
-    : CoreAccessor(core), mConferenceId(Address(), Address(*myAddress), core->createConferenceIdParams()) {
+    : CoreAccessor(core) {
 	mCallSessionListener = callSessionListener;
 	update(*params);
-	mConfParams->setMe(myAddress);
-
 	if (mConfParams->videoEnabled()) {
 		// If video is enabled, then always enable audio capabilities
 		mConfParams->enableAudio(true);
@@ -101,6 +98,27 @@ Conference::~Conference() {
 }
 
 // -----------------------------------------------------------------------------
+void Conference::inititializeMe() {
+	const auto &core = getCore();
+	auto account = mConfParams->getAccount();
+	if (!account) {
+		account = core->getDefaultAccount();
+		if (account) {
+			lInfo() << "Using default account " << *account << " for " << *this
+			        << " because it was not set in the conference parameters";
+			mConfParams->setAccount(account);
+		} else {
+			lInfo() << "Not setting account for " << *this
+			        << " because it was not set in the conference parameters and the core has no default account";
+		}
+	}
+
+	if (account) {
+		auto meAddress = account->getAccountParams()->getIdentityAddress()->getUri();
+		mConferenceId = ConferenceId(Address(), std::move(meAddress), core->createConferenceIdParams());
+		mMe = Participant::create(getSharedFromThis(), mConferenceId.getLocalAddress());
+	}
+}
 
 void Conference::removeListener(std::shared_ptr<ConferenceListenerInterface> listener) {
 	mConfListeners.remove(listener);
@@ -366,7 +384,7 @@ bool Conference::addParticipant(const std::shared_ptr<Address> &participantAddre
 }
 
 std::shared_ptr<CallSession> Conference::getMainSession() const {
-	return mMe->getSession();
+	return mMe ? mMe->getSession() : nullptr;
 }
 
 bool Conference::addParticipants(const std::list<std::shared_ptr<Address>> &addresses) {
@@ -1071,6 +1089,14 @@ std::map<ConferenceMediaCapabilities, bool> Conference::getMediaCapabilities() c
 // -----------------------------------------------------------------------------
 
 bool Conference::isMe(const std::shared_ptr<const Address> &addr) const {
+	if (!mMe) {
+		// Cannot know if it is the me participant if it is not defined.
+		// This may happen when a server chat room is retrieved from the database. The me participant is not defined as
+		// it has already been created. The server is therefore a passive component whose task is to dispatch MESSAGE
+		// request or handle participants.
+		lDebug() << *this << ": Unable to known if the me participant is not defined";
+		return false;
+	}
 	if (!addr || !addr->isValid()) {
 		lError() << *this << ": Unable to known if an invalid address is the me participant";
 		return false;
@@ -1838,7 +1864,7 @@ int Conference::stopRecording() {
 	if (aci) {
 		aci->stopRecording();
 	} else {
-		lError() << "ServerConference::stopRecording(): no audio mixer.";
+		lError() << "Conference::stopRecording(): no audio mixer.";
 		return -1;
 	}
 	return 0;
diff --git a/src/conference/conference.h b/src/conference/conference.h
index d474bbeeb0..705a2b7f0b 100644
--- a/src/conference/conference.h
+++ b/src/conference/conference.h
@@ -357,7 +357,6 @@ public:
 
 protected:
 	explicit Conference(const std::shared_ptr<Core> &core,
-	                    const std::shared_ptr<const Address> &myAddress,
 	                    std::shared_ptr<CallSessionListener> callSessionListener,
 	                    const std::shared_ptr<const ConferenceParams> params);
 
@@ -429,6 +428,7 @@ protected:
 	void notifyNewDevice(const std::shared_ptr<ParticipantDevice> &device);
 
 	virtual void configure(SalCallOp *op) = 0;
+	void inititializeMe();
 
 	void incrementLastNotify();
 	void setLastNotify(unsigned int lastNotify);
diff --git a/src/conference/db-conference-scheduler.cpp b/src/conference/db-conference-scheduler.cpp
index cc77bc8d1c..b8df1b1264 100644
--- a/src/conference/db-conference-scheduler.cpp
+++ b/src/conference/db-conference-scheduler.cpp
@@ -38,13 +38,15 @@ DBConferenceScheduler::DBConferenceScheduler(const shared_ptr<Core> &core, const
 }
 
 void DBConferenceScheduler::createOrUpdateConference(
-    BCTBX_UNUSED(const std::shared_ptr<ConferenceInfo> &conferenceInfo), const std::shared_ptr<Address> &creator) {
+    BCTBX_UNUSED(const std::shared_ptr<ConferenceInfo> &conferenceInfo)) {
 	std::shared_ptr<Address> conferenceAddress = nullptr;
 	if (getState() == State::AllocationPending) {
 		if (mConferenceInfo->getDateTime() <= 0) {
 			// Set start time only if a conference is going to be created
 			mConferenceInfo->setDateTime(ms_time(NULL));
 		}
+		const auto &account = getAccount() ? getAccount() : getCore()->getDefaultAccount();
+		const auto &creator = account->getAccountParams()->getIdentityAddress();
 		conferenceAddress = creator->clone()->toSharedPtr();
 		char confId[LinphonePrivate::ServerConference::sConfIdLength];
 		belle_sip_random_token(confId, sizeof(confId));
diff --git a/src/conference/db-conference-scheduler.h b/src/conference/db-conference-scheduler.h
index 436bbc2f14..7ec081992f 100644
--- a/src/conference/db-conference-scheduler.h
+++ b/src/conference/db-conference-scheduler.h
@@ -32,8 +32,7 @@ public:
 	DBConferenceScheduler(const std::shared_ptr<Core> &core, const std::shared_ptr<Account> &account = nullptr);
 	virtual ~DBConferenceScheduler() = default;
 
-	virtual void createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo,
-	                                      const std::shared_ptr<Address> &creator) override;
+	virtual void createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo) override;
 
 	virtual void processResponse(const LinphoneErrorInfo *errorInfo,
 	                             const std::shared_ptr<Address> conferenceAddress) override;
diff --git a/src/conference/server-conference.cpp b/src/conference/server-conference.cpp
index ff2e662fbe..55ffe1121d 100644
--- a/src/conference/server-conference.cpp
+++ b/src/conference/server-conference.cpp
@@ -57,10 +57,9 @@ LINPHONE_BEGIN_NAMESPACE
 constexpr int SERVER_CONFIGURATION_FAILED = 1;
 
 ServerConference::ServerConference(const shared_ptr<Core> &core,
-                                   const std::shared_ptr<const Address> &myAddress,
                                    std::shared_ptr<CallSessionListener> listener,
                                    const std::shared_ptr<ConferenceParams> params)
-    : Conference(core, myAddress, listener, params) {
+    : Conference(core, listener, params) {
 }
 
 ServerConference::~ServerConference() {
@@ -77,11 +76,13 @@ ServerConference::~ServerConference() {
 	cleanup();
 }
 
-void ServerConference::initFromDb(BCTBX_UNUSED(const std::shared_ptr<Participant> &me),
+void ServerConference::initFromDb(const std::shared_ptr<Participant> &me,
                                   const ConferenceId conferenceId,
                                   const unsigned int lastNotifyId,
                                   BCTBX_UNUSED(bool hasBeenLeft)) {
-	mMe = Participant::create(getSharedFromThis(), mConfParams->getMe());
+	if (me) {
+		mMe = me->clone()->toSharedPtr();
+	}
 	setLastNotify(lastNotifyId);
 	mConferenceId = conferenceId;
 	getCore()->getPrivate()->registerListener(this);
@@ -104,27 +105,29 @@ void ServerConference::init(SalCallOp *op, ConferenceListener *confListener) {
 	// Set last notify to 1 in order to ensure that the 1st notify to client conference is correctly processed
 	// Remote conference sets last notify to 0 in its constructor
 	setLastNotify(1);
-	mMe = Participant::create(getSharedFromThis(), mConfParams->getMe());
+
+	inititializeMe();
 	setOrganizer(op ? Address::create(op->getFrom()) : mMe->getAddress());
 
+	const auto &core = getCore();
 	createEventHandler(confListener);
 	if (mConfParams->chatEnabled()) {
 		mConfParams->enableLocalParticipant(false);
-		getCore()->getPrivate()->registerListener(this);
+		core->getPrivate()->registerListener(this);
 #ifdef HAVE_ADVANCED_IM
 		auto chatRoom =
-		    dynamic_pointer_cast<ServerChatRoom>((new ServerChatRoom(getCore(), getSharedFromThis()))->toSharedPtr());
+		    dynamic_pointer_cast<ServerChatRoom>((new ServerChatRoom(core, getSharedFromThis()))->toSharedPtr());
 		setChatRoom(chatRoom);
 #endif // HAVE_ADVANCED_IM
 	}
 	setState(ConferenceInterface::State::Instantiated);
-	LinphoneCore *lc = getCore()->getCCore();
+	LinphoneCore *lc = core->getCCore();
 	if (op) {
 		configure(op);
 	} else {
 		// Update proxy contact address to add conference ID
 		// Do not use organizer address directly as it may lack some parameter like gruu
-		auto account = getCore()->lookupKnownAccount(mOrganizer, true);
+		auto account = core->lookupKnownAccount(mOrganizer, true);
 		char *contactAddressStr = nullptr;
 		if (account && account->getOp()) {
 			contactAddressStr = sal_address_as_string(account->getOp()->getContactAddress());
@@ -153,13 +156,13 @@ void ServerConference::init(SalCallOp *op, ConferenceListener *confListener) {
 #endif // HAVE_ADVANCED_IM
 
 		if (!eventLogEnabled) {
-			setConferenceId(ConferenceId(contactAddress, contactAddress, getCore()->createConferenceIdParams()));
+			setConferenceId(ConferenceId(contactAddress, contactAddress, core->createConferenceIdParams()));
 		}
 
 #ifdef HAVE_DB_STORAGE
 		const auto &conferenceInfo = createOrGetConferenceInfo();
 		if (conferenceInfo) {
-			auto &mainDb = getCore()->getPrivate()->mainDb;
+			auto &mainDb = core->getPrivate()->mainDb;
 			if (mainDb) {
 				lInfo() << "Inserting new conference information to database in order to be able to recreate the "
 				           "conference "
@@ -971,7 +974,7 @@ void ServerConference::finalizeCreation() {
 		if (createdConference) {
 			lInfo() << "Conference [" << this << "] with address " << *conferenceAddress
 			        << " has already been created therefore no need to carry out the redirection to its address";
-		} else {
+		} else if (mMe) {
 			shared_ptr<CallSession> session = mMe->getSession();
 			if (session) {
 				if (mConfParams->getJoiningMode() == ConferenceParams::JoiningMode::DialOut) {
diff --git a/src/conference/server-conference.h b/src/conference/server-conference.h
index 333f75debc..2f147b6b2e 100644
--- a/src/conference/server-conference.h
+++ b/src/conference/server-conference.h
@@ -47,7 +47,6 @@ public:
 	static constexpr int sConfIdLength = 32;
 
 	ServerConference(const std::shared_ptr<Core> &core,
-	                 const std::shared_ptr<const Address> &myAddress,
 	                 std::shared_ptr<CallSessionListener> listener,
 	                 const std::shared_ptr<ConferenceParams> params);
 	virtual ~ServerConference();
diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp
index 7227143b36..d18416b0be 100644
--- a/src/conference/session/media-session.cpp
+++ b/src/conference/session/media-session.cpp
@@ -1055,7 +1055,7 @@ void MediaSessionPrivate::setState(CallSession::State newState, const string &me
 	if ((newState != state) && (newState != CallSession::State::StreamsRunning)) q->cancelDtmfs();
 	CallSessionPrivate::setState(newState, message);
 	q->notifyCallSessionStateChangedForReporting();
-	std::shared_ptr<SalMediaDescription> rmd = nullptr;
+	std::shared_ptr<SalMediaDescription> rmd;
 	switch (newState) {
 		case CallSession::State::UpdatedByRemote:
 			// Handle specifically the case of an incoming ICE-concluded reINVITE
@@ -2302,7 +2302,7 @@ void MediaSessionPrivate::addConferenceParticipantStreams(std::shared_ptr<SalMed
 						const auto idx = std::distance(refMd->streams.cbegin(), sIt);
 						const std::string participantsAttrValue = s.getLabel();
 
-						std::shared_ptr<ParticipantDevice> dev = nullptr;
+						std::shared_ptr<ParticipantDevice> dev;
 						if (!participantsAttrValue.empty()) {
 							dev = conference->findParticipantDeviceByLabel(sal_stream_type_to_linphone(type),
 							                                               participantsAttrValue);
@@ -2517,7 +2517,7 @@ void MediaSessionPrivate::makeLocalMediaDescription(bool localIsOfferer,
 	bool isAudioConferenceEnabled = false;
 	ConferenceLayout confLayout = ConferenceLayout::ActiveSpeaker;
 	auto deviceState = ParticipantDevice::State::ScheduledForJoining;
-	std::shared_ptr<ParticipantDevice> participantDevice = nullptr;
+	std::shared_ptr<ParticipantDevice> participantDevice;
 	if (conference) {
 		const auto &currentConfParams = conference->getCurrentParams();
 		const auto &conferenceState = conference->getState();
@@ -3969,10 +3969,15 @@ void MediaSessionPrivate::updateCurrentParams() const {
 	getCurrentParams()->getPrivate()->setUpdateCallWhenIceCompleted(isUpdateSentWhenIceCompleted());
 	bool deviceIsScreenSharing = false;
 	if (conference) {
-		const auto meDevices = conference->getMe()->getDevices();
-		const auto &participantDevice = ((meDevices.size() == 0) || isInConference())
-		                                    ? conference->findParticipantDevice(q->getSharedFromThis())
-		                                    : meDevices.front();
+		std::shared_ptr<ParticipantDevice> participantDevice;
+		if (isInConference()) {
+			participantDevice = conference->findParticipantDevice(q->getSharedFromThis());
+		} else {
+			const auto meDevices = conference->getMe()->getDevices();
+			if (meDevices.size() > 0) {
+				participantDevice = meDevices.front();
+			}
+		}
 		if (participantDevice) {
 			deviceIsScreenSharing = participantDevice->screenSharingEnabled();
 		}
@@ -4261,7 +4266,7 @@ void MediaSessionPrivate::stunAuthRequestedCb(const char *realm,
                                               const char **ha1) {
 	L_Q();
 	/* Get the username from the nat policy or the proxy config */
-	std::shared_ptr<Account> stunAccount = nullptr;
+	std::shared_ptr<Account> stunAccount;
 	const auto &account = getDestAccount();
 	if (account) stunAccount = account;
 	else {
@@ -4792,10 +4797,8 @@ void MediaSession::sendVfuRequest() {
 // will succeed when a client creates a conference.
 const std::shared_ptr<Conference> MediaSession::getLocalConference() const {
 	L_D();
-
 	ConferenceId serverConferenceId;
-	shared_ptr<Conference> conference = nullptr;
-
+	shared_ptr<Conference> conference;
 	auto log = getLog();
 	const auto conferenceInfo = (log) ? log->getConferenceInfo() : nullptr;
 	auto conferenceIdParams = getCore()->createConferenceIdParams();
@@ -5586,8 +5589,8 @@ const MediaSessionParams *MediaSession::getRemoteParams() const {
 shared_ptr<CallStats> MediaSession::getStats(LinphoneStreamType type) const {
 	L_D();
 	if (type == LinphoneStreamTypeUnknown) return nullptr;
-	shared_ptr<CallStats> stats = nullptr;
-	shared_ptr<CallStats> statsCopy = nullptr;
+	shared_ptr<CallStats> stats;
+	shared_ptr<CallStats> statsCopy;
 	Stream *s = d->getStream(type);
 	if (s && (stats = s->getStats())) {
 		statsCopy = stats->clone()->toSharedPtr();
diff --git a/src/conference/sip-conference-scheduler.cpp b/src/conference/sip-conference-scheduler.cpp
index 354149ba83..6204f47ed6 100644
--- a/src/conference/sip-conference-scheduler.cpp
+++ b/src/conference/sip-conference-scheduler.cpp
@@ -36,8 +36,7 @@ SIPConferenceScheduler::SIPConferenceScheduler(const shared_ptr<Core> &core, con
     : ConferenceScheduler(core, account) {
 }
 
-void SIPConferenceScheduler::createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo,
-                                                      const std::shared_ptr<Address> &creator) {
+void SIPConferenceScheduler::createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo) {
 
 	shared_ptr<LinphonePrivate::ConferenceParams> conferenceParams = ConferenceParams::create(getCore());
 	conferenceParams->setAccount(getAccount());
@@ -70,7 +69,7 @@ void SIPConferenceScheduler::createOrUpdateConference(const std::shared_ptr<Conf
 
 	auto ref = getSharedFromThis();
 	const auto &conferenceAddress = conferenceInfo->getUri();
-	mSession = getCore()->createOrUpdateConferenceOnServer(conferenceParams, creator, invitees, conferenceAddress,
+	mSession = getCore()->createOrUpdateConferenceOnServer(conferenceParams, invitees, conferenceAddress,
 	                                                       dynamic_pointer_cast<SIPConferenceScheduler>(ref));
 	if (mSession == nullptr) {
 		lError() << "[Conference Scheduler] [" << this << "] createConferenceOnServer returned a null session!";
diff --git a/src/conference/sip-conference-scheduler.h b/src/conference/sip-conference-scheduler.h
index 03303ce1cc..49297c005d 100644
--- a/src/conference/sip-conference-scheduler.h
+++ b/src/conference/sip-conference-scheduler.h
@@ -38,8 +38,7 @@ public:
 	virtual void onCallSessionStateChanged(const std::shared_ptr<CallSession> &session,
 	                                       CallSession::State state,
 	                                       const std::string &message) override;
-	virtual void createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo,
-	                                      const std::shared_ptr<Address> &creator) override;
+	virtual void createOrUpdateConference(const std::shared_ptr<ConferenceInfo> &conferenceInfo) override;
 	virtual void processResponse(const LinphoneErrorInfo *errorInfo,
 	                             const std::shared_ptr<Address> conferenceAddress) override;
 	inline std::shared_ptr<CallSession> getSession() {
diff --git a/src/core/core-chat-room.cpp b/src/core/core-chat-room.cpp
index 769eed7b5d..f81cbf1108 100644
--- a/src/core/core-chat-room.cpp
+++ b/src/core/core-chat-room.cpp
@@ -113,7 +113,7 @@ CorePrivate::getIdentityAddressWithGruu(const std::shared_ptr<const Address> &id
 #endif // _MSC_VER
 // Base server group chat room creator
 shared_ptr<AbstractChatRoom>
-CorePrivate::createServerChatRoom(const std::shared_ptr<const Address> &conferenceFactoryUri,
+CorePrivate::createServerChatRoom(BCTBX_UNUSED(const std::shared_ptr<const Address> &conferenceFactoryUri),
                                   SalCallOp *op,
                                   const std::shared_ptr<ConferenceParams> &params) {
 #ifdef HAVE_ADVANCED_IM
@@ -135,8 +135,7 @@ CorePrivate::createServerChatRoom(const std::shared_ptr<const Address> &conferen
 	}
 
 	auto conference = dynamic_pointer_cast<ServerConference>(
-	    (new ServerConference(q->getSharedFromThis(), conferenceFactoryUri, nullptr, newConferenceParameters))
-	        ->toSharedPtr());
+	    (new ServerConference(q->getSharedFromThis(), nullptr, newConferenceParameters))->toSharedPtr());
 	conference->init(op, conference.get());
 	return conference->getChatRoom();
 #else
@@ -179,8 +178,7 @@ CorePrivate::createClientChatRoom(const std::shared_ptr<const Address> &conferen
 	}
 
 	auto conference = dynamic_pointer_cast<ClientConference>(
-	    (new ClientConference(q->getSharedFromThis(), conferenceId.getLocalAddress(), nullptr, newConferenceParameters))
-	        ->toSharedPtr());
+	    (new ClientConference(q->getSharedFromThis(), nullptr, newConferenceParameters))->toSharedPtr());
 	conference->initWithFocus(conferenceFactoryUri, nullptr, op, conference.get());
 	if (conferenceId.isValid()) {
 		conference->setConferenceId(conferenceId);
@@ -302,7 +300,6 @@ std::shared_ptr<AbstractChatRoom> CorePrivate::searchChatRoom(const std::string
 }
 
 shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> &params,
-                                                         const std::shared_ptr<const Address> &localAddr,
                                                          const std::list<std::shared_ptr<Address>> &participants) {
 	L_Q();
 	if (!params) {
@@ -322,13 +319,20 @@ shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<Confer
 		lWarning() << "Tying to create chat room with unavailable backend";
 		return nullptr;
 	}
-	shared_ptr<AbstractChatRoom> chatRoom;
 
+	auto account = params->getAccount();
+	if (!account) {
+		account = q->getDefaultAccount();
+	}
+	const std::shared_ptr<const Address> localAddr =
+	    account ? account->getAccountParams()->getIdentityAddress() : getDefaultLocalAddress(nullptr, false);
+
+	shared_ptr<AbstractChatRoom> chatRoom;
 	if (params->getChatParams()->getBackend() == ChatParams::Backend::FlexisipChat) {
 #ifdef HAVE_ADVANCED_IM
-		const auto &conferenceFactoryUri = Core::getConferenceFactoryAddress(q->getSharedFromThis(), localAddr);
+		const auto &conferenceFactoryUri = account->getAccountParams()->getConferenceFactoryAddress();
 		if (!conferenceFactoryUri || !conferenceFactoryUri->isValid()) {
-			lWarning() << "Not creating group chat room: no conference factory uri for local address [" << localAddr
+			lWarning() << "Not creating group chat room: no conference factory uri for local address [" << *localAddr
 			           << "]";
 			return nullptr;
 		}
@@ -342,9 +346,8 @@ shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<Confer
 			}
 		}
 
-		ConferenceId conferenceId = ConferenceId(nullptr, localAddr, q->createConferenceIdParams());
+		ConferenceId conferenceId(nullptr, localAddr, q->createConferenceIdParams());
 		chatRoom = createClientChatRoom(conferenceFactoryUri, conferenceId, nullptr, params);
-
 		if (!chatRoom) {
 			lWarning() << "Cannot create createClientChatRoom with subject [" << params->getSubject() << "]";
 			return nullptr;
@@ -372,23 +375,16 @@ shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<Confer
 			insertChatRoom(chatRoom);
 			insertChatRoomWithDb(chatRoom);
 		} else {
-			lInfo() << "Found an existing BasicChatRoom with this participant, using it instead of creating a new one";
+			lInfo() << "Found an existing BasicChatRoom with " << *remoteAddr
+			        << ", using it instead of creating a new one";
 		}
 	}
 	return chatRoom;
 }
 
-shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> &params,
-                                                         const std::list<std::shared_ptr<Address>> &participants) {
-	auto defaultLocalAddress =
-	    getDefaultLocalAddress(nullptr, params->getChatParams()->getBackend() == ChatParams::Backend::FlexisipChat);
-	return createChatRoom(params, defaultLocalAddress, participants);
-}
-
 shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const std::string &subject,
                                                          const std::list<std::shared_ptr<Address>> &participants) {
 	L_Q();
-
 	shared_ptr<ConferenceParams> params = ConferenceParams::create(q->getSharedFromThis());
 	params->setChatDefaults();
 	if (participants.size() > 1) {
@@ -397,17 +393,15 @@ shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const std::string &subj
 	} else {
 		params->getChatParams()->setBackend(ChatParams::Backend::Basic);
 	}
-	auto defaultLocalAddress =
-	    getDefaultLocalAddress(nullptr, params->getChatParams()->getBackend() == ChatParams::Backend::FlexisipChat);
+	params->setAccount(q->getDefaultAccount());
 	params->setUtf8Subject(subject);
-	return createChatRoom(params, defaultLocalAddress, participants);
+	return createChatRoom(params, participants);
 }
 
 shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> &params,
-                                                         const std::shared_ptr<Address> &localAddr,
                                                          const std::shared_ptr<Address> &participant) {
-	const std::list<std::shared_ptr<Address>> &participants{participant};
-	return createChatRoom(params, localAddr, participants);
+	const std::list<std::shared_ptr<Address>> participants{participant};
+	return createChatRoom(params, participants);
 }
 
 // Assume basic chat room creation
diff --git a/src/core/core-p.h b/src/core/core-p.h
index 85f474e50f..05264da6cd 100644
--- a/src/core/core-p.h
+++ b/src/core/core-p.h
@@ -131,15 +131,11 @@ public:
 	                                                       long ephemeralLifeTime);
 	std::shared_ptr<AbstractChatRoom> createClientChatRoom(const std::string &subject, bool fallback, bool encrypted);
 
-	std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<ConferenceParams> &params,
-	                                                 const std::shared_ptr<const Address> &localAddr,
-	                                                 const std::list<std::shared_ptr<Address>> &participants);
 	std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<ConferenceParams> &params,
 	                                                 const std::list<std::shared_ptr<Address>> &participants);
 	std::shared_ptr<AbstractChatRoom> createChatRoom(const std::string &subject,
 	                                                 const std::list<std::shared_ptr<Address>> &participants);
 	std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<ConferenceParams> &params,
-	                                                 const std::shared_ptr<Address> &localAddr,
 	                                                 const std::shared_ptr<Address> &participant);
 	std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<Address> &participant);
 
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 57b3bd0ac1..242f4df012 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -1891,7 +1891,8 @@ std::shared_ptr<Conference> Core::findConference(const std::shared_ptr<const Cal
 
 	L_D();
 	for (const auto &[id, conference] : d->mConferenceById) {
-		if (session == conference->getMainSession()) {
+		const auto &conferenceSession = conference->getMainSession();
+		if (conferenceSession && (session == conferenceSession)) {
 			return conference;
 		}
 	}
@@ -2050,7 +2051,6 @@ void Core::addConferenceScheduler(const std::shared_ptr<ConferenceScheduler> &sc
 }
 
 shared_ptr<CallSession> Core::createOrUpdateConferenceOnServer(const std::shared_ptr<ConferenceParams> &confParams,
-                                                               const std::shared_ptr<const Address> &localAddr,
                                                                const std::list<Address> &participants,
                                                                const std::shared_ptr<Address> &confAddr,
                                                                std::shared_ptr<CallSessionListener> listener) {
@@ -2062,7 +2062,10 @@ shared_ptr<CallSession> Core::createOrUpdateConferenceOnServer(const std::shared
 	MediaSessionParams params;
 	params.initDefault(getSharedFromThis(), LinphoneCallOutgoing);
 
-	const auto &account = confParams->getAccount();
+	auto account = confParams->getAccount();
+	if (!account) {
+		account = getDefaultAccount();
+	}
 	params.setAccount(account);
 
 	std::shared_ptr<Address> conferenceFactoryUri;
@@ -2072,12 +2075,13 @@ shared_ptr<CallSession> Core::createOrUpdateConferenceOnServer(const std::shared
 	} else {
 		std::shared_ptr<const Address> conferenceFactoryUriRef;
 		if (mediaEnabled) {
-			conferenceFactoryUriRef = Core::getAudioVideoConferenceFactoryAddress(getSharedFromThis(), localAddr);
+			conferenceFactoryUriRef = Core::getAudioVideoConferenceFactoryAddress(getSharedFromThis(), account);
 		} else {
-			conferenceFactoryUriRef = Core::getConferenceFactoryAddress(getSharedFromThis(), localAddr);
+			conferenceFactoryUriRef = account->getAccountParams()->getConferenceFactoryAddress();
 		}
 		if (!conferenceFactoryUriRef || !conferenceFactoryUriRef->isValid()) {
-			lWarning() << "Not creating conference: no conference factory uri for local address [" << *localAddr << "]";
+			lWarning() << "Not creating conference: no conference factory uri for local address ["
+			           << *account->getAccountParams()->getIdentityAddress() << "]";
 			return nullptr;
 		}
 		conferenceFactoryUri = conferenceFactoryUriRef->clone()->toSharedPtr();
@@ -2122,6 +2126,7 @@ shared_ptr<CallSession> Core::createOrUpdateConferenceOnServer(const std::shared
 	params.getPrivate()->disableRinging(true);
 	params.getPrivate()->enableToneIndications(false);
 
+	const auto &localAddr = account->getAccountParams()->getIdentityAddress();
 	auto participant = Participant::create(nullptr, localAddr);
 	auto session = participant->createSession(getSharedFromThis(), &params, true);
 	session->addListener(listener);
diff --git a/src/core/core.h b/src/core/core.h
index 1063ad5feb..4792c87440 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -365,7 +365,6 @@ public:
 	const std::list<LinphoneMediaEncryption> getSupportedMediaEncryptions() const;
 
 	std::shared_ptr<CallSession> createOrUpdateConferenceOnServer(const std::shared_ptr<ConferenceParams> &confParams,
-	                                                              const std::shared_ptr<const Address> &localAddr,
 	                                                              const std::list<Address> &participants,
 	                                                              const std::shared_ptr<Address> &confAddr,
 	                                                              std::shared_ptr<CallSessionListener> listener);
diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp
index 447931206c..b83614ad2f 100644
--- a/src/db/main-db.cpp
+++ b/src/db/main-db.cpp
@@ -6310,7 +6310,7 @@ list<shared_ptr<AbstractChatRoom>> MainDb::getChatRooms() {
 				std::shared_ptr<Conference> conference = nullptr;
 				if (serverMode) {
 					params->enableLocalParticipant(false);
-					conference = (new ServerConference(core, localAddress, nullptr, params))->toSharedPtr();
+					conference = (new ServerConference(core, nullptr, params))->toSharedPtr();
 					conference->initFromDb(me, conferenceId, lastNotifyId, false);
 					chatRoom = conference->getChatRoom();
 					conference->setState(ConferenceInterface::State::Created);
@@ -6320,7 +6320,7 @@ list<shared_ptr<AbstractChatRoom>> MainDb::getChatRooms() {
 						continue;
 					}
 					bool hasBeenLeft = !!row.get<int>(8, 0);
-					conference = (new ClientConference(core, me->getAddress(), nullptr, params))->toSharedPtr();
+					conference = (new ClientConference(core, nullptr, params))->toSharedPtr();
 					conference->initFromDb(me, conferenceId, lastNotifyId, hasBeenLeft);
 					chatRoom = conference->getChatRoom();
 					updateFlags = confInfo && !hasBeenLeft;
diff --git a/tester/conference-event-tester.cpp b/tester/conference-event-tester.cpp
index 1d3651217e..4c1e44f864 100644
--- a/tester/conference-event-tester.cpp
+++ b/tester/conference-event-tester.cpp
@@ -747,7 +747,7 @@ L_ENABLE_ATTR_ACCESS(ServerConference, shared_ptr<ServerConferenceEventHandler>,
 
 class ConferenceEventTester : public ClientConference {
 public:
-	ConferenceEventTester(const shared_ptr<Core> &core, const std::shared_ptr<Address> &confAddr);
+	ConferenceEventTester(const shared_ptr<Core> &core);
 	virtual ~ConferenceEventTester();
 
 private:
@@ -779,8 +779,9 @@ public:
 	virtual void init(SalCallOp *op = nullptr, ConferenceListener *confListener = nullptr) override;
 };
 
-ConferenceEventTester::ConferenceEventTester(const shared_ptr<Core> &core, const std::shared_ptr<Address> &confAddr)
-    : ClientConference(core, confAddr, nullptr, ConferenceParams::create(core)) {
+ConferenceEventTester::ConferenceEventTester(const shared_ptr<Core> &core)
+    : ClientConference(core, nullptr, ConferenceParams::create(core)) {
+	getCurrentParams()->setAccount(core->getDefaultAccount());
 	getCurrentParams()->enableAudio(true);
 }
 
@@ -865,10 +866,9 @@ void ConferenceEventTester::onParticipantDeviceRemoved(const shared_ptr<Conferen
 
 class ServerConferenceTester : public ServerConference {
 public:
-	ServerConferenceTester(const std::shared_ptr<Core> &core,
-	                       const std::shared_ptr<Address> &myAddress,
-	                       std::shared_ptr<CallSessionListener> listener)
-	    : ServerConference(core, myAddress, listener, ConferenceParams::create(core)) {
+	ServerConferenceTester(const std::shared_ptr<Core> &core, std::shared_ptr<CallSessionListener> listener)
+	    : ServerConference(core, listener, ConferenceParams::create(core)) {
+		getCurrentParams()->setAccount(core->getDefaultAccount());
 		getCurrentParams()->enableLocalParticipant(false);
 		getCurrentParams()->enableAudio(true);
 		getCurrentParams()->enableChat(false);
@@ -992,16 +992,15 @@ static void setParticipantAsAdmin(shared_ptr<Conference> localConf, std::shared_
 void first_notify_parsing() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneAddress *confAddress = linphone_core_interpret_url(marie->lc, confUri);
-	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
-	linphone_address_unref(confAddress);
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	LinphoneAddress *bobAddr = linphone_core_interpret_url(marie->lc, bobUri);
 	LinphoneAddress *aliceAddr = linphone_core_interpret_url(marie->lc, aliceUri);
 	size_t size = strlen(first_notify) + strlen(confUri);
 	char *notify = new char[size];
 
+	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
 	tester->setConferenceAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId()).setPeerAddress(addr);
 
@@ -1031,6 +1030,7 @@ void first_notify_parsing() {
 	bctbx_free(bobAddrStr);
 	bctbx_free(aliceAddrStr);
 
+	linphone_address_unref(confAddress);
 	linphone_address_unref(bobAddr);
 	linphone_address_unref(aliceAddr);
 	linphone_core_manager_destroy(marie);
@@ -1039,16 +1039,15 @@ void first_notify_parsing() {
 void first_notify_with_extensions_parsing() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneAddress *confAddress = linphone_core_interpret_url(marie->lc, confUri);
-	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
-	linphone_address_unref(confAddress);
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	LinphoneAddress *bobAddr = linphone_core_interpret_url(marie->lc, bobUri);
 	LinphoneAddress *aliceAddr = linphone_core_interpret_url(marie->lc, aliceUri);
 	size_t size = strlen(first_notify) + strlen(confUri);
 	char *notify = new char[size];
 
+	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
 	tester->setConferenceAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId()).setPeerAddress(addr);
 
@@ -1078,6 +1077,7 @@ void first_notify_with_extensions_parsing() {
 	bctbx_free(bobAddrStr);
 	bctbx_free(aliceAddrStr);
 
+	linphone_address_unref(confAddress);
 	linphone_address_unref(bobAddr);
 	linphone_address_unref(aliceAddr);
 	linphone_core_manager_destroy(marie);
@@ -1086,16 +1086,15 @@ void first_notify_with_extensions_parsing() {
 void first_notify_parsing_wrong_conf() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneAddress *confAddress = linphone_core_interpret_url(marie->lc, "sips:conf322@example.com");
-	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
-	linphone_address_unref(confAddress);
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	LinphoneAddress *bobAddr = linphone_core_interpret_url(marie->lc, bobUri);
 	LinphoneAddress *aliceAddr = linphone_core_interpret_url(marie->lc, aliceUri);
 	size_t size = strlen(first_notify) + strlen(confUri);
 	char *notify = new char[size];
 
+	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
 	tester->setConferenceAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId()).setPeerAddress(addr);
 	snprintf(notify, size, first_notify, confUri);
@@ -1118,6 +1117,7 @@ void first_notify_parsing_wrong_conf() {
 	bctbx_free(bobAddrStr);
 	bctbx_free(aliceAddrStr);
 
+	linphone_address_unref(confAddress);
 	linphone_address_unref(bobAddr);
 	linphone_address_unref(aliceAddr);
 	linphone_core_manager_destroy(marie);
@@ -1126,10 +1126,8 @@ void first_notify_parsing_wrong_conf() {
 void participant_added_parsing() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneAddress *confAddress = linphone_core_interpret_url(marie->lc, confUri);
-	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
-	linphone_address_unref(confAddress);
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	LinphoneAddress *bobAddr = linphone_core_interpret_url(marie->lc, bobUri);
 	LinphoneAddress *aliceAddr = linphone_core_interpret_url(marie->lc, aliceUri);
@@ -1139,6 +1137,7 @@ void participant_added_parsing() {
 	size_t size2 = strlen(participant_added_notify) + strlen(confUri);
 	char *notify_added = new char[size2];
 
+	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
 	tester->setConferenceAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId()).setPeerAddress(addr);
 	snprintf(notify, size, first_notify, confUri);
@@ -1179,6 +1178,7 @@ void participant_added_parsing() {
 	BC_ASSERT_TRUE(!tester->participants.find(frankAddrStr)->second);
 	bctbx_free(frankAddrStr);
 
+	linphone_address_unref(confAddress);
 	linphone_address_unref(bobAddr);
 	linphone_address_unref(aliceAddr);
 	linphone_address_unref(frankAddr);
@@ -1189,10 +1189,8 @@ void participant_not_added_parsing() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	setup_mgr_for_conference(marie, NULL);
 	LinphoneAddress *confAddress = linphone_core_interpret_url(marie->lc, confUri);
-	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
-	linphone_address_unref(confAddress);
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	LinphoneAddress *bobAddr = linphone_core_interpret_url(marie->lc, bobUri);
 	LinphoneAddress *aliceAddr = linphone_core_interpret_url(marie->lc, aliceUri);
@@ -1206,6 +1204,7 @@ void participant_not_added_parsing() {
 	size_t size4 = strlen(participant_device_not_added_notify) + strlen(confUri) + sizeof(int);
 	char *notify_device_not_added = new char[size4];
 
+	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
 	tester->setConferenceAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId()).setPeerAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId())
@@ -1286,6 +1285,7 @@ void participant_not_added_parsing() {
 
 	tester->handler->unsubscribe();
 
+	linphone_address_unref(confAddress);
 	linphone_address_unref(bobAddr);
 	linphone_address_unref(aliceAddr);
 	linphone_address_unref(frankAddr);
@@ -1295,10 +1295,8 @@ void participant_not_added_parsing() {
 void participant_deleted_parsing() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneAddress *confAddress = linphone_core_interpret_url(marie->lc, confUri);
-	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
-	linphone_address_unref(confAddress);
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	LinphoneAddress *bobAddr = linphone_core_interpret_url(marie->lc, bobUri);
 	LinphoneAddress *aliceAddr = linphone_core_interpret_url(marie->lc, aliceUri);
@@ -1307,6 +1305,7 @@ void participant_deleted_parsing() {
 	size_t size2 = strlen(participant_deleted_notify) + strlen(confUri);
 	char *notify_deleted = new char[size2];
 
+	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
 	tester->setConferenceAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId()).setPeerAddress(addr);
 	snprintf(notify, size, first_notify, confUri);
@@ -1344,6 +1343,7 @@ void participant_deleted_parsing() {
 	bctbx_free(bobAddrStr);
 	bctbx_free(aliceAddrStr);
 
+	linphone_address_unref(confAddress);
 	linphone_address_unref(bobAddr);
 	linphone_address_unref(aliceAddr);
 	linphone_core_manager_destroy(marie);
@@ -1352,10 +1352,8 @@ void participant_deleted_parsing() {
 void participant_admined_parsing() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneAddress *confAddress = linphone_core_interpret_url(marie->lc, confUri);
-	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
-	linphone_address_unref(confAddress);
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	LinphoneAddress *bobAddr = linphone_core_interpret_url(marie->lc, bobUri);
 	LinphoneAddress *aliceAddr = linphone_core_interpret_url(marie->lc, aliceUri);
@@ -1364,6 +1362,7 @@ void participant_admined_parsing() {
 	size_t size2 = strlen(participant_admined_notify) + strlen(confUri);
 	char *notify_admined = new char[size2];
 
+	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
 	tester->setConferenceAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId()).setPeerAddress(addr);
 	snprintf(notify, size, first_notify, confUri);
@@ -1400,6 +1399,7 @@ void participant_admined_parsing() {
 	bctbx_free(bobAddrStr);
 	bctbx_free(aliceAddrStr);
 
+	linphone_address_unref(confAddress);
 	linphone_address_unref(bobAddr);
 	linphone_address_unref(aliceAddr);
 	linphone_core_manager_destroy(marie);
@@ -1408,10 +1408,8 @@ void participant_admined_parsing() {
 void participant_unadmined_parsing() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneAddress *confAddress = linphone_core_interpret_url(marie->lc, confUri);
-	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
-	linphone_address_unref(confAddress);
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	LinphoneAddress *bobAddr = linphone_core_interpret_url(marie->lc, bobUri);
 	LinphoneAddress *aliceAddr = linphone_core_interpret_url(marie->lc, aliceUri);
@@ -1420,6 +1418,7 @@ void participant_unadmined_parsing() {
 	size_t size2 = strlen(participant_unadmined_notify) + strlen(confUri);
 	char *notify_unadmined = new char[size2];
 
+	std::shared_ptr<Address> addr = Address::toCpp(confAddress)->getSharedFromThis();
 	tester->setConferenceAddress(addr);
 	const_cast<ConferenceId &>(tester->handler->getConferenceId()).setPeerAddress(addr);
 	snprintf(notify, size, first_notify, confUri);
@@ -1456,6 +1455,7 @@ void participant_unadmined_parsing() {
 	bctbx_free(bobAddrStr);
 	bctbx_free(aliceAddrStr);
 
+	linphone_address_unref(confAddress);
 	linphone_address_unref(bobAddr);
 	linphone_address_unref(aliceAddr);
 	linphone_core_manager_destroy(marie);
@@ -1465,14 +1465,13 @@ void send_first_notify() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneCoreManager *pauline =
 	    linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	auto params = ConferenceParams::create(pauline->lc->cppPtr);
 	params->enableAudio(true);
-	shared_ptr<Conference> localConf =
-	    (new ServerConference(pauline->lc->cppPtr, addr, nullptr, params))->toSharedPtr();
+	params->enableLocalParticipant(false);
+	shared_ptr<Conference> localConf = (new ServerConference(pauline->lc->cppPtr, nullptr, params))->toSharedPtr();
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
 	    std::make_shared<ConferenceListenerInterfaceTester>();
@@ -1493,6 +1492,7 @@ void send_first_notify() {
 	ServerConferenceEventHandler *localHandler =
 	    (L_ATTR_GET(dynamic_pointer_cast<ServerConference>(localConf).get(), mEventHandler)).get();
 	localConf->setState(ConferenceInterface::State::Instantiated);
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	localConf->setConferenceAddress(addr);
 	auto content = localHandler->createNotifyFullState(NULL);
 
@@ -1516,9 +1516,7 @@ void send_added_notify_through_address() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneCoreManager *pauline =
 	    linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
-	shared_ptr<ServerConferenceTester> localConf =
-	    make_shared<ServerConferenceTester>(pauline->lc->cppPtr, addr, nullptr);
+	shared_ptr<ServerConferenceTester> localConf = make_shared<ServerConferenceTester>(pauline->lc->cppPtr, nullptr);
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
 	    std::make_shared<ConferenceListenerInterfaceTester>();
@@ -1537,6 +1535,7 @@ void send_added_notify_through_address() {
 	localConf->addParticipant(aliceAddr);
 	setParticipantAsAdmin(localConf, aliceAddr, true);
 	localConf->setState(ConferenceInterface::State::Instantiated);
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	localConf->setConferenceAddress(addr);
 	BC_ASSERT_EQUAL(confListener->participants.size(), 2, size_t, "%zu");
 	BC_ASSERT_EQUAL(confListener->participantDevices.size(), 2, size_t, "%zu");
@@ -1866,7 +1865,7 @@ add_participant_to_conference_through_call(bctbx_list_t **mgrs,
 	size_t increment = 0;
 	if (participantSize == 0) {
 		// Also me is added as participant
-		increment = 2;
+		increment = 1 + ((conf->getCurrentParams()->localParticipantEnabled()) ? 1 : 0);
 	} else {
 		increment = 1;
 	}
@@ -1874,11 +1873,12 @@ add_participant_to_conference_through_call(bctbx_list_t **mgrs,
 	BC_ASSERT_EQUAL(confListener->participantDevices.size(), (participantDeviceSize + increment), size_t, "%zu");
 
 	if (participantCall) {
-		auto cppAddress = Call::toCpp(participantCall)->getToAddress()->clone()->toSharedPtr();
+		auto cppAddress = Call::toCpp(participantCall)->getLog()->getToAddress()->clone()->toSharedPtr();
 		auto addressParams = cppAddress->getUriParams();
 		for (const auto &[name, value] : addressParams) {
 			cppAddress->removeUriParam(name);
 		}
+		BC_ASSERT_TRUE(linphone_address_weak_equal(cppAddress->toC(), participant_mgr->identity));
 		const auto participant = confListener->participants.find(cppAddress->asStringUriOnly());
 		BC_ASSERT_TRUE(participant != confListener->participants.end());
 
@@ -1925,13 +1925,11 @@ void send_added_notify_through_call() {
 	bctbx_list_t *mgrs = NULL;
 	mgrs = bctbx_list_append(mgrs, pauline);
 
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	stats initialPaulineStats = pauline->stat;
 	{
 		auto params = ConferenceParams::create(pauline->lc->cppPtr);
 		params->enableAudio(true);
-		shared_ptr<Conference> localConf =
-		    (new ServerConference(pauline->lc->cppPtr, addr, nullptr, params))->toSharedPtr();
+		shared_ptr<Conference> localConf = (new ServerConference(pauline->lc->cppPtr, nullptr, params))->toSharedPtr();
 		localConf->init();
 
 		BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneConferenceStateCreationPending,
@@ -2006,14 +2004,12 @@ void send_removed_notify_through_call() {
 
 	bctbx_list_t *removed_mgrs = NULL;
 
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	stats initialPaulineStats = pauline->stat;
-
 	{
 		auto params = ConferenceParams::create(pauline->lc->cppPtr);
 		params->enableAudio(true);
-		shared_ptr<Conference> localConf =
-		    (new ServerConference(pauline->lc->cppPtr, addr, nullptr, params))->toSharedPtr();
+		params->enableLocalParticipant(false);
+		shared_ptr<Conference> localConf = (new ServerConference(pauline->lc->cppPtr, nullptr, params))->toSharedPtr();
 		localConf->init();
 
 		BC_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneConferenceStateCreationPending,
@@ -2105,9 +2101,7 @@ void send_removed_notify() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneCoreManager *pauline =
 	    linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
-	shared_ptr<ServerConferenceTester> localConf =
-	    make_shared<ServerConferenceTester>(pauline->lc->cppPtr, addr, nullptr);
+	shared_ptr<ServerConferenceTester> localConf = make_shared<ServerConferenceTester>(pauline->lc->cppPtr, nullptr);
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
 	    std::make_shared<ConferenceListenerInterfaceTester>();
@@ -2123,6 +2117,7 @@ void send_removed_notify() {
 	localConf->addParticipant(aliceAddr);
 	setParticipantAsAdmin(localConf, aliceAddr, true);
 	localConf->setState(ConferenceInterface::State::Instantiated);
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	localConf->setConferenceAddress(addr);
 
 	BC_ASSERT_EQUAL(confListener->participants.size(), 2, size_t, "%zu");
@@ -2153,9 +2148,7 @@ void send_admined_notify() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneCoreManager *pauline =
 	    linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
-	shared_ptr<ServerConferenceTester> localConf =
-	    make_shared<ServerConferenceTester>(pauline->lc->cppPtr, addr, nullptr);
+	shared_ptr<ServerConferenceTester> localConf = make_shared<ServerConferenceTester>(pauline->lc->cppPtr, nullptr);
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
 	    std::make_shared<ConferenceListenerInterfaceTester>();
@@ -2171,6 +2164,7 @@ void send_admined_notify() {
 	localConf->addParticipant(aliceAddr);
 	setParticipantAsAdmin(localConf, aliceAddr, true);
 	localConf->setState(ConferenceInterface::State::Instantiated);
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	localConf->setConferenceAddress(addr);
 
 	BC_ASSERT_EQUAL(confListener->participants.size(), 2, size_t, "%zu");
@@ -2201,9 +2195,7 @@ void send_unadmined_notify() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneCoreManager *pauline =
 	    linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
-	shared_ptr<ServerConferenceTester> localConf =
-	    make_shared<ServerConferenceTester>(pauline->lc->cppPtr, addr, nullptr);
+	shared_ptr<ServerConferenceTester> localConf = make_shared<ServerConferenceTester>(pauline->lc->cppPtr, nullptr);
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
 	    std::make_shared<ConferenceListenerInterfaceTester>();
@@ -2219,6 +2211,7 @@ void send_unadmined_notify() {
 	localConf->addParticipant(aliceAddr);
 	setParticipantAsAdmin(localConf, aliceAddr, true);
 	localConf->setState(ConferenceInterface::State::Instantiated);
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	localConf->setConferenceAddress(addr);
 
 	BC_ASSERT_EQUAL(confListener->participants.size(), 2, size_t, "%zu");
@@ -2247,9 +2240,8 @@ void send_subject_changed_notify() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneCoreManager *pauline =
 	    linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	shared_ptr<ServerConferenceTester> localConf = dynamic_pointer_cast<ServerConferenceTester>(
-	    (new ServerConferenceTester(pauline->lc->cppPtr, addr, nullptr))->toSharedPtr());
+	    (new ServerConferenceTester(pauline->lc->cppPtr, nullptr))->toSharedPtr());
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
 	    std::make_shared<ConferenceListenerInterfaceTester>();
@@ -2266,6 +2258,7 @@ void send_subject_changed_notify() {
 	localConf->setSubject("A random test subject");
 	setParticipantAsAdmin(localConf, aliceAddr, true);
 	localConf->setState(ConferenceInterface::State::Instantiated);
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	localConf->setConferenceAddress(addr);
 
 	BC_ASSERT_STRING_EQUAL(confListener->confSubject.c_str(), "A random test subject");
@@ -2301,8 +2294,7 @@ void send_device_added_notify() {
 	_linphone_core_add_callbacks(pauline->lc, cbs, TRUE);
 	linphone_core_cbs_unref(cbs);
 
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
-	shared_ptr<Conference> localConf = (new ServerConferenceTester(pauline->lc->cppPtr, addr, nullptr))->toSharedPtr();
+	shared_ptr<Conference> localConf = (new ServerConferenceTester(pauline->lc->cppPtr, nullptr))->toSharedPtr();
 	;
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
@@ -2320,6 +2312,7 @@ void send_device_added_notify() {
 	shared_ptr<Participant> alice = localConf->findParticipant(aliceAddr);
 	setParticipantAsAdmin(localConf, aliceAddr, true);
 	localConf->setState(ConferenceInterface::State::Instantiated);
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	localConf->setConferenceAddress(addr);
 	BC_ASSERT_EQUAL(confListener->participantDevices.size(), 2, size_t, "%zu");
 	BC_ASSERT_TRUE(confListener->participantDevices.find(bobAddr->toString()) !=
@@ -2398,8 +2391,7 @@ void send_device_added_notify() {
 void send_device_removed_notify() {
 	LinphoneCoreManager *pauline =
 	    linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
-	shared_ptr<Conference> localConf = (new ServerConferenceTester(pauline->lc->cppPtr, addr, nullptr))->toSharedPtr();
+	shared_ptr<Conference> localConf = (new ServerConferenceTester(pauline->lc->cppPtr, nullptr))->toSharedPtr();
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
 	    std::make_shared<ConferenceListenerInterfaceTester>();
@@ -2417,6 +2409,7 @@ void send_device_removed_notify() {
 	shared_ptr<Participant> alice = localConf->findParticipant(aliceAddr);
 	setParticipantAsAdmin(localConf, aliceAddr, true);
 	localConf->setState(ConferenceInterface::State::Instantiated);
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
 	localConf->setConferenceAddress(addr);
 
 	BC_ASSERT_EQUAL(confListener->participantDevices.size(), 2, size_t, "%zu");
@@ -2454,16 +2447,14 @@ void one_to_one_keyword() {
 	LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
 	LinphoneCoreManager *pauline =
 	    linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
-	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
-	shared_ptr<ConferenceEventTester> tester = dynamic_pointer_cast<ConferenceEventTester>(
-	    (new ConferenceEventTester(marie->lc->cppPtr, addr))->toSharedPtr());
+	shared_ptr<ConferenceEventTester> tester =
+	    dynamic_pointer_cast<ConferenceEventTester>((new ConferenceEventTester(marie->lc->cppPtr))->toSharedPtr());
 	tester->init();
 	auto params = ConferenceParams::create(pauline->lc->cppPtr);
 	params->enableAudio(false);
 	params->enableChat(true);
 	params->setGroup(false);
-	shared_ptr<Conference> localConf =
-	    (new ServerConference(pauline->lc->cppPtr, addr, nullptr, params))->toSharedPtr();
+	shared_ptr<Conference> localConf = (new ServerConference(pauline->lc->cppPtr, nullptr, params))->toSharedPtr();
 	localConf->init();
 	std::shared_ptr<ConferenceListenerInterfaceTester> confListener =
 	    std::make_shared<ConferenceListenerInterfaceTester>();
@@ -2472,6 +2463,8 @@ void one_to_one_keyword() {
 	std::shared_ptr<Address> bobAddr = Address::toCpp(cBobAddr)->getSharedFromThis();
 	linphone_address_unref(cBobAddr);
 
+	std::shared_ptr<Address> addr = Address::toCpp(pauline->identity)->getSharedFromThis();
+
 	// Create basic chat room with OneToOne capability to ensure that one to one is added to notify
 	pauline->lc->cppPtr->getOrCreateBasicChatRoom(addr, addr);
 
diff --git a/tester/group_chat_tester.c b/tester/group_chat_tester.c
index 74bb37d691..96818e65b8 100644
--- a/tester/group_chat_tester.c
+++ b/tester/group_chat_tester.c
@@ -6223,8 +6223,7 @@ static void basic_chat_room_with_cpim_base(bool_t use_gruu) {
 	linphone_conference_params_enable_group(marie_params, FALSE);
 	LinphoneChatParams *marie_chat_params = linphone_conference_params_get_chat_params(marie_params);
 	linphone_chat_params_set_backend(marie_chat_params, LinphoneChatRoomBackendBasic);
-	LinphoneChatRoom *marieCr =
-	    linphone_core_create_chat_room_7(marie->lc, marie_params, marie->identity, participantsAddresses);
+	LinphoneChatRoom *marieCr = linphone_core_create_chat_room_7(marie->lc, marie_params, participantsAddresses);
 	bctbx_list_free(participantsAddresses);
 	participantsAddresses = NULL;
 	linphone_chat_room_params_unref(marie_params);
diff --git a/tester/local-conference-tester-functions.cpp b/tester/local-conference-tester-functions.cpp
index e5c81fd972..8f7e62c1c9 100644
--- a/tester/local-conference-tester-functions.cpp
+++ b/tester/local-conference-tester-functions.cpp
@@ -7299,12 +7299,21 @@ void create_conference_with_chat_base(LinphoneConferenceSecurityLevel security_l
 				                             liblinphone_tester_sip_timeout));
 			}
 
+			const LinphoneAddress *from = ((mgr == marie.getCMgr()) || (start_time > 0)) ? mgr->identity : confAddr;
+			const LinphoneAddress *to = ((mgr == marie.getCMgr()) || (start_time > 0)) ? confAddr : mgr->identity;
+
 			LinphoneCall *pcall = linphone_core_get_call_by_remote_address2(mgr->lc, confAddr);
 			BC_ASSERT_PTR_NOT_NULL(pcall);
 			if (pcall) {
 				const LinphoneCallParams *call_cparams = linphone_call_get_current_params(pcall);
 				const LinphoneMediaEncryption pcall_enc = linphone_call_params_get_media_encryption(call_cparams);
 				BC_ASSERT_EQUAL(pcall_enc, encryption, int, "%d");
+				LinphoneCallLog *call_log = linphone_call_get_call_log(pcall);
+				BC_ASSERT_PTR_NOT_NULL(call_log);
+				if (call_log) {
+					BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_from_address(call_log), from));
+					BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_to_address(call_log), to));
+				}
 			}
 			LinphoneCall *ccall = linphone_core_get_call_by_remote_address2(focus.getLc(), mgr->identity);
 			BC_ASSERT_PTR_NOT_NULL(ccall);
@@ -7312,6 +7321,12 @@ void create_conference_with_chat_base(LinphoneConferenceSecurityLevel security_l
 				const LinphoneCallParams *call_cparams = linphone_call_get_current_params(ccall);
 				const LinphoneMediaEncryption ccall_enc = linphone_call_params_get_media_encryption(call_cparams);
 				BC_ASSERT_EQUAL(ccall_enc, encryption, int, "%d");
+				LinphoneCallLog *call_log = linphone_call_get_call_log(ccall);
+				BC_ASSERT_PTR_NOT_NULL(call_log);
+				if (call_log) {
+					BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_from_address(call_log), from));
+					BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_to_address(call_log), to));
+				}
 			}
 
 			LinphoneAddress *deviceAddr =
@@ -7411,6 +7426,36 @@ void create_conference_with_chat_base(LinphoneConferenceSecurityLevel security_l
 					return nb_devices == 5;
 				}));
 			}
+
+			const LinphoneAddress *from = ((mgr == marie.getCMgr()) || (start_time > 0)) ? mgr->identity : confAddr;
+			const LinphoneAddress *to = ((mgr == marie.getCMgr()) || (start_time > 0)) ? confAddr : mgr->identity;
+
+			LinphoneCall *pcall = linphone_core_get_call_by_remote_address2(mgr->lc, confAddr);
+			BC_ASSERT_PTR_NOT_NULL(pcall);
+			if (pcall) {
+				const LinphoneCallParams *call_cparams = linphone_call_get_current_params(pcall);
+				const LinphoneMediaEncryption pcall_enc = linphone_call_params_get_media_encryption(call_cparams);
+				BC_ASSERT_EQUAL(pcall_enc, encryption, int, "%d");
+				LinphoneCallLog *call_log = linphone_call_get_call_log(pcall);
+				BC_ASSERT_PTR_NOT_NULL(call_log);
+				if (call_log) {
+					BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_from_address(call_log), from));
+					BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_to_address(call_log), to));
+				}
+			}
+			LinphoneCall *ccall = linphone_core_get_call_by_remote_address2(focus.getLc(), mgr->identity);
+			BC_ASSERT_PTR_NOT_NULL(ccall);
+			if (ccall) {
+				const LinphoneCallParams *call_cparams = linphone_call_get_current_params(ccall);
+				const LinphoneMediaEncryption ccall_enc = linphone_call_params_get_media_encryption(call_cparams);
+				BC_ASSERT_EQUAL(ccall_enc, encryption, int, "%d");
+				LinphoneCallLog *call_log = linphone_call_get_call_log(ccall);
+				BC_ASSERT_PTR_NOT_NULL(call_log);
+				if (call_log) {
+					BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_from_address(call_log), from));
+					BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_to_address(call_log), to));
+				}
+			}
 		}
 
 		const std::initializer_list<std::reference_wrapper<ClientConference>> cores2{marie, laure, pauline, michelle,
@@ -12168,6 +12213,34 @@ void create_conference_dial_out_base(LinphoneConferenceLayout layout,
 				    !!((mgr == marie.getCMgr()) ? linphone_video_activation_policy_get_automatically_initiate(mgr_pol)
 				                                : linphone_video_activation_policy_get_automatically_accept(mgr_pol));
 
+				if (mgr != focus.getCMgr()) {
+					const LinphoneAddress *from = (mgr == marie.getCMgr()) ? mgr->identity : confAddr;
+					const LinphoneAddress *to = (mgr == marie.getCMgr()) ? confAddr : mgr->identity;
+
+					LinphoneCall *pcall = linphone_core_get_call_by_remote_address2(mgr->lc, confAddr);
+					BC_ASSERT_PTR_NOT_NULL(pcall);
+					if (pcall) {
+						LinphoneCallLog *call_log = linphone_call_get_call_log(pcall);
+						BC_ASSERT_PTR_NOT_NULL(call_log);
+						if (call_log) {
+							BC_ASSERT_TRUE(
+							    linphone_address_weak_equal(linphone_call_log_get_from_address(call_log), from));
+							BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_to_address(call_log), to));
+						}
+					}
+					LinphoneCall *ccall = linphone_core_get_call_by_remote_address2(focus.getLc(), mgr->identity);
+					BC_ASSERT_PTR_NOT_NULL(ccall);
+					if (ccall) {
+						LinphoneCallLog *call_log = linphone_call_get_call_log(ccall);
+						BC_ASSERT_PTR_NOT_NULL(call_log);
+						if (call_log) {
+							BC_ASSERT_TRUE(
+							    linphone_address_weak_equal(linphone_call_log_get_from_address(call_log), from));
+							BC_ASSERT_TRUE(linphone_address_weak_equal(linphone_call_log_get_to_address(call_log), to));
+						}
+					}
+				}
+
 				if (pconference) {
 					int no_participants = 0;
 					if (mgr == focus.getCMgr()) {
diff --git a/tester/local-scheduled-conference-tester.cpp b/tester/local-scheduled-conference-tester.cpp
index e8ed163a40..3dc702ba51 100644
--- a/tester/local-scheduled-conference-tester.cpp
+++ b/tester/local-scheduled-conference-tester.cpp
@@ -6992,7 +6992,7 @@ test_suite_t local_conference_test_suite_scheduled_conference_advanced = {
 };
 
 test_suite_t local_conference_test_suite_scheduled_conference_audio_only_participant = {
-    "Local conference tester (Audio only participants)",
+    "Local conference tester (Scheduled Conference with Audio only participants)",
     NULL,
     NULL,
     liblinphone_tester_before_each,
@@ -7005,7 +7005,7 @@ test_suite_t local_conference_test_suite_scheduled_conference_audio_only_partici
 };
 
 test_suite_t local_conference_test_suite_scheduled_conference_with_screen_sharing = {
-    "Local conference tester (Screen sharing)",
+    "Local conference tester (Scheduled Conference with Screen sharing)",
     NULL,
     NULL,
     liblinphone_tester_before_each,
@@ -7018,7 +7018,7 @@ test_suite_t local_conference_test_suite_scheduled_conference_with_screen_sharin
 };
 
 test_suite_t local_conference_test_suite_scheduled_conference_with_chat = {
-    "Local conference tester (Conference with chat)",
+    "Local conference tester (Scheduled Conference with chat)",
     NULL,
     NULL,
     liblinphone_tester_before_each,
diff --git a/tester/tester.c b/tester/tester.c
index b216e5026e..4467d6909b 100644
--- a/tester/tester.c
+++ b/tester/tester.c
@@ -686,7 +686,7 @@ static void conference_state_changed(LinphoneConference *conference, LinphoneCon
 	ms_free(newStateStr);
 
 	if ((newState != LinphoneConferenceStateNone) && (newState != LinphoneConferenceStateInstantiated) &&
-	    (newState != LinphoneConferenceStateCreationPending)) {
+	    (newState != LinphoneConferenceStateCreationPending) && !linphone_core_conference_server_enabled(core)) {
 		LinphoneParticipant *me = linphone_conference_get_me(conference);
 		BC_ASSERT_PTR_NOT_NULL(me);
 	}
-- 
GitLab