From e7195bb8df88a74a6091c95afcd947897c091e6b Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 11 Jan 2016 10:58:14 +0100 Subject: [PATCH 01/16] account_creator: add username_max_length and password_max_length --- coreapi/account_creator.c | 12 +++++++++--- coreapi/account_creator.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index 740345fa0..c929fb40a 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -184,13 +184,16 @@ static bool_t is_matching_regex(const char *entry, const char* regex) { } LinphoneAccountCreatorStatus linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username) { - int min_length = lp_config_get_int(creator->core->config, "assistant", "username_min_length", 0); - int fixed_length = lp_config_get_int(creator->core->config, "assistant", "username_length", 0); + int min_length = lp_config_get_int(creator->core->config, "assistant", "username_min_length", -1); + int fixed_length = lp_config_get_int(creator->core->config, "assistant", "username_length", -1); + int max_length = lp_config_get_int(creator->core->config, "assistant", "username_max_length", -1); bool_t use_phone_number = lp_config_get_int(creator->core->config, "assistant", "use_phone_number", 0); const char* regex = lp_config_get_string(creator->core->config, "assistant", "username_regex", 0); LinphoneAccountCreatorStatus status; if (min_length > 0 && strlen(username) < min_length) { return LinphoneAccountCreatorUsernameTooShort; + } else if (max_length > 0 && strlen(username) > max_length) { + return LinphoneAccountCreatorUsernameTooLong; } else if (fixed_length > 0 && strlen(username) != fixed_length) { return LinphoneAccountCreatorUsernameInvalidSize; } else if (use_phone_number && !linphone_proxy_config_is_phone_number(NULL, username)) { @@ -209,9 +212,12 @@ const char * linphone_account_creator_get_username(const LinphoneAccountCreator } LinphoneAccountCreatorStatus linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password){ - int min_length = lp_config_get_int(creator->core->config, "assistant", "password_min_length", 0); + int min_length = lp_config_get_int(creator->core->config, "assistant", "password_min_length", -1); + int max_length = lp_config_get_int(creator->core->config, "assistant", "password_max_length", -1); if (min_length > 0 && strlen(password) < min_length) { return LinphoneAccountCreatorPasswordTooShort; + } else if (max_length > 0 && strlen(password) > max_length) { + return LinphoneAccountCreatorPasswordTooLong; } set_string(&creator->password, password, FALSE); return LinphoneAccountCreatorOK; diff --git a/coreapi/account_creator.h b/coreapi/account_creator.h index fe6c46c3d..41730dcfa 100644 --- a/coreapi/account_creator.h +++ b/coreapi/account_creator.h @@ -51,8 +51,10 @@ typedef enum _LinphoneAccountCreatorStatus { LinphoneAccountCreatorEmailInvalid, LinphoneAccountCreatorUsernameInvalid, LinphoneAccountCreatorUsernameTooShort, + LinphoneAccountCreatorUsernameTooLong, LinphoneAccountCreatorUsernameInvalidSize, LinphoneAccountCreatorPasswordTooShort, + LinphoneAccountCreatorPasswordTooLong, LinphoneAccountCreatorDomainInvalid, LinphoneAccountCreatorRouteInvalid, LinphoneAccountCreatorDisplayNameInvalid, From a1eb9a0f5ba5564ef0411f46198c4ac1edc77101 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 11 Jan 2016 11:34:40 +0100 Subject: [PATCH 02/16] Create a new subscription when the friend list is changed instead of refreshing the existing one. --- coreapi/friendlist.c | 52 +++++++++++++++++++++++++++++--------------- coreapi/private.h | 1 + 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index feba9bde3..517af0a22 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "linphonecore.h" #include "private.h" +#include static char * create_resource_list_xml(const LinphoneFriendList *list) { @@ -382,27 +383,42 @@ void linphone_friend_list_close_subscriptions(LinphoneFriendList *list) { void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, LinphoneProxyConfig *cfg, bool_t only_when_registered) { const MSList *elem; - if (list->event != NULL) { - linphone_event_refresh_subscribe(list->event); - } else if (list->rls_uri != NULL) { + if (list->rls_uri != NULL) { LinphoneAddress *address = linphone_address_new(list->rls_uri); char *xml_content = create_resource_list_xml(list); if ((address != NULL) && (xml_content != NULL) && (linphone_friend_list_has_subscribe_inactive(list) == TRUE)) { - LinphoneContent *content; - int expires = lp_config_get_int(list->lc->config, "sip", "rls_presence_expires", 3600); - list->expected_notification_version = 0; - list->event = linphone_core_create_subscribe(list->lc, address, "presence", expires); - linphone_event_set_internal(list->event, TRUE); - linphone_event_add_custom_header(list->event, "Require", "recipient-list-subscribe"); - linphone_event_add_custom_header(list->event, "Supported", "eventlist"); - linphone_event_add_custom_header(list->event, "Accept", "multipart/related, application/pidf+xml, application/rlmi+xml"); - linphone_event_add_custom_header(list->event, "Content-Disposition", "recipient-list"); - content = linphone_core_create_content(list->lc); - linphone_content_set_type(content, "application"); - linphone_content_set_subtype(content, "resource-lists+xml"); - linphone_content_set_string_buffer(content, xml_content); - linphone_event_send_subscribe(list->event, content); - linphone_content_unref(content); + md5_context ctx; + unsigned char digest[16]; + md5_init(&ctx); + md5_update(&ctx, (unsigned char *)xml_content, strlen(xml_content)); + md5_finish(&ctx, digest); + if ((list->event != NULL) && (list->content_digest != NULL) && (memcmp(list->content_digest, digest, sizeof(digest)) == 0)) { + /* The content has not changed, only refresh the event. */ + linphone_event_refresh_subscribe(list->event); + } else { + LinphoneContent *content; + int expires = lp_config_get_int(list->lc->config, "sip", "rls_presence_expires", 3600); + list->expected_notification_version = 0; + if (list->content_digest != NULL) ms_free(list->content_digest); + list->content_digest = ms_malloc(sizeof(digest)); + memcpy(list->content_digest, digest, sizeof(digest)); + if (list->event != NULL) { + linphone_event_terminate(list->event); + linphone_event_unref(list->event); + } + list->event = linphone_core_create_subscribe(list->lc, address, "presence", expires); + linphone_event_set_internal(list->event, TRUE); + linphone_event_add_custom_header(list->event, "Require", "recipient-list-subscribe"); + linphone_event_add_custom_header(list->event, "Supported", "eventlist"); + linphone_event_add_custom_header(list->event, "Accept", "multipart/related, application/pidf+xml, application/rlmi+xml"); + linphone_event_add_custom_header(list->event, "Content-Disposition", "recipient-list"); + content = linphone_core_create_content(list->lc); + linphone_content_set_type(content, "application"); + linphone_content_set_subtype(content, "resource-lists+xml"); + linphone_content_set_string_buffer(content, xml_content); + linphone_event_send_subscribe(list->event, content); + linphone_content_unref(content); + } } if (address != NULL) linphone_address_unref(address); if (xml_content != NULL) ms_free(xml_content); diff --git a/coreapi/private.h b/coreapi/private.h index 91b6d3e55..5e63ff151 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -688,6 +688,7 @@ struct _LinphoneFriendList { char *display_name; char *rls_uri; MSList *friends; + unsigned char *content_digest; int expected_notification_version; }; From 5cf1abd58e8c2758908ab656f476641f328a81cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 11 Jan 2016 11:44:12 +0100 Subject: [PATCH 03/16] Fixes prefix of bellesip's wake_lock functions --- coreapi/linphonecore_jni.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 178b74350..0bc48f880 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -4675,8 +4675,8 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioDscp(JNIEnv* env extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAndroidPowerManager(JNIEnv *env, jclass cls, jobject pm) { #ifdef ANDROID - if(pm != NULL) bellesip_wake_lock_init(env, pm); - else bellesip_wake_lock_uninit(env); + if(pm != NULL) belle_sip_wake_lock_init(env, pm); + else belle_sip_wake_lock_uninit(env); #endif } From 734fe2f7a2d20ed0e3da669e642640c71f0ca965 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 11 Jan 2016 12:05:41 +0100 Subject: [PATCH 04/16] Fix memory leak in friend list. --- coreapi/friendlist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index 517af0a22..ab669dc41 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -226,6 +226,7 @@ static LinphoneFriendList * linphone_friend_list_new(void) { static void linphone_friend_list_destroy(LinphoneFriendList *list) { if (list->display_name != NULL) ms_free(list->display_name); if (list->rls_uri != NULL) ms_free(list->rls_uri); + if (list->content_digest != NULL) ms_free(list->content_digest); if (list->event != NULL) linphone_event_unref(list->event); list->friends = ms_list_free_with_data(list->friends, (void (*)(void *))linphone_friend_unref); } From bd6add296362557cbaad90acec7dce2d5f6486c3 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 11 Jan 2016 12:05:54 +0100 Subject: [PATCH 05/16] Fix missing symbol exports on Windows. --- coreapi/conference.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coreapi/conference.h b/coreapi/conference.h index 24d889a92..1f593f009 100644 --- a/coreapi/conference.h +++ b/coreapi/conference.h @@ -45,7 +45,7 @@ void linphone_conference_free(LinphoneConference *obj); int linphone_conference_add_participant(LinphoneConference *obj, LinphoneCall *call); int linphone_conference_remove_participant_with_call(LinphoneConference *obj, LinphoneCall *call); -int linphone_conference_remove_participant(LinphoneConference *obj, const LinphoneAddress *uri); +LINPHONE_PUBLIC int linphone_conference_remove_participant(LinphoneConference *obj, const LinphoneAddress *uri); int linphone_conference_terminate(LinphoneConference *obj); int linphone_conference_enter(LinphoneConference *obj); @@ -57,8 +57,8 @@ int linphone_conference_mute_microphone(LinphoneConference *obj, bool_t val); bool_t linphone_conference_microphone_is_muted(const LinphoneConference *obj); float linphone_conference_get_input_volume(const LinphoneConference *obj); -int linphone_conference_get_participant_count(const LinphoneConference *obj); -MSList *linphone_conference_get_participants(const LinphoneConference *obj); +LINPHONE_PUBLIC int linphone_conference_get_participant_count(const LinphoneConference *obj); +LINPHONE_PUBLIC MSList *linphone_conference_get_participants(const LinphoneConference *obj); int linphone_conference_start_recording(LinphoneConference *obj, const char *path); int linphone_conference_stop_recording(LinphoneConference *obj); From 95d1e16f6ad57e75980aca69ddae017c4b3a9ddb Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 11 Jan 2016 12:05:23 +0100 Subject: [PATCH 06/16] account_creator: fix crash in set_username --- coreapi/account_creator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index c929fb40a..0e1960c0e 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -148,6 +148,7 @@ static LinphoneAccountCreatorStatus validate_uri(const char* username, const cha if (addr == NULL) { status = LinphoneAccountCreatorUsernameInvalid; + goto end; } if (domain && linphone_address_set_domain(addr, domain) != 0) { @@ -157,7 +158,6 @@ static LinphoneAccountCreatorStatus validate_uri(const char* username, const cha if (display_name && linphone_address_set_display_name(addr, display_name) != 0) { status = LinphoneAccountCreatorDisplayNameInvalid; } - linphone_address_unref(addr); end: linphone_proxy_config_destroy(proxy); From 2e52ca9e8aef9245996e795cafedb0c352885f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 11 Jan 2016 14:32:23 +0100 Subject: [PATCH 07/16] Prevents Conference.getParticipants() from including the URI of the conference focus --- coreapi/conference.cc | 4 ++-- tester/multi_call_tester.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/coreapi/conference.cc b/coreapi/conference.cc index 0c7406152..7f47b19aa 100644 --- a/coreapi/conference.cc +++ b/coreapi/conference.cc @@ -66,7 +66,7 @@ public: bool microphoneIsMuted() const {return m_isMuted;} float getInputVolume() const; - virtual int getParticipantCount() const {return m_participants.size();} + virtual int getParticipantCount() const {return m_participants.size() + (isIn()?1:0);} const std::list &getParticipants() const {return m_participants;} virtual int startRecording(const char *path) = 0; @@ -585,7 +585,7 @@ int RemoteConference::addParticipant(LinphoneCall *call) { m_pendingCalls = ms_list_append(m_pendingCalls, linphone_call_ref(call)); m_state = ConnectingToFocus; linphone_address_unref(addr); - addParticipant(m_focusCall); + call->conf_ref = (LinphoneConference *)this; return 0; } else return -1; diff --git a/tester/multi_call_tester.c b/tester/multi_call_tester.c index 3807f095c..4e20d721b 100644 --- a/tester/multi_call_tester.c +++ b/tester/multi_call_tester.c @@ -263,7 +263,8 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag if(conference) { MSList *participants = linphone_conference_get_participants(conference); BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), linphone_core_get_conference_size(marie->lc), int, "%d"); - BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), ms_list_size(participants), int, "%d"); + BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), ms_list_size(participants)+(linphone_conference_is_in(conference)?1:0), int, "%d"); + BC_ASSERT_TRUE(linphone_conference_is_in(conference)); ms_list_free_with_data(participants, (void(*)(void *))linphone_address_destroy); } From f0d1446f2238fe9b9443cf3ac3a966fc2066c22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 11 Jan 2016 14:50:15 +0100 Subject: [PATCH 08/16] Renames LinphoneConference.getParticipantsCount() into getSize() --- coreapi/conference.cc | 14 +++++++------- coreapi/conference.h | 2 +- coreapi/linphonecore.c | 2 +- coreapi/linphonecore.h | 5 +++-- tester/multi_call_tester.c | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/coreapi/conference.cc b/coreapi/conference.cc index 7f47b19aa..9defb80d3 100644 --- a/coreapi/conference.cc +++ b/coreapi/conference.cc @@ -66,7 +66,7 @@ public: bool microphoneIsMuted() const {return m_isMuted;} float getInputVolume() const; - virtual int getParticipantCount() const {return m_participants.size() + (isIn()?1:0);} + virtual int getSize() const {return m_participants.size() + (isIn()?1:0);} const std::list &getParticipants() const {return m_participants;} virtual int startRecording(const char *path) = 0; @@ -98,7 +98,7 @@ public: virtual int enter(); virtual int leave(); virtual bool isIn() const {return m_localParticipantStream!=NULL;} - virtual int getParticipantCount() const; + virtual int getSize() const; virtual int startRecording(const char *path); virtual int stopRecording(); @@ -380,7 +380,7 @@ int LocalConference::removeFromConference(LinphoneCall *call, bool_t active){ } int LocalConference::remoteParticipantsCount() { - int count=getParticipantCount(); + int count=getSize(); if (count==0) return 0; if (!m_localParticipantStream) return count; return count -1; @@ -477,7 +477,7 @@ int LocalConference::leave() { return 0; } -int LocalConference::getParticipantCount() const { +int LocalConference::getSize() const { if (m_conf == NULL) { return 0; } @@ -527,7 +527,7 @@ void LocalConference::onCallStreamStopping(LinphoneCall *call) { void LocalConference::onCallTerminating(LinphoneCall *call) { int remote_count=remoteParticipantsCount(); - ms_message("conference_check_uninit(): size=%i", getParticipantCount()); + ms_message("conference_check_uninit(): size=%i", getSize()); if (remote_count==1 && !m_terminated){ convertConferenceToCall(); } @@ -840,8 +840,8 @@ float linphone_conference_get_input_volume(const LinphoneConference *obj) { return ((Conference *)obj)->getInputVolume(); } -int linphone_conference_get_participant_count(const LinphoneConference *obj) { - return ((Conference *)obj)->getParticipantCount(); +int linphone_conference_get_size(const LinphoneConference *obj) { + return ((Conference *)obj)->getSize(); } MSList *linphone_conference_get_participants(const LinphoneConference *obj) { diff --git a/coreapi/conference.h b/coreapi/conference.h index 1f593f009..1086920c2 100644 --- a/coreapi/conference.h +++ b/coreapi/conference.h @@ -57,7 +57,7 @@ int linphone_conference_mute_microphone(LinphoneConference *obj, bool_t val); bool_t linphone_conference_microphone_is_muted(const LinphoneConference *obj); float linphone_conference_get_input_volume(const LinphoneConference *obj); -LINPHONE_PUBLIC int linphone_conference_get_participant_count(const LinphoneConference *obj); +LINPHONE_PUBLIC int linphone_conference_get_size(const LinphoneConference *obj); LINPHONE_PUBLIC MSList *linphone_conference_get_participants(const LinphoneConference *obj); int linphone_conference_start_recording(LinphoneConference *obj, const char *path); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 78ce379fd..086a55350 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7491,7 +7491,7 @@ bool_t linphone_core_is_in_conference(const LinphoneCore *lc) { } int linphone_core_get_conference_size(LinphoneCore *lc) { - if(lc->conf_ctx) return linphone_conference_get_participant_count(lc->conf_ctx); + if(lc->conf_ctx) return linphone_conference_get_size(lc->conf_ctx); return 0; } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index df19a5398..3c334be22 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -3898,9 +3898,10 @@ LINPHONE_PUBLIC float linphone_core_get_conference_local_input_volume(LinphoneCo */ LINPHONE_PUBLIC int linphone_core_terminate_conference(LinphoneCore *lc); /** - * Get the number of remote participant in the running conference + * Get the number of participant in the running conference. The local + * participant is included in the count only if it is in the conference. * @param lc #LinphoneCore - * @return The number of remote participant + * @return The number of participant */ LINPHONE_PUBLIC int linphone_core_get_conference_size(LinphoneCore *lc); /** diff --git a/tester/multi_call_tester.c b/tester/multi_call_tester.c index 4e20d721b..bd4fc2d9d 100644 --- a/tester/multi_call_tester.c +++ b/tester/multi_call_tester.c @@ -262,8 +262,8 @@ static void simple_conference_base(LinphoneCoreManager* marie, LinphoneCoreManag BC_ASSERT_PTR_NOT_NULL(conference = linphone_core_get_conference(marie->lc)); if(conference) { MSList *participants = linphone_conference_get_participants(conference); - BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), linphone_core_get_conference_size(marie->lc), int, "%d"); - BC_ASSERT_EQUAL(linphone_conference_get_participant_count(conference), ms_list_size(participants)+(linphone_conference_is_in(conference)?1:0), int, "%d"); + BC_ASSERT_EQUAL(linphone_conference_get_size(conference), linphone_core_get_conference_size(marie->lc), int, "%d"); + BC_ASSERT_EQUAL(linphone_conference_get_size(conference), ms_list_size(participants)+(linphone_conference_is_in(conference)?1:0), int, "%d"); BC_ASSERT_TRUE(linphone_conference_is_in(conference)); ms_list_free_with_data(participants, (void(*)(void *))linphone_address_destroy); } From 2130afe5f90108d9885af79c25c3ce506ce6f7b5 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Mon, 11 Jan 2016 16:51:06 +0100 Subject: [PATCH 09/16] Fixing bug in SDP RTP port when all audio codecs are disabled in a call. In this case, now the RTP port is set to 0 and the audio stream is inactive. --- coreapi/linphonecall.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index a13c65237..1eff5f2da 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -708,6 +708,16 @@ void linphone_call_make_local_media_description(LinphoneCall *call) { md->custom_sdp_attributes = sal_custom_sdp_attribute_clone(params->custom_sdp_attributes); /*set audio capabilities */ + + codec_hints.bandwidth_limit=params->audio_bw; + codec_hints.max_codecs=-1; + codec_hints.previously_used=old_md ? old_md->streams[call->main_audio_stream_index].already_assigned_payloads : NULL; + l=make_codec_list(lc, &codec_hints, SalAudio, lc->codecs_conf.audio_codecs); + + // in case where no audio codec was found for this stream, the audio is disabled + if (l == NULL) { + params->has_audio = FALSE; + } if (params->has_audio) { strncpy(md->streams[call->main_audio_stream_index].rtp_addr,linphone_call_get_public_ip_for_stream(call,call->main_audio_stream_index),sizeof(md->streams[call->main_audio_stream_index].rtp_addr)); strncpy(md->streams[call->main_audio_stream_index].rtcp_addr,linphone_call_get_public_ip_for_stream(call,call->main_audio_stream_index),sizeof(md->streams[call->main_audio_stream_index].rtcp_addr)); @@ -722,10 +732,6 @@ void linphone_call_make_local_media_description(LinphoneCall *call) { md->streams[call->main_audio_stream_index].ptime=params->down_ptime; else md->streams[call->main_audio_stream_index].ptime=linphone_core_get_download_ptime(lc); - codec_hints.bandwidth_limit=params->audio_bw; - codec_hints.max_codecs=-1; - codec_hints.previously_used=old_md ? old_md->streams[call->main_audio_stream_index].already_assigned_payloads : NULL; - l=make_codec_list(lc, &codec_hints, SalAudio, lc->codecs_conf.audio_codecs); md->streams[call->main_audio_stream_index].max_rate=get_max_codec_sample_rate(l); md->streams[call->main_audio_stream_index].payloads=l; if (call->audiostream && call->audiostream->ms.sessions.rtp_session) { From 1cbc8ceefc0127300dca1d7082b3db083fc42ad7 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 12 Jan 2016 08:38:26 +0100 Subject: [PATCH 10/16] add more offer/answer tests to also check video call --- coreapi/friendlist.c | 5 +- tester/offeranswer_tester.c | 203 +++++++++++++++++++++++++++++++----- 2 files changed, 179 insertions(+), 29 deletions(-) diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index ab669dc41..3f8f98ff3 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -305,7 +305,10 @@ void linphone_friend_list_set_rls_uri(LinphoneFriendList *list, const char *rls_ LinphoneFriendListStatus linphone_friend_list_add_friend(LinphoneFriendList *list, LinphoneFriend *friend) { if (friend->uri == NULL || friend->in_list) { - ms_error("linphone_friend_list_add_friend(): invalid friend"); + if (!friend->uri) + ms_error("linphone_friend_list_add_friend(): invalid friend, no sip uri"); + if (friend->in_list) + ms_error("linphone_friend_list_add_friend(): invalid friend, already in list"); return LinphoneFriendListInvalidFriend; } if (ms_list_find(list->friends, friend) != NULL) { diff --git a/tester/offeranswer_tester.c b/tester/offeranswer_tester.c index bca89abdd..e40849aff 100644 --- a/tester/offeranswer_tester.c +++ b/tester/offeranswer_tester.c @@ -131,19 +131,25 @@ static void call_failed_because_of_codecs(void) { } -static void profile_call_base(bool_t avpf1, LinphoneMediaEncryption srtp1,bool_t avpf2, LinphoneMediaEncryption srtp2, bool_t encryption_mandatory, const char *expected_profile) { +static void profile_call_base(bool_t avpf1 + , LinphoneMediaEncryption srtp1 + , bool_t avpf2 + , LinphoneMediaEncryption srtp2 + , bool_t encryption_mandatory + , const char *expected_profile + , bool_t enable_video) { LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_tcp_rc"); LinphoneProxyConfig *lpc; const LinphoneCallParams *params; if (avpf1) { - linphone_core_get_default_proxy(marie->lc, &lpc); + lpc = linphone_core_get_default_proxy_config(marie->lc); linphone_proxy_config_enable_avpf(lpc, TRUE); linphone_proxy_config_set_avpf_rr_interval(lpc, 3); } if (avpf2) { - linphone_core_get_default_proxy(pauline->lc, &lpc); + lpc = linphone_core_get_default_proxy_config(pauline->lc); linphone_proxy_config_enable_avpf(lpc, TRUE); linphone_proxy_config_set_avpf_rr_interval(lpc, 3); } @@ -152,6 +158,18 @@ static void profile_call_base(bool_t avpf1, LinphoneMediaEncryption srtp1,bool_t linphone_core_set_media_encryption_mandatory(marie->lc,TRUE); linphone_core_set_media_encryption_mandatory(pauline->lc,TRUE); } + + if (enable_video && linphone_core_video_supported(marie->lc)) { + LinphoneVideoPolicy policy; + policy.automatically_accept = TRUE; + policy.automatically_initiate = TRUE; + linphone_core_enable_video_capture(marie->lc, TRUE); + linphone_core_enable_video_display(marie->lc, TRUE); + linphone_core_set_video_policy(marie->lc,&policy); + linphone_core_enable_video_capture(pauline->lc, TRUE); + linphone_core_enable_video_display(pauline->lc, TRUE); + linphone_core_set_video_policy(pauline->lc,&policy); + } if (linphone_core_media_encryption_supported(marie->lc, srtp1)) { linphone_core_set_media_encryption(marie->lc, srtp1); @@ -190,90 +208,197 @@ end: linphone_core_manager_destroy(marie); } -static void profile_call(bool_t avpf1, LinphoneMediaEncryption srtp1, bool_t avpf2, LinphoneMediaEncryption srtp2, const char *expected_profile) { - profile_call_base(avpf1, srtp1, avpf2,srtp2,FALSE,expected_profile); +static void profile_call(bool_t avpf1, LinphoneMediaEncryption srtp1, bool_t avpf2, LinphoneMediaEncryption srtp2, const char *expected_profile, bool_t enable_video) { + profile_call_base(avpf1, srtp1, avpf2,srtp2,FALSE,expected_profile,enable_video); } + static void avp_to_avp_call(void) { - profile_call(FALSE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionNone, "RTP/AVP"); + profile_call(FALSE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionNone, "RTP/AVP", FALSE); } +#ifdef VIDEO_ENABLED +static void avp_to_avp_video_call(void) { + profile_call(FALSE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionNone, "RTP/AVP", TRUE); +} +#endif static void avp_to_avpf_call(void) { - profile_call(FALSE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionNone, "RTP/AVP"); + profile_call(FALSE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionNone, "RTP/AVP",FALSE); } +#ifdef VIDEO_ENABLED +static void avp_to_avpf_video_call(void) { + profile_call(FALSE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionNone, "RTP/AVP",TRUE); +} +#endif static void avp_to_savp_call(void) { - profile_call(FALSE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionSRTP, "RTP/AVP"); + profile_call(FALSE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionSRTP, "RTP/AVP", FALSE); } +#ifdef VIDEO_ENABLED +static void avp_to_savp_video_call(void) { + profile_call(FALSE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionSRTP, "RTP/AVP", TRUE); +} +#endif static void avp_to_savpf_call(void) { - profile_call(FALSE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionSRTP, "RTP/AVP"); + profile_call(FALSE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionSRTP, "RTP/AVP", FALSE); } +#ifdef VIDEO_ENABLED +static void avp_to_savpf_video_call(void) { + profile_call(FALSE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionSRTP, "RTP/AVP", TRUE); +} +#endif static void avpf_to_avp_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionNone, "RTP/AVPF"); + profile_call(TRUE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionNone, "RTP/AVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void avpf_to_avp_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionNone, "RTP/AVPF", TRUE); +} +#endif static void avpf_to_avpf_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionNone, "RTP/AVPF"); + profile_call(TRUE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionNone, "RTP/AVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void avpf_to_avpf_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionNone, "RTP/AVPF", TRUE); +} +#endif static void avpf_to_savp_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionSRTP, "RTP/AVPF"); + profile_call(TRUE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionSRTP, "RTP/AVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void avpf_to_savp_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionNone, FALSE, LinphoneMediaEncryptionSRTP, "RTP/AVPF", TRUE); +} +#endif static void avpf_to_savpf_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionSRTP, "RTP/AVPF"); + profile_call(TRUE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionSRTP, "RTP/AVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void avpf_to_savpf_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionNone, TRUE, LinphoneMediaEncryptionSRTP, "RTP/AVPF", TRUE); +} +#endif static void savp_to_avp_call(void) { - profile_call(FALSE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionNone, "RTP/SAVP"); + profile_call(FALSE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionNone, "RTP/SAVP", FALSE); } +#ifdef VIDEO_ENABLED +static void savp_to_avp_video_call(void) { + profile_call(FALSE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionNone, "RTP/SAVP", TRUE); +} +#endif static void savp_to_avpf_call(void) { - profile_call(FALSE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionNone, "RTP/SAVP"); + profile_call(FALSE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionNone, "RTP/SAVP", FALSE); } +#ifdef VIDEO_ENABLED +static void savp_to_avpf_video_call(void) { + profile_call(FALSE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionNone, "RTP/SAVP", TRUE); +} +#endif static void savp_to_savp_call(void) { - profile_call(FALSE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionSRTP, "RTP/SAVP"); + profile_call(FALSE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionSRTP, "RTP/SAVP", FALSE); } +#ifdef VIDEO_ENABLED +static void savp_to_savp_video_call(void) { + profile_call(FALSE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionSRTP, "RTP/SAVP", TRUE); +} +#endif static void savp_to_savpf_call(void) { - profile_call(FALSE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionSRTP, "RTP/SAVP"); + profile_call(FALSE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionSRTP, "RTP/SAVP", FALSE); } +#ifdef VIDEO_ENABLED +static void savp_to_savpf_video_call(void) { + profile_call(FALSE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionSRTP, "RTP/SAVP", TRUE); +} +#endif static void savpf_to_avp_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionNone, "RTP/SAVPF"); + profile_call(TRUE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionNone, "RTP/SAVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void savpf_to_avp_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionNone, "RTP/SAVPF", TRUE); +} +#endif static void savpf_to_avpf_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionNone, "RTP/SAVPF"); + profile_call(TRUE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionNone, "RTP/SAVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void savpf_to_avpf_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionNone, "RTP/SAVPF", TRUE); +} +#endif static void savpf_to_savp_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionSRTP, "RTP/SAVPF"); + profile_call(TRUE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionSRTP, "RTP/SAVPF", FALSE); } - +#ifdef VIDEO_ENABLED +static void savpf_to_savp_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionSRTP, FALSE, LinphoneMediaEncryptionSRTP, "RTP/SAVPF", TRUE); +} +#endif static void savpf_to_savpf_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionSRTP, "RTP/SAVPF"); + profile_call(TRUE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionSRTP, "RTP/SAVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void savpf_to_savpf_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionSRTP, TRUE, LinphoneMediaEncryptionSRTP, "RTP/SAVPF", TRUE); +} +#endif static void savpf_dtls_to_savpf_dtls_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionDTLS, "UDP/TLS/RTP/SAVPF"); + profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionDTLS, "UDP/TLS/RTP/SAVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void savpf_dtls_to_savpf_dtls_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionDTLS, "UDP/TLS/RTP/SAVPF", TRUE); +} +#endif + static void savpf_dtls_to_savpf_dtls_encryption_mandatory_call(void) { - profile_call_base(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionDTLS, TRUE, "UDP/TLS/RTP/SAVPF"); + profile_call_base(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionDTLS, TRUE, "UDP/TLS/RTP/SAVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void savpf_dtls_to_savpf_dtls_encryption_mandatory_video_call(void) { + profile_call_base(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionDTLS, TRUE, "UDP/TLS/RTP/SAVPF", TRUE); +} +#endif + static void savpf_dtls_to_savpf_encryption_mandatory_call(void) { - /*profile_call_base(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionSRTP, TRUE, "UDP/TLS/RTP/SAVPF"); not sure of result*/ + /*profile_call_base(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionSRTP, TRUE, "UDP/TLS/RTP/SAVPF",FALSE); not sure of result*/ } +#ifdef VIDEO_ENABLED +static void savpf_dtls_to_savpf_encryption_mandatory_video_call(void) { + /*profile_call_base(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionSRTP, TRUE, "UDP/TLS/RTP/SAVPF",TRUE); not sure of result*/ +} +#endif static void savpf_dtls_to_savpf_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionSRTP, "UDP/TLS/RTP/SAVPF"); + profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionSRTP, "UDP/TLS/RTP/SAVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void savpf_dtls_to_savpf_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionSRTP, "UDP/TLS/RTP/SAVPF", TRUE); +} +#endif static void savpf_dtls_to_avpf_call(void) { - profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionNone, "UDP/TLS/RTP/SAVPF"); + profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionNone, "UDP/TLS/RTP/SAVPF", FALSE); } +#ifdef VIDEO_ENABLED +static void savpf_dtls_to_avpf_video_call(void) { + profile_call(TRUE, LinphoneMediaEncryptionDTLS, TRUE, LinphoneMediaEncryptionNone, "UDP/TLS/RTP/SAVPF", TRUE); +} +#endif #ifdef VIDEO_ENABLED static LinphonePayloadType * configure_core_for_avpf_and_video(LinphoneCore *lc) { @@ -283,7 +408,7 @@ static LinphonePayloadType * configure_core_for_avpf_and_video(LinphoneCore *lc) policy.automatically_initiate = TRUE; policy.automatically_accept = TRUE; - linphone_core_get_default_proxy(lc, &lpc); + lpc = linphone_core_get_default_proxy_config(lc); linphone_proxy_config_enable_avpf(lpc, TRUE); linphone_proxy_config_set_avpf_rr_interval(lpc, 3); linphone_core_set_video_device(lc, "StaticImage: Static picture"); @@ -389,6 +514,28 @@ static test_t offeranswer_tests[] = { { "SAVPF/DTLS to SAVPF encryption mandatory call", savpf_dtls_to_savpf_encryption_mandatory_call}, { "SAVPF/DTLS to AVPF call", savpf_dtls_to_avpf_call}, #ifdef VIDEO_ENABLED + { "AVP to AVP video call", avp_to_avp_video_call }, + { "AVP to AVPF video call", avp_to_avpf_video_call }, + { "AVP to SAVP video call", avp_to_savp_video_call }, + { "AVP to SAVPF video call", avp_to_savpf_video_call }, + { "AVPF to AVP video call", avpf_to_avp_video_call }, + { "AVPF to AVPF video call", avpf_to_avpf_video_call }, + { "AVPF to SAVP video call", avpf_to_savp_video_call }, + { "AVPF to SAVPF video call", avpf_to_savpf_video_call }, + { "SAVP to AVP video call", savp_to_avp_video_call }, + { "SAVP to AVPF video call", savp_to_avpf_video_call }, + { "SAVP to SAVP video call", savp_to_savp_video_call }, + { "SAVP to SAVPF video call", savp_to_savpf_video_call }, + { "SAVPF to AVP video call", savpf_to_avp_video_call }, + { "SAVPF to AVPF video call", savpf_to_avpf_video_call }, + { "SAVPF to SAVP video call", savpf_to_savp_video_call }, + { "SAVPF to SAVPF video call", savpf_to_savpf_video_call }, + { "SAVPF/DTLS to SAVPF/DTLS video call", savpf_dtls_to_savpf_dtls_video_call}, + { "SAVPF/DTLS to SAVPF/DTLS encryption mandatory video call", savpf_dtls_to_savpf_dtls_encryption_mandatory_video_call}, + { "SAVPF/DTLS to SAVPF video call", savpf_dtls_to_savpf_video_call}, + { "SAVPF/DTLS to SAVPF encryption mandatory video call", savpf_dtls_to_savpf_encryption_mandatory_video_call}, + { "SAVPF/DTLS to AVPF call", savpf_dtls_to_avpf_video_call}, + { "Compatible AVPF features", compatible_avpf_features }, { "Incompatible AVPF features", incompatible_avpf_features }, #endif From e5d25f028d43c34c5d434cad31ebb7050bde33fb Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 12 Jan 2016 10:18:31 +0100 Subject: [PATCH 11/16] Fix build of tester on Windows. --- coreapi/conference.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/conference.h b/coreapi/conference.h index 1086920c2..6192850a3 100644 --- a/coreapi/conference.h +++ b/coreapi/conference.h @@ -50,7 +50,7 @@ int linphone_conference_terminate(LinphoneConference *obj); int linphone_conference_enter(LinphoneConference *obj); int linphone_conference_leave(LinphoneConference *obj); -bool_t linphone_conference_is_in(const LinphoneConference *obj); +LINPHONE_PUBLIC bool_t linphone_conference_is_in(const LinphoneConference *obj); AudioStream *linphone_conference_get_audio_stream(const LinphoneConference *obj); int linphone_conference_mute_microphone(LinphoneConference *obj, bool_t val); From 9b216dadc9bfbaf6611e262b3a8c4def4f5bd709 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 12 Jan 2016 10:30:24 +0100 Subject: [PATCH 12/16] Attempt to fix build on some platforms (because of some missing md5 functions). --- coreapi/friendlist.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index 3f8f98ff3..f65b71973 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -393,9 +393,7 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon if ((address != NULL) && (xml_content != NULL) && (linphone_friend_list_has_subscribe_inactive(list) == TRUE)) { md5_context ctx; unsigned char digest[16]; - md5_init(&ctx); - md5_update(&ctx, (unsigned char *)xml_content, strlen(xml_content)); - md5_finish(&ctx, digest); + md5((unsigned char *)xml_content, strlen(xml_content), digest); if ((list->event != NULL) && (list->content_digest != NULL) && (memcmp(list->content_digest, digest, sizeof(digest)) == 0)) { /* The content has not changed, only refresh the event. */ linphone_event_refresh_subscribe(list->event); From 207dddc8e1824cf47f6f636120a4f8858ab2132b Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 12 Jan 2016 10:38:25 +0100 Subject: [PATCH 13/16] Remove unused variable. --- coreapi/friendlist.c | 1 - 1 file changed, 1 deletion(-) diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index f65b71973..22b9fc0e8 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -391,7 +391,6 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon LinphoneAddress *address = linphone_address_new(list->rls_uri); char *xml_content = create_resource_list_xml(list); if ((address != NULL) && (xml_content != NULL) && (linphone_friend_list_has_subscribe_inactive(list) == TRUE)) { - md5_context ctx; unsigned char digest[16]; md5((unsigned char *)xml_content, strlen(xml_content), digest); if ((list->event != NULL) && (list->content_digest != NULL) && (memcmp(list->content_digest, digest, sizeof(digest)) == 0)) { From 819a1f7dc0b10285a168bdd2f652dc47fc21caae Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 12 Jan 2016 10:38:51 +0100 Subject: [PATCH 14/16] Fix tests with custom RTP modifiers that fail sometimes --- tester/call_tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index f87c1d290..cae7ccaa6 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -5264,7 +5264,7 @@ static void custom_rtp_modifier(bool_t pauseResumeTest, bool_t recordTest) { ms_message("Pauline sent %i RTP packets and received %i (through our modifier)", (int)data_pauline->packetSentCount, (int)data_pauline->packetReceivedCount); // There will be a few RTP packets sent on marie's side before the call is ended at pauline's request, so we need the threshold BC_ASSERT_TRUE(data_marie->packetSentCount - data_pauline->packetReceivedCount < 50); - BC_ASSERT_TRUE(data_marie->packetReceivedCount == data_pauline->packetSentCount); + BC_ASSERT_TRUE(data_pauline->packetSentCount - data_marie->packetReceivedCount < 50); // At this point, we know each packet that has been processed in the send callback of our RTP modifier also go through the recv callback of the remote. // Now we want to ensure that all sent RTP packets actually go through our RTP transport modifier and thus no packet leave without being processed (by any operation we might want to do on it) From 56e8d7dd49ea05e947d62571a85923fa475427de Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 12 Jan 2016 14:34:06 +0100 Subject: [PATCH 15/16] Fixed rcs to external body tester --- tester/flexisip_tester.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index 9ec983a2c..1b07883b2 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -723,7 +723,6 @@ static void call_with_ipv6(void) { static void file_transfer_message_rcs_to_external_body_client(void) { if (transport_supported(LinphoneTransportTls)) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneChatRoom* chat_room; LinphoneChatMessage* message; LinphoneChatMessageCbs *cbs; @@ -732,13 +731,19 @@ static void file_transfer_message_rcs_to_external_body_client(void) { size_t file_size; char *send_filepath = bc_tester_res("images/nowebcamCIF.jpg"); char *receive_filepath = bc_tester_file("receive_file.dump"); - LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); + LinphoneCoreManager* marie = linphone_core_manager_new2( "marie_rc", FALSE); + LinphoneCoreManager* pauline = linphone_core_manager_new2( "pauline_rc", FALSE); + // This is done to prevent register to be sent before the custom header is set + linphone_core_set_network_reachable(marie->lc, FALSE); + linphone_core_set_network_reachable(pauline->lc, FALSE); linphone_proxy_config_set_custom_header(marie->lc->default_proxy, "Accept", "application/sdp"); linphone_core_manager_start(marie, TRUE); + linphone_core_set_network_reachable(pauline->lc, TRUE); linphone_proxy_config_set_custom_header(pauline->lc->default_proxy, "Accept", "application/sdp, text/plain, application/vnd.gsma.rcs-ft-http+xml"); linphone_core_manager_start(pauline, TRUE); + linphone_core_set_network_reachable(pauline->lc, TRUE); reset_counters(&marie->stat); reset_counters(&pauline->stat); From 78eebfb9ad8a841665a539258aa674c5f44b265b Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 12 Jan 2016 14:35:35 +0100 Subject: [PATCH 16/16] Fixed typo --- tester/flexisip_tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index 1b07883b2..c77655532 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -739,7 +739,7 @@ static void file_transfer_message_rcs_to_external_body_client(void) { linphone_proxy_config_set_custom_header(marie->lc->default_proxy, "Accept", "application/sdp"); linphone_core_manager_start(marie, TRUE); - linphone_core_set_network_reachable(pauline->lc, TRUE); + linphone_core_set_network_reachable(marie->lc, TRUE); linphone_proxy_config_set_custom_header(pauline->lc->default_proxy, "Accept", "application/sdp, text/plain, application/vnd.gsma.rcs-ft-http+xml"); linphone_core_manager_start(pauline, TRUE);