From 51ce29df7d0742b827b49a6eebb7725c59ffefca Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 5 May 2016 09:52:16 +0200 Subject: [PATCH 1/8] fix payload type flag --- coreapi/offeranswer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index 81136fc73..dd0502f08 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -223,6 +223,7 @@ static MSList *match_payloads(MSFactory *factory, const MSList *local, const MSL */ matched=payload_type_clone(matched); payload_type_set_number(matched,local_number); + payload_type_set_flag(matched, PAYLOAD_TYPE_FLAG_CAN_RECV); payload_type_set_flag(matched, PAYLOAD_TYPE_FROZEN_NUMBER); res=ms_list_append(res,matched); } From 39f82d4e05c00e042939141b3a84f3a810bdadca Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 5 May 2016 16:50:14 +0200 Subject: [PATCH 2/8] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 066b148a7..d777f601f 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 066b148a7648fcb93c0e97523854a3b629c59092 +Subproject commit d777f601f1b2997b91d54186441a2c3e27d2b544 From d0652895feac01d3f1c2cc3ebcb2787ca6cbde32 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 5 May 2016 23:20:27 +0200 Subject: [PATCH 3/8] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index d777f601f..72de22a29 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit d777f601f1b2997b91d54186441a2c3e27d2b544 +Subproject commit 72de22a29e2f6d7330ee3ed6854437692f178a8f From 89f62e10e963178131ffe7c3f0da2f626074b087 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 6 May 2016 10:43:41 +0200 Subject: [PATCH 4/8] Prevent crash when reinvite has payload with null mime type --- coreapi/offeranswer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index dd0502f08..1c29fea1c 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -161,8 +161,10 @@ void linphone_core_register_offer_answer_providers(LinphoneCore *lc){ static PayloadType * find_payload_type_best_match(MSFactory *factory, const MSList *local_payloads, const PayloadType *refpt, const MSList *remote_payloads, bool_t reading_response){ PayloadType *ret = NULL; - MSOfferAnswerContext *ctx = ms_factory_create_offer_answer_context(factory, refpt->mime_type); - if (ctx){ + MSOfferAnswerContext *ctx = NULL; + + // When a stream is inactive, refpt->mime_type might be null + if (refpt->mime_type && (ctx = ms_factory_create_offer_answer_context(factory, refpt->mime_type))) { ms_message("Doing offer/answer processing with specific provider for codec [%s]", refpt->mime_type); ret = ms_offer_answer_context_match_payload(ctx, local_payloads, refpt, remote_payloads, reading_response); ms_offer_answer_context_destroy(ctx); From 8fdfb4160a9f566af890f374853b5332b958174d Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 6 May 2016 15:17:57 +0200 Subject: [PATCH 5/8] Improved chat_message_put_char method to store message if end of line character is passed + improved tester --- coreapi/chat.c | 32 ++++++++++++++++++++++++------ tester/message_tester.c | 43 ++++++++++++++++++++++++++++++++++------- 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index 3f9d6692c..a7f7f06c8 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -329,7 +329,6 @@ void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatMessage if (cr->call && linphone_call_params_realtime_text_enabled(linphone_call_get_current_params(cr->call))) { uint32_t new_line = 0x2028; linphone_chat_message_put_char(msg, new_line); // New Line - linphone_chat_message_set_state(msg, LinphoneChatMessageStateDelivered); linphone_chat_message_unref(msg); return; } @@ -867,7 +866,7 @@ void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *c if (character == new_line || character == crlf || character == lf) { // End of message LinphoneChatMessage *msg = cr->pending_message; - ms_message("New line received, forge a message with content %s", cr->pending_message->message); + ms_debug("New line received, forge a message with content %s", cr->pending_message->message); linphone_chat_message_set_from(msg, cr->peer_url); if (msg->to) @@ -890,7 +889,7 @@ void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *c } else { char *value = utf8_to_char(character); cr->pending_message->message = ms_strcat_printf(cr->pending_message->message, value); - ms_message("Received RTT character: %s (%lu), pending text is %s", value, (unsigned long)character, cr->pending_message->message); + ms_debug("Received RTT character: %s (%lu), pending text is %s", value, (unsigned long)character, cr->pending_message->message); ms_free(value); } } @@ -911,15 +910,36 @@ uint32_t linphone_chat_room_get_char(const LinphoneChatRoom *cr) { return 0; } -int linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t charater) { +int linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t character) { LinphoneChatRoom *cr = linphone_chat_message_get_chat_room(msg); LinphoneCall *call = cr->call; + uint32_t new_line = 0x2028; + uint32_t crlf = 0x0D0A; + uint32_t lf = 0x0A; if (!call || !call->textstream) { return -1; } - - text_stream_putchar32(call->textstream, charater); + + if (character == new_line || character == crlf || character == lf) { + ms_debug("New line sent, forge a message with content %s", msg->message); + msg->time = ms_time(0); + msg->state = LinphoneChatMessageStateDelivered; + msg->is_read = TRUE; + msg->dir = LinphoneChatMessageOutgoing; + if (msg->from) linphone_address_destroy(msg->from); + msg->from = linphone_address_new(linphone_core_get_identity(cr->lc)); + msg->storage_id = linphone_chat_message_store(msg); + ms_free(msg->message); + msg->message = NULL; + } else { + char *value = utf8_to_char(character); + msg->message = ms_strcat_printf(msg->message, value); + ms_debug("Sent RTT character: %s (%lu), pending text is %s", value, (unsigned long)character, msg->message); + ms_free(value); + } + + text_stream_putchar32(call->textstream, character); return 0; } diff --git a/tester/message_tester.c b/tester/message_tester.c index 4b3e1675e..d9da01a43 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -1333,12 +1333,19 @@ static void file_transfer_io_error_after_destroying_chatroom(void) { file_transfer_io_error_base("https://www.linphone.org:444/lft.php", TRUE); } -static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, bool_t mess_with_marie_payload_number, bool_t mess_with_pauline_payload_number, bool_t ice_enabled) { +static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, bool_t mess_with_marie_payload_number, bool_t mess_with_pauline_payload_number, bool_t ice_enabled, bool_t sql_storage) { LinphoneChatRoom *pauline_chat_room; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); LinphoneCallParams *marie_params = NULL; LinphoneCall *pauline_call, *marie_call; + char *marie_db = bc_tester_file("marie.db"); + char *pauline_db = bc_tester_file("pauline.db"); + + if (sql_storage) { + linphone_core_set_chat_database_path(marie->lc, marie_db); + linphone_core_set_chat_database_path(pauline->lc, pauline_db); + } if (mess_with_marie_payload_number) { MSList *elem; @@ -1405,6 +1412,19 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo } linphone_chat_room_send_chat_message(pauline_chat_room, rtt_message); BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1)); + + if (sql_storage) { + MSList *marie_messages = linphone_chat_room_get_history(marie_chat_room, 0); + MSList *pauline_messages = linphone_chat_room_get_history(pauline_chat_room, 0); + LinphoneChatMessage *marie_msg = (LinphoneChatMessage *)marie_messages->data; + LinphoneChatMessage *pauline_msg = (LinphoneChatMessage *)pauline_messages->data; + BC_ASSERT_EQUAL(ms_list_size(marie_messages), 1, int , "%i"); + BC_ASSERT_EQUAL(ms_list_size(pauline_messages), 1, int , "%i"); + BC_ASSERT_STRING_EQUAL(marie_msg->message, message); + BC_ASSERT_STRING_EQUAL(pauline_msg->message, message); + ms_list_free_with_data(marie_messages, (void (*)(void *))linphone_chat_message_unref); + ms_list_free_with_data(pauline_messages, (void (*)(void *))linphone_chat_message_unref); + } } if (!audio_stream_enabled) { @@ -1423,10 +1443,18 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo linphone_call_params_destroy(marie_params); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); + remove(marie_db); + bc_free(marie_db); + remove(pauline_db); + bc_free(pauline_db); } static void real_time_text_message(void) { - real_time_text(TRUE, FALSE, FALSE, FALSE, FALSE); + real_time_text(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE); +} + +static void real_time_text_sql_storage(void) { + real_time_text(TRUE, FALSE, FALSE, FALSE, FALSE, TRUE); } static void real_time_text_conversation(void) { @@ -1529,15 +1557,15 @@ static void real_time_text_conversation(void) { } static void real_time_text_without_audio(void) { - real_time_text(FALSE, FALSE, FALSE, FALSE, FALSE); + real_time_text(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); } static void real_time_text_srtp(void) { - real_time_text(TRUE, TRUE, FALSE, FALSE, FALSE); + real_time_text(TRUE, TRUE, FALSE, FALSE, FALSE, FALSE); } static void real_time_text_ice(void) { - real_time_text(TRUE, FALSE, FALSE, FALSE, TRUE); + real_time_text(TRUE, FALSE, FALSE, FALSE, TRUE, FALSE); } static void real_time_text_message_compat(bool_t end_with_crlf, bool_t end_with_lf) { @@ -1646,11 +1674,11 @@ static void real_time_text_message_accented_chars(void) { } static void real_time_text_message_different_text_codecs_payload_numbers_sender_side(void) { - real_time_text(FALSE, FALSE, TRUE, FALSE, FALSE); + real_time_text(FALSE, FALSE, TRUE, FALSE, FALSE, FALSE); } static void real_time_text_message_different_text_codecs_payload_numbers_receiver_side(void) { - real_time_text(FALSE, FALSE, FALSE, TRUE, FALSE); + real_time_text(FALSE, FALSE, FALSE, TRUE, FALSE, FALSE); } static void real_time_text_copy_paste(void) { @@ -1748,6 +1776,7 @@ test_t message_tests[] = { TEST_ONE_TAG("Transfer not sent if url moved permanently", file_transfer_not_sent_if_url_moved_permanently, "LeaksMemory"), TEST_ONE_TAG("Transfer io error after destroying chatroom", file_transfer_io_error_after_destroying_chatroom, "LeaksMemory"), TEST_NO_TAG("Real Time Text message", real_time_text_message), + TEST_NO_TAG("Real Time Text SQL storage", real_time_text_sql_storage), TEST_NO_TAG("Real Time Text conversation", real_time_text_conversation), TEST_NO_TAG("Real Time Text without audio", real_time_text_without_audio), TEST_NO_TAG("Real Time Text with srtp", real_time_text_srtp), From c1ebfa171a7d52dde1e4b6bf43dab76117d7c3e4 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 6 May 2016 15:18:47 +0200 Subject: [PATCH 6/8] make sure ice re-invite is disabled in case of DTLS --- cmake/FindIconv.cmake | 2 +- coreapi/linphonecall.c | 3 ++- tester/call_tester.c | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake index b0ae9013a..525bb330a 100644 --- a/cmake/FindIconv.cmake +++ b/cmake/FindIconv.cmake @@ -27,7 +27,7 @@ # ICONV_LIBRARIES - The libraries needed to use libiconv if(APPLE AND NOT IOS) - set(ICONV_HINTS "/usr") + set(ICONV_HINTS "${CMAKE_OSX_SYSROOT}/usr" "/usr") endif() if(ICONV_HINTS) set(ICONV_LIBRARIES_HINTS "${ICONV_HINTS}/lib") diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index e67ec9226..403a9c7b0 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -4367,7 +4367,8 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){ case IS_Failed: /* At least one ICE session has succeeded, so perform a call update. */ if (ice_session_has_completed_check_list(call->ice_session) == TRUE) { - if (ice_session_role(call->ice_session) == IR_Controlling && call->params->update_call_when_ice_completed ) { + const LinphoneCallParams *current_param = linphone_call_get_current_params(call); + if (ice_session_role(call->ice_session) == IR_Controlling && current_param->update_call_when_ice_completed ) { LinphoneCallParams *params = linphone_core_create_call_params(call->core, call); params->internal_call_update = TRUE; linphone_core_update_call(call->core, call, params); diff --git a/tester/call_tester.c b/tester/call_tester.c index 89e1b01a3..09c99a154 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -4266,6 +4266,41 @@ end: linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } +static void call_with_very_early_call_update(void) { + LinphoneCoreManager* marie; + LinphoneCoreManager* pauline; + LinphoneCallParams *params; + + marie = linphone_core_manager_new( "marie_rc"); + pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + linphone_core_invite_address(marie->lc,pauline->identity); + + BC_ASSERT_TRUE (wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallIncomingReceived,1)); + BC_ASSERT_TRUE(linphone_core_inc_invite_pending(pauline->lc)); + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallOutgoingProgress,1, int, "%d"); + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallOutgoingRinging,1)); + + BC_ASSERT_PTR_NOT_NULL(linphone_core_get_current_call_remote_address(pauline->lc)); + if (linphone_core_get_current_call_remote_address(pauline->lc)) { + linphone_core_accept_call(pauline->lc,linphone_core_get_current_call(pauline->lc)); + BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallStreamsRunning,1)); + } + + + params=linphone_core_create_call_params(pauline->lc,linphone_core_get_current_call(pauline->lc)); + linphone_core_update_call(pauline->lc,linphone_core_get_current_call(pauline->lc),params); + linphone_call_params_destroy(params); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallUpdating,1)); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallUpdatedByRemote,1)); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallStreamsRunning,2)); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallStreamsRunning,2)); + end_call(marie,pauline); + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} + + static void call_with_in_dialog_codec_change_base(bool_t no_sdp) { int dummy=0; LinphoneCoreManager* marie; @@ -6392,6 +6427,7 @@ test_t call_tests[] = { TEST_NO_TAG("Call with no audio codec", call_with_no_audio_codec), TEST_NO_TAG("Video call with no audio and no video codec", video_call_with_no_audio_and_no_video_codec), TEST_NO_TAG("Call with in-dialog UPDATE request", call_with_in_dialog_update), + TEST_NO_TAG("Call with in-dialog very early call request", call_with_very_early_call_update), TEST_NO_TAG("Call with in-dialog codec change", call_with_in_dialog_codec_change), TEST_NO_TAG("Call with in-dialog codec change no sdp", call_with_in_dialog_codec_change_no_sdp), TEST_NO_TAG("Call with pause no SDP on resume", call_with_paused_no_sdp_on_resume), From 2ed0e5547cd835a1d8e013ffb349b59d2a402568 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 6 May 2016 15:25:03 +0200 Subject: [PATCH 7/8] Added linphonerc field to disable RTT messages database storage --- coreapi/chat.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index a7f7f06c8..061e14fc6 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -877,7 +877,10 @@ void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *c msg->state = LinphoneChatMessageStateDelivered; msg->is_read = FALSE; msg->dir = LinphoneChatMessageIncoming; - msg->storage_id = linphone_chat_message_store(msg); + + if (lp_config_get_int(lc->config, "misc", "store_rtt_messages", 1) == 1) { + msg->storage_id = linphone_chat_message_store(msg); + } if (cr->unread_count < 0) cr->unread_count = 1; else cr->unread_count++; @@ -913,6 +916,7 @@ uint32_t linphone_chat_room_get_char(const LinphoneChatRoom *cr) { int linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t character) { LinphoneChatRoom *cr = linphone_chat_message_get_chat_room(msg); LinphoneCall *call = cr->call; + LinphoneCore *lc = cr->lc; uint32_t new_line = 0x2028; uint32_t crlf = 0x0D0A; uint32_t lf = 0x0A; @@ -922,16 +926,18 @@ int linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t character) } if (character == new_line || character == crlf || character == lf) { - ms_debug("New line sent, forge a message with content %s", msg->message); - msg->time = ms_time(0); - msg->state = LinphoneChatMessageStateDelivered; - msg->is_read = TRUE; - msg->dir = LinphoneChatMessageOutgoing; - if (msg->from) linphone_address_destroy(msg->from); - msg->from = linphone_address_new(linphone_core_get_identity(cr->lc)); - msg->storage_id = linphone_chat_message_store(msg); - ms_free(msg->message); - msg->message = NULL; + if (lc && lp_config_get_int(lc->config, "misc", "store_rtt_messages", 1) == 1) { + ms_debug("New line sent, forge a message with content %s", msg->message); + msg->time = ms_time(0); + msg->state = LinphoneChatMessageStateDelivered; + msg->is_read = TRUE; + msg->dir = LinphoneChatMessageOutgoing; + if (msg->from) linphone_address_destroy(msg->from); + msg->from = linphone_address_new(linphone_core_get_identity(lc)); + msg->storage_id = linphone_chat_message_store(msg); + ms_free(msg->message); + msg->message = NULL; + } } else { char *value = utf8_to_char(character); msg->message = ms_strcat_printf(msg->message, value); From b2ef61c6e5be3e1c7a735216627c46835df3bb44 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 6 May 2016 15:41:28 +0200 Subject: [PATCH 8/8] Added test to check [misc] store_rtt_messages=0 --- tester/message_tester.c | 47 +++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/tester/message_tester.c b/tester/message_tester.c index d9da01a43..13bc8c933 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -1333,7 +1333,8 @@ static void file_transfer_io_error_after_destroying_chatroom(void) { file_transfer_io_error_base("https://www.linphone.org:444/lft.php", TRUE); } -static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, bool_t mess_with_marie_payload_number, bool_t mess_with_pauline_payload_number, bool_t ice_enabled, bool_t sql_storage) { +static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, bool_t mess_with_marie_payload_number, bool_t mess_with_pauline_payload_number, + bool_t ice_enabled, bool_t sql_storage, bool_t do_not_store_rtt_messages_in_sql_storage) { LinphoneChatRoom *pauline_chat_room; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); @@ -1345,6 +1346,10 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo if (sql_storage) { linphone_core_set_chat_database_path(marie->lc, marie_db); linphone_core_set_chat_database_path(pauline->lc, pauline_db); + if (do_not_store_rtt_messages_in_sql_storage) { + lp_config_set_int(marie->lc->config, "misc", "store_rtt_messages", 0); + lp_config_set_int(pauline->lc->config, "misc", "store_rtt_messages", 0); + } } if (mess_with_marie_payload_number) { @@ -1416,14 +1421,19 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo if (sql_storage) { MSList *marie_messages = linphone_chat_room_get_history(marie_chat_room, 0); MSList *pauline_messages = linphone_chat_room_get_history(pauline_chat_room, 0); - LinphoneChatMessage *marie_msg = (LinphoneChatMessage *)marie_messages->data; - LinphoneChatMessage *pauline_msg = (LinphoneChatMessage *)pauline_messages->data; - BC_ASSERT_EQUAL(ms_list_size(marie_messages), 1, int , "%i"); - BC_ASSERT_EQUAL(ms_list_size(pauline_messages), 1, int , "%i"); - BC_ASSERT_STRING_EQUAL(marie_msg->message, message); - BC_ASSERT_STRING_EQUAL(pauline_msg->message, message); - ms_list_free_with_data(marie_messages, (void (*)(void *))linphone_chat_message_unref); - ms_list_free_with_data(pauline_messages, (void (*)(void *))linphone_chat_message_unref); + if (do_not_store_rtt_messages_in_sql_storage) { + BC_ASSERT_EQUAL(ms_list_size(marie_messages), 0, int , "%i"); + BC_ASSERT_EQUAL(ms_list_size(pauline_messages), 0, int , "%i"); + } else { + LinphoneChatMessage *marie_msg = (LinphoneChatMessage *)marie_messages->data; + LinphoneChatMessage *pauline_msg = (LinphoneChatMessage *)pauline_messages->data; + BC_ASSERT_EQUAL(ms_list_size(marie_messages), 1, int , "%i"); + BC_ASSERT_EQUAL(ms_list_size(pauline_messages), 1, int , "%i"); + BC_ASSERT_STRING_EQUAL(marie_msg->message, message); + BC_ASSERT_STRING_EQUAL(pauline_msg->message, message); + ms_list_free_with_data(marie_messages, (void (*)(void *))linphone_chat_message_unref); + ms_list_free_with_data(pauline_messages, (void (*)(void *))linphone_chat_message_unref); + } } } @@ -1450,11 +1460,15 @@ static void real_time_text(bool_t audio_stream_enabled, bool_t srtp_enabled, boo } static void real_time_text_message(void) { - real_time_text(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE); + real_time_text(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); } static void real_time_text_sql_storage(void) { - real_time_text(TRUE, FALSE, FALSE, FALSE, FALSE, TRUE); + real_time_text(TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE); +} + +static void real_time_text_sql_storage_rtt_disabled(void) { + real_time_text(TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE); } static void real_time_text_conversation(void) { @@ -1557,15 +1571,15 @@ static void real_time_text_conversation(void) { } static void real_time_text_without_audio(void) { - real_time_text(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); + real_time_text(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); } static void real_time_text_srtp(void) { - real_time_text(TRUE, TRUE, FALSE, FALSE, FALSE, FALSE); + real_time_text(TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE); } static void real_time_text_ice(void) { - real_time_text(TRUE, FALSE, FALSE, FALSE, TRUE, FALSE); + real_time_text(TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE); } static void real_time_text_message_compat(bool_t end_with_crlf, bool_t end_with_lf) { @@ -1674,11 +1688,11 @@ static void real_time_text_message_accented_chars(void) { } static void real_time_text_message_different_text_codecs_payload_numbers_sender_side(void) { - real_time_text(FALSE, FALSE, TRUE, FALSE, FALSE, FALSE); + real_time_text(FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE); } static void real_time_text_message_different_text_codecs_payload_numbers_receiver_side(void) { - real_time_text(FALSE, FALSE, FALSE, TRUE, FALSE, FALSE); + real_time_text(FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE); } static void real_time_text_copy_paste(void) { @@ -1777,6 +1791,7 @@ test_t message_tests[] = { TEST_ONE_TAG("Transfer io error after destroying chatroom", file_transfer_io_error_after_destroying_chatroom, "LeaksMemory"), TEST_NO_TAG("Real Time Text message", real_time_text_message), TEST_NO_TAG("Real Time Text SQL storage", real_time_text_sql_storage), + TEST_NO_TAG("Real Time Text SQL storage with RTT messages not stored", real_time_text_sql_storage_rtt_disabled), TEST_NO_TAG("Real Time Text conversation", real_time_text_conversation), TEST_NO_TAG("Real Time Text without audio", real_time_text_without_audio), TEST_NO_TAG("Real Time Text with srtp", real_time_text_srtp),