From 24a208100a173d1b769e830c26f89bd7d2d7df8e Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 12 May 2014 12:41:32 +0200 Subject: [PATCH] * notify friend status to offline when network goes unreachable * relax timeouts of tests again * always install linphone_tunnel.h --- coreapi/Makefile.am | 10 +++------- coreapi/friend.c | 8 ++++++++ tester/call_tester.c | 2 +- tester/flexisip_tester.c | 8 ++++---- tester/tester.c | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index 0beea01a4..e2db1d2c1 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -18,11 +18,7 @@ CLEANFILES=$(GITVERSION_FILE) ## Process this file with automake to produce Makefile.in linphone_includedir=$(includedir)/linphone -linphone_include_HEADERS=linphonecore.h linphonefriend.h linphonepresence.h linphonecore_utils.h lpconfig.h sipsetup.h event.h xml2lpc.h lpc2xml.h - -if BUILD_TUNNEL -linphone_include_HEADERS+=linphone_tunnel.h -endif +linphone_include_HEADERS=linphonecore.h linphonefriend.h linphonepresence.h linphonecore_utils.h lpconfig.h sipsetup.h event.h xml2lpc.h lpc2xml.h linphone_tunnel.h lib_LTLIBRARIES=liblinphone.la @@ -82,9 +78,9 @@ endif liblinphone_la_SOURCES+=linphone_tunnel_config.c if BUILD_TUNNEL -liblinphone_la_SOURCES+=linphone_tunnel.cc TunnelManager.cc TunnelManager.hh +liblinphone_la_SOURCES+=linphone_tunnel.cc TunnelManager.cc TunnelManager.hh linphone_tunnel.h else -liblinphone_la_SOURCES+=linphone_tunnel_stubs.c +liblinphone_la_SOURCES+=linphone_tunnel_stubs.c linphone_tunnel.h endif diff --git a/coreapi/friend.c b/coreapi/friend.c index a287b7e90..7b0ddd816 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -244,9 +244,17 @@ static void linphone_friend_unsubscribe(LinphoneFriend *lf){ static void linphone_friend_invalidate_subscription(LinphoneFriend *lf){ if (lf->outsub!=NULL) { + LinphoneCore *lc=lf->lc; sal_op_release(lf->outsub); lf->outsub=NULL; lf->subscribe_active=FALSE; + /*notify application that we no longer know the presence activity */ + if (lf->presence != NULL) { + linphone_presence_model_unref(lf->presence); + } + lf->presence = linphone_presence_model_new_with_activity(LinphonePresenceActivityOffline,"unknown activity"); + if (lc->vtable.notify_presence_received) + lc->vtable.notify_presence_received(lc,lf); } lf->initial_subscribes_sent=FALSE; } diff --git a/tester/call_tester.c b/tester/call_tester.c index 1fd301fb4..fb9571205 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -1347,7 +1347,7 @@ static void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t e CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallEnd,1)); CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallEnd,1)); } else { - ms_warning ("not tested because srtp not available"); + ms_warning ("not tested because %s not available", linphone_media_encryption_to_string(mode)); } linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index e295b61eb..89c2dfe4b 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -569,8 +569,8 @@ static void early_media_call_forking(void) { linphone_call_params_destroy(params); CU_ASSERT_TRUE(wait_for_list(lcs, &marie1->stat.number_of_LinphoneCallIncomingEarlyMedia,1,3000)); - CU_ASSERT_TRUE(wait_for_list(lcs, &marie2->stat.number_of_LinphoneCallIncomingEarlyMedia,1,1000)); - CU_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallOutgoingEarlyMedia,1,1000)); + CU_ASSERT_TRUE(wait_for_list(lcs, &marie2->stat.number_of_LinphoneCallIncomingEarlyMedia,1,3000)); + CU_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallOutgoingEarlyMedia,1,3000)); pauline_call=linphone_core_get_current_call(pauline->lc); marie1_call=linphone_core_get_current_call(marie1->lc); @@ -583,8 +583,8 @@ static void early_media_call_forking(void) { CU_ASSERT_TRUE(linphone_call_get_audio_stats(marie2_call)->download_bandwidth>70); linphone_core_accept_call(marie1->lc,linphone_core_get_current_call(marie1->lc)); - CU_ASSERT_TRUE(wait_for_list(lcs,&marie1->stat.number_of_LinphoneCallStreamsRunning,1,1000)); - CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + CU_ASSERT_TRUE(wait_for_list(lcs,&marie1->stat.number_of_LinphoneCallStreamsRunning,1,3000)); + CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,3000)); /*marie2 should get her call terminated*/ CU_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallEnd,1,1000)); diff --git a/tester/tester.c b/tester/tester.c index 2d734b074..3623073e4 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -141,7 +141,7 @@ bool_t wait_for_until(LinphoneCore* lc_1, LinphoneCore* lc_2,int* counter,int va } bool_t wait_for(LinphoneCore* lc_1, LinphoneCore* lc_2,int* counter,int value) { - return wait_for_until(lc_1, lc_2,counter,value,3000); + return wait_for_until(lc_1, lc_2,counter,value,10000); } bool_t wait_for_list(MSList* lcs,int* counter,int value,int timeout_ms) {