From 11354f2cf6aab3640e584bf00cfea3192d787d62 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 14 Sep 2017 21:08:59 +0200 Subject: [PATCH 1/6] fix crash in linphonecsh --- console/shell.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/console/shell.c b/console/shell.c index f80a15378..8cf1d6c09 100644 --- a/console/shell.c +++ b/console/shell.c @@ -156,11 +156,11 @@ static char *argv_to_line(int argc, char *argv[]) { } #endif -#define MAX_ARGS 10 +#define MAX_ARGS 20 #ifndef _WIN32 static void spawn_linphonec(int argc, char *argv[]){ - char * args[MAX_ARGS]; + char * args[MAX_ARGS+1]; int i,j; pid_t pid; j=0; @@ -168,10 +168,10 @@ static void spawn_linphonec(int argc, char *argv[]){ args[j++]="--pipe"; args[j++]="-c"; args[j++]="/dev/null"; - for(i=0;i Date: Thu, 14 Sep 2017 21:16:05 +0200 Subject: [PATCH 2/6] fix crash in linphonec --- console/linphonec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/linphonec.c b/console/linphonec.c index ca556536b..b786288b4 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -975,7 +975,7 @@ linphonec_idle_call () linphone_core_iterate(opm); if (answer_call){ fprintf (stdout, "-------auto answering to call-------\n" ); - linphone_core_accept_call(opm,NULL); + linphone_core_accept_call(opm, linphone_core_get_current_call(opm)); answer_call=FALSE; } /* auto call handling */ From 533f47c7a9cb04651a24ce589566cac09ac8218c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 19 Mar 2018 16:24:20 +0100 Subject: [PATCH 3/6] Indicate mediastreamer2 a maximum output bitrate, so that rate control algorithm can use it. --- src/conference/session/media-session.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index c240343f7..d4a4c873f 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -2660,7 +2660,7 @@ void MediaSessionPrivate::startAudioStream (CallSession::State targetState, bool if (playcard) { ms_snd_card_set_stream_type(playcard, MS_SND_CARD_STREAM_VOICE); } - + media_stream_set_max_network_bitrate(&audioStream->ms, linphone_core_get_upload_bandwidth(q->getCore()->getCCore()) * 1000); bool useEc = captcard && linphone_core_echo_cancellation_enabled(q->getCore()->getCCore()); audio_stream_enable_echo_canceller(audioStream, useEc); if (playcard && (stream->max_rate > 0)) @@ -2899,6 +2899,7 @@ void MediaSessionPrivate::startVideoStream (CallSession::State targetState) { getCurrentParams()->getPrivate()->setUsedVideoCodec(rtp_profile_get_payload(videoProfile, usedPt)); getCurrentParams()->enableVideo(true); rtp_session_enable_rtcp_mux(videoStream->ms.sessions.rtp_session, vstream->rtcp_mux); + media_stream_set_max_network_bitrate(&videoStream->ms, linphone_core_get_upload_bandwidth(q->getCore()->getCCore()) * 1000); if (q->getCore()->getCCore()->video_conf.preview_vsize.width != 0) video_stream_set_preview_size(videoStream, q->getCore()->getCCore()->video_conf.preview_vsize); video_stream_set_fps(videoStream, linphone_core_get_preferred_framerate(q->getCore()->getCCore())); From 174f5f570a9bfd43d3b946c3379f851ad736b1ea Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 19 Mar 2018 16:35:05 +0100 Subject: [PATCH 4/6] fix compilation issue --- tester/presence_tester.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/tester/presence_tester.c b/tester/presence_tester.c index 67a35c0be..18a29902b 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -211,40 +211,6 @@ static void subscribe_failure_handle_by_app(void) { linphone_core_manager_destroy(pauline); } -static void publish_with_network_state_changes(void) { - LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); - LinphoneProxyConfig* proxy; - LinphoneCoreCbs *cbs = linphone_factory_create_core_cbs(linphone_factory_get()); - - linphone_core_cbs_set_publish_state_changed(cbs, linphone_publish_state_changed); - _linphone_core_add_callbacks(marie->lc, cbs,TRUE); - linphone_core_cbs_unref(cbs); - - proxy = linphone_core_get_default_proxy_config(marie->lc); - linphone_proxy_config_edit(proxy); - linphone_proxy_config_enable_publish(proxy,TRUE); - linphone_proxy_config_done(proxy); - - BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,1)); - BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,1)); - - linphone_core_set_network_reachable(marie->lc, FALSE); - BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneRegistrationNone,1)); - BC_ASSERT_FALSE(wait_for_until(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,2,1000)); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,1,int,"%i"); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishError,0,int,"%i"); - - linphone_core_set_network_reachable(marie->lc, TRUE); - BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishProgress,2)); - BC_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphonePublishOk,2)); - - - linphone_core_manager_stop(marie); - BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishCleared,1,int,"%i"); /*yes it is 3 because when we change the expires, a new LinphoneEvent is created*/ - BC_ASSERT_EQUAL(marie->stat.number_of_LinphonePublishOk,2,int,"%i"); - linphone_core_manager_destroy(marie); -} - static void simple_subscribe(void) { LinphoneCoreManager* marie = presence_linphone_core_manager_new("marie"); LinphoneCoreManager* pauline = presence_linphone_core_manager_new("pauline"); From 4eb83a7b82b6dc9d474ca2901c0b37f75cfe185a Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 19 Mar 2018 16:41:06 +0100 Subject: [PATCH 5/6] remove LeaksMemory from tester presence/App managed presence failure --- tester/presence_tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/presence_tester.c b/tester/presence_tester.c index 18a29902b..2eb4c931d 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -514,7 +514,7 @@ test_t presence_tests[] = { /*TEST_ONE_TAG("Call with presence", call_with_presence, "LeaksMemory"),*/ TEST_NO_TAG("Unsubscribe while subscribing", unsubscribe_while_subscribing), TEST_NO_TAG("Presence information", presence_information), - TEST_ONE_TAG("App managed presence failure", subscribe_failure_handle_by_app, "LeaksMemory"), + TEST_ONE_TAG("App managed presence failure", subscribe_failure_handle_by_app,"presence"), TEST_NO_TAG("Presence SUBSCRIBE forked", subscribe_presence_forked), TEST_NO_TAG("Presence SUBSCRIBE expired", subscribe_presence_expired), }; From 29f9de93a30c6f7278ae4c0356fa7a4303832c2c Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Mon, 18 Sep 2017 10:47:59 +0200 Subject: [PATCH 6/6] Fix no break error in proxy.c --- coreapi/proxy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index e9a3641a4..03213da1e 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -20,6 +20,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org) #include +#include #include "linphone/core_utils.h" #include "linphone/core.h" #include "linphone/lpconfig.h" @@ -1545,11 +1546,12 @@ void linphone_proxy_config_set_nat_policy(LinphoneProxyConfig *cfg, LinphoneNatP } void linphone_proxy_config_notify_publish_state_changed(LinphoneProxyConfig *cfg, LinphonePublishState state) { - + if (cfg->presence_publish_event != NULL) { switch (state) { case LinphonePublishCleared: linphone_proxy_config_set_etag(cfg,NULL); + BCTBX_NO_BREAK; case LinphonePublishError: linphone_event_unref(cfg->presence_publish_event); cfg->presence_publish_event = NULL; @@ -1559,7 +1561,7 @@ void linphone_proxy_config_notify_publish_state_changed(LinphoneProxyConfig *cfg break; default: break; - + } } }