From f8a1eeff3773f82b3df65b77856e48b698f70758 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 25 Jan 2016 14:47:05 +0100 Subject: [PATCH 01/18] fix uninstalled ringtoneplayer.h --- coreapi/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index 27100c6f5..f28da48a9 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -35,6 +35,7 @@ linphone_include_HEADERS=\ friendlist.h \ linphonecore.h \ linphonecore_utils.h \ + ringtoneplayer.h \ linphonefriend.h \ linphonepresence.h \ linphone_proxy_config.h \ From 93f7cbd86ffd15ca45d7d26f3da1f2276a4a5ea3 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 25 Jan 2016 17:13:48 +0100 Subject: [PATCH 02/18] fix ice restart tests --- coreapi/callbacks.c | 11 +++++---- coreapi/linphonecall.c | 9 ++++---- coreapi/misc.c | 13 +++++------ coreapi/private.h | 2 +- mediastreamer2 | 2 +- oRTP | 2 +- tester/call_tester.c | 51 +++++++++++++++++++++++++++++------------- 7 files changed, 56 insertions(+), 34 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index af1cfb919..22af840f4 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -503,10 +503,7 @@ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *o if (call->params->internal_call_update) call->params->internal_call_update = FALSE; - /* Handle remote ICE attributes if any. */ - if (call->ice_session != NULL && rmd) { - linphone_call_update_ice_from_remote_media_description(call, rmd); - } + #ifdef BUILD_UPNP if (call->upnp_session != NULL && rmd) { linphone_core_update_upnp_from_remote_media_description(call, rmd); @@ -522,6 +519,12 @@ static void process_call_accepted(LinphoneCore *lc, LinphoneCall *call, SalOp *o md = NULL; } if (md){ /*there is a valid SDP in the response, either offer or answer, and we're able to start/update the streams*/ + + /* Handle remote ICE attributes if any. */ + if (call->ice_session != NULL && rmd) { + linphone_call_update_ice_from_remote_media_description(call, rmd, FALSE); + } + switch (call->state){ case LinphoneCallResuming: linphone_core_notify_display_status(lc,_("Call resumed.")); diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 52d5e0620..b46038764 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2236,7 +2236,7 @@ int linphone_call_prepare_ice(LinphoneCall *call, bool_t incoming_offer){ if (call->params->realtimetext_enabled) _linphone_call_prepare_ice_for_stream(call,call->main_text_stream_index,TRUE); /*start ICE gathering*/ if (incoming_offer) - linphone_call_update_ice_from_remote_media_description(call,remote); /*this may delete the ice session*/ + linphone_call_update_ice_from_remote_media_description(call, remote, TRUE); /*this may delete the ice session*/ if (call->ice_session && !ice_session_candidates_gathered(call->ice_session)){ if (call->audiostream->ms.state==MSStreamInitialized) audio_stream_prepare_sound(call->audiostream, NULL, NULL); @@ -4309,8 +4309,7 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){ linphone_core_update_ice_state_in_call_stats(call); } } else if (evt == ORTP_EVENT_ICE_RESTART_NEEDED) { - ice_session_restart(call->ice_session); - ice_session_set_role(call->ice_session, IR_Controlling); + ice_session_restart(call->ice_session, IR_Controlling); linphone_core_update_call(call->core, call, call->current_params); } } @@ -4846,6 +4845,7 @@ void linphone_call_repair_if_broken(LinphoneCall *call){ /*First, make sure that the proxy from which we received this call, or to which we routed this call is registered*/ if (!call->dest_proxy || linphone_proxy_config_get_state(call->dest_proxy) != LinphoneRegistrationOk) return; + if (!call->core->media_network_reachable) return; switch (call->state){ case LinphoneCallStreamsRunning: @@ -4853,8 +4853,7 @@ void linphone_call_repair_if_broken(LinphoneCall *call){ case LinphoneCallPausedByRemote: ms_message("LinphoneCall[%p] is going to be updated (reINVITE) in order to recover from lost connectivity", call); if (call->ice_session){ - ice_session_restart(call->ice_session); - ice_session_set_role(call->ice_session, IR_Controlling); + ice_session_restart(call->ice_session, IR_Controlling); } params = linphone_core_create_call_params(call->core, call); linphone_core_update_call(call->core, call, params); diff --git a/coreapi/misc.c b/coreapi/misc.c index df32829dc..9f5fece93 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -944,8 +944,7 @@ void linphone_call_clear_unused_ice_candidates(LinphoneCall *call, const SalMedi } } -void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md) -{ +void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md, bool_t is_offer){ const SalStreamDescription *stream; IceCheckList *cl = NULL; bool_t default_candidate = FALSE; @@ -975,14 +974,14 @@ void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, if (ice_params_found) { /* Check for ICE restart and set remote credentials. */ if ((strcmp(md->addr, "0.0.0.0") == 0) || (strcmp(md->addr, "::0") == 0)) { - ice_session_restart(call->ice_session); + ice_session_restart(call->ice_session, is_offer ? IR_Controlled : IR_Controlling); ice_restarted = TRUE; } else { for (i = 0; i < md->nb_streams; i++) { stream = &md->streams[i]; cl = ice_session_check_list(call->ice_session, i); if (cl && (strcmp(stream->rtp_addr, "0.0.0.0") == 0)) { - ice_session_restart(call->ice_session); + ice_session_restart(call->ice_session, is_offer ? IR_Controlled : IR_Controlling); ice_restarted = TRUE; break; } @@ -992,7 +991,7 @@ void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, ice_session_set_remote_credentials(call->ice_session, md->ice_ufrag, md->ice_pwd); } else if (ice_session_remote_credentials_changed(call->ice_session, md->ice_ufrag, md->ice_pwd)) { if (ice_restarted == FALSE) { - ice_session_restart(call->ice_session); + ice_session_restart(call->ice_session, is_offer ? IR_Controlled : IR_Controlling); ice_restarted = TRUE; } ice_session_set_remote_credentials(call->ice_session, md->ice_ufrag, md->ice_pwd); @@ -1005,8 +1004,8 @@ void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, if (ice_restarted == FALSE && ice_check_list_get_remote_ufrag(cl) && ice_check_list_get_remote_pwd(cl)) { - /* restart onlu if remote ufrag/paswd was already set*/ - ice_session_restart(call->ice_session); + /* restart only if remote ufrag/paswd was already set*/ + ice_session_restart(call->ice_session, is_offer ? IR_Controlled : IR_Controlling); ice_restarted = TRUE; } ice_check_list_set_remote_credentials(cl, stream->ice_ufrag, stream->ice_pwd); diff --git a/coreapi/private.h b/coreapi/private.h index 6f3dfe7ce..8730bb1df 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -487,7 +487,7 @@ void linphone_call_stats_fill(LinphoneCallStats *stats, MediaStream *ms, OrtpEve void linphone_call_stop_ice_for_inactive_streams(LinphoneCall *call, SalMediaDescription *result); void _update_local_media_description_from_ice(SalMediaDescription *desc, IceSession *session, bool_t use_nortpproxy); void linphone_call_update_local_media_description_from_ice_or_upnp(LinphoneCall *call); -void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md); +void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md, bool_t is_offer); void linphone_call_clear_unused_ice_candidates(LinphoneCall *call, const SalMediaDescription *md); bool_t linphone_core_media_description_contains_video_stream(const SalMediaDescription *md); diff --git a/mediastreamer2 b/mediastreamer2 index 7b1b79e27..c8c9ef1cd 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 7b1b79e2767fd4dcfe2d3db3d6c5c20951ac4c7a +Subproject commit c8c9ef1cd2d0abc54f76a0ed4e035027ff5e8075 diff --git a/oRTP b/oRTP index 02ce979cf..83bf0a09c 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 02ce979cfdf80b68f1d13e1d0185bf2b827f4b7e +Subproject commit 83bf0a09cc2127086e15817d16793320c9fb9af0 diff --git a/tester/call_tester.c b/tester/call_tester.c index 8a7404714..1b0a59990 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -5474,7 +5474,6 @@ static void _call_with_network_switch(bool_t use_ice, bool_t with_socket_refresh LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); MSList *lcs = NULL; - int ice_reinvite = use_ice ? 1 : 0; bool_t call_ok; lcs = ms_list_append(lcs, marie->lc); @@ -5508,11 +5507,22 @@ static void _call_with_network_switch(bool_t use_ice, bool_t with_socket_refresh linphone_core_set_network_reachable(marie->lc, TRUE); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneRegistrationOk, 2)); - /*pauline shall receive a reINVITE to update the session*/ - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallUpdating, 1+ice_reinvite)); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallUpdatedByRemote, 1+ice_reinvite)); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 2+ice_reinvite)); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 2+ice_reinvite)); + if (use_ice){ + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallUpdating, 1)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallUpdatedByRemote, 1)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 3)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 3)); + /*now comes the ICE reINVITE*/ + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallUpdating, 2)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallUpdatedByRemote, 2)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 4)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 4)); + }else{ + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallUpdating, 1)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->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)); + } /*check that media is back*/ check_media_direction(marie, linphone_core_get_current_call(marie->lc), lcs, LinphoneMediaDirectionSendRecv, LinphoneMediaDirectionInvalid); @@ -5539,7 +5549,7 @@ static void call_with_network_switch_and_socket_refresh(void){ _call_with_network_switch(TRUE, TRUE); } -static void call_with_sip_and_rtp_independant_switches(){ +static void call_with_sip_and_rtp_independant_switches(void){ LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); MSList *lcs = NULL; @@ -5573,24 +5583,35 @@ static void call_with_sip_and_rtp_independant_switches(){ } /*marie looses the SIP network and reconnects*/ linphone_core_set_sip_network_reachable(marie->lc, FALSE); + linphone_core_set_media_network_reachable(marie->lc, FALSE); wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000); /*marie will reconnect and register*/ linphone_core_set_sip_network_reachable(marie->lc, TRUE); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneRegistrationOk, 2)); - wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000); + wait_for_until(marie->lc, pauline->lc, NULL, 0, 5000); /*at this stage, no reINVITE is expected to be send*/ - BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallUpdating, 1, int, "%i"); /*1: because of ICE reinvite*/ + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallUpdating, 0, int, "%i"); /*now we notify the a reconnection of media network*/ - linphone_core_set_media_network_reachable(marie->lc, FALSE); linphone_core_set_media_network_reachable(marie->lc, TRUE); - /*pauline shall receive a reINVITE to update the session*/ - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallUpdating, 2)); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallUpdatedByRemote, 2)); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 3)); - BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 3)); + if (use_ice){ + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallUpdating, 1)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallUpdatedByRemote, 1)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 3)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 3)); + /*now comes the ICE reINVITE*/ + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallUpdating, 2)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallUpdatedByRemote, 2)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallStreamsRunning, 4)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallStreamsRunning, 4)); + }else{ + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallUpdating, 1)); + BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->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)); + } /*check that media is back*/ check_media_direction(marie, linphone_core_get_current_call(marie->lc), lcs, LinphoneMediaDirectionSendRecv, LinphoneMediaDirectionInvalid); From cd3beba1c46a3e8b6bb33c762cdc062a2195aa8e Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 25 Jan 2016 20:32:41 +0100 Subject: [PATCH 03/18] fix crash in handle_stream_events() where the MediaStream object is destroyed and recreated during the loop of event processing (typicall with ice events). --- coreapi/linphonecall.c | 34 +++++++++++++++++++++++++++++++--- mediastreamer2 | 2 +- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index b46038764..dea6cd017 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -4368,6 +4368,28 @@ void linphone_call_notify_stats_updated(LinphoneCall *call, int stream_index){ } } +static MediaStream * linphone_call_get_media_stream(LinphoneCall *call, int stream_index){ + if (stream_index == call->main_audio_stream_index) + return (MediaStream*)call->audiostream; + if (stream_index == call->main_video_stream_index) + return (MediaStream*)call->videostream; + if (stream_index == call->main_text_stream_index) + return (MediaStream*)call->textstream; + ms_error("linphone_call_get_media_stream(): no stream index %i", stream_index); + return NULL; +} + +static OrtpEvQueue *linphone_call_get_event_queue(LinphoneCall *call, int stream_index){ + if (stream_index == call->main_audio_stream_index) + return call->audiostream_app_evq; + if (stream_index == call->main_video_stream_index) + return call->videostream_app_evq; + if (stream_index == call->main_text_stream_index) + return call->textstream_app_evq; + ms_error("linphone_call_get_event_queue(): no stream index %i", stream_index); + return NULL; +} + void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index){ MediaStream *ms = stream_index == call->main_audio_stream_index ? (MediaStream *)call->audiostream : (stream_index == call->main_video_stream_index ? (MediaStream *)call->videostream : (MediaStream *)call->textstream); OrtpEvQueue *evq; @@ -4396,11 +4418,15 @@ void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index){ } } /*yes the event queue has to be taken at each iteration, because ice events may perform operations re-creating the streams*/ - while ((evq = stream_index == call->main_audio_stream_index ? call->audiostream_app_evq : (stream_index == call->main_video_stream_index ? call->videostream_app_evq : call->textstream_app_evq)) && (NULL != (ev=ortp_ev_queue_get(evq)))){ + while((evq = linphone_call_get_event_queue(call, stream_index)) != NULL && NULL != (ev=ortp_ev_queue_get(evq))){ OrtpEventType evt=ortp_event_get_type(ev); OrtpEventData *evd=ortp_event_get_data(ev); - int stats_index = stream_index == call->main_audio_stream_index ? LINPHONE_CALL_STATS_AUDIO : (stream_index == call->main_video_stream_index ? LINPHONE_CALL_STATS_VIDEO : LINPHONE_CALL_STATS_TEXT); + + /*and yes the MediaStream must be taken at each iteration, because it may have changed due to the handling of events + * in this loop*/ + ms = linphone_call_get_media_stream(call, stream_index); + if (ms) linphone_call_stats_fill(&call->stats[stats_index],ms,ev); linphone_call_notify_stats_updated(call,stats_index); @@ -4785,8 +4811,10 @@ MSFormatType linphone_call_get_stream_type(LinphoneCall *call, int stream_index) return MSVideo; } else if (stream_index == call->main_text_stream_index) { return MSText; + } else if (stream_index == call->main_audio_stream_index){ + return MSAudio; } - return MSAudio; + return MSUnknownMedia; } RtpTransport* linphone_call_get_meta_rtp_transport(LinphoneCall *call, int stream_index) { diff --git a/mediastreamer2 b/mediastreamer2 index c8c9ef1cd..200c3523b 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit c8c9ef1cd2d0abc54f76a0ed4e035027ff5e8075 +Subproject commit 200c3523befdc4677bafc0eb074a75a3d3b7b0b5 From f5a8a0c803b4fa8233111f4ef2ef08f81cf07a2a Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 25 Jan 2016 21:49:02 +0100 Subject: [PATCH 04/18] don't notify periodical updates for non-established streams. --- coreapi/linphonecall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index dea6cd017..7e7ff388d 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -4166,17 +4166,17 @@ static void report_bandwidth(LinphoneCall *call, MediaStream *as, MediaStream *v call->stats[LINPHONE_CALL_STATS_TEXT].rtcp_upload_bandwidth=(ts_active) ? (float)(media_stream_get_rtcp_up_bw(ts)*1e-3) : 0.f; call->stats[LINPHONE_CALL_STATS_AUDIO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; - linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_AUDIO]); + if (as_active) linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_AUDIO]); call->stats[LINPHONE_CALL_STATS_AUDIO].updated=0; if (as) update_local_stats(&call->stats[LINPHONE_CALL_STATS_AUDIO], as); call->stats[LINPHONE_CALL_STATS_VIDEO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; - linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_VIDEO]); + if (vs_active) linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_VIDEO]); call->stats[LINPHONE_CALL_STATS_VIDEO].updated=0; if (vs) update_local_stats(&call->stats[LINPHONE_CALL_STATS_VIDEO], vs); call->stats[LINPHONE_CALL_STATS_TEXT].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; - linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_TEXT]); + if (ts_active) linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_TEXT]); call->stats[LINPHONE_CALL_STATS_TEXT].updated=0; if (ts) update_local_stats(&call->stats[LINPHONE_CALL_STATS_TEXT], ts); From 2ce9d4ecc0a060680c91b8bd70ad3a43ee7075f5 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 25 Jan 2016 21:52:28 +0100 Subject: [PATCH 05/18] fix bug in stats update JNI upcall, since introduction of text stream --- coreapi/linphonecore_jni.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index a952908ac..94911a48d 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -944,8 +944,11 @@ public: callobj = getCall(env, call); if (stats->type == LINPHONE_CALL_STATS_AUDIO) env->CallVoidMethod(callobj, ljb->callSetAudioStatsId, statsobj); - else + else if (stats->type == LINPHONE_CALL_STATS_VIDEO){ env->CallVoidMethod(callobj, ljb->callSetVideoStatsId, statsobj); + }else{ + //text stats not updated yet. + } env->CallVoidMethod(lcData->listener, ljb->callStatsUpdatedId, lcData->core, callobj, statsobj); handle_possible_java_exception(env, lcData->listener); if (statsobj) env->DeleteLocalRef(statsobj); From b0ea18f83cd642243c5a2e1690d5cf95bfe55000 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 25 Jan 2016 22:34:19 +0100 Subject: [PATCH 06/18] update ms2 to workaround ICE regression --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 200c3523b..7d0ab1d08 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 200c3523befdc4677bafc0eb074a75a3d3b7b0b5 +Subproject commit 7d0ab1d08127fa40b299f6ec80895e016a62e6b7 From a6ae0d02d61c806bb7b305c6c69b3383f79c53bf Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 26 Jan 2016 15:23:02 +0100 Subject: [PATCH 07/18] Use correct namespaces and winmd name when building for Windows 10. --- tester/CMakeLists.txt | 10 +++- tester/liblinphone_tester_windows.cpp | 26 +++++----- tester/liblinphone_tester_windows.h | 68 +++++++++++++++------------ 3 files changed, 59 insertions(+), 45 deletions(-) diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index cacb65dee..ff819df51 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -89,6 +89,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") target_compile_options(linphone_tester_runtime PRIVATE "/wd4996") target_link_libraries(linphone_tester_runtime linphone_tester_static) set_target_properties(linphone_tester_runtime PROPERTIES VS_WINRT_COMPONENT TRUE) + set_target_properties(linphone_tester_runtime PROPERTIES LIBRARY_OUTPUT_NAME "BelledonneCommunications.Linphone.Tester") + set_target_properties(linphone_tester_runtime PROPERTIES LINK_FLAGS "/WINMDFILE:BelledonneCommunications.Linphone.Tester.winmd") install(TARGETS linphone_tester_runtime RUNTIME DESTINATION bin @@ -96,7 +98,13 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ARCHIVE DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/linphone_tester_runtime.winmd" DESTINATION bin) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BelledonneCommunications.Linphone.Tester.winmd" DESTINATION lib) + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/BelledonneCommunications.Linphone.Tester.pdb + DESTINATION lib + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + endif() else() add_executable(liblinphone_tester ${SOURCE_FILES}) set_target_properties(liblinphone_tester PROPERTIES LINKER_LANGUAGE CXX) diff --git a/tester/liblinphone_tester_windows.cpp b/tester/liblinphone_tester_windows.cpp index 790f696c8..015af02d2 100644 --- a/tester/liblinphone_tester_windows.cpp +++ b/tester/liblinphone_tester_windows.cpp @@ -2,7 +2,7 @@ #include "liblinphone_tester_windows.h" -using namespace linphone_tester_runtime; +using namespace BelledonneCommunications::Linphone::Tester; using namespace Platform; using namespace Windows::Foundation; using namespace Windows::Storage; @@ -14,7 +14,7 @@ using namespace Windows::System::Threading; static OutputTraceListener^ sTraceListener; -LibLinphoneTester^ LibLinphoneTester::_instance = ref new LibLinphoneTester(); +NativeTester^ NativeTester::_instance = ref new NativeTester(); static void nativeOutputTraceHandler(int lev, const char *fmt, va_list args) { @@ -45,27 +45,27 @@ static void nativeOutputTraceHandler(int lev, const char *fmt, va_list args) } } -static void libLinphoneNativeOutputTraceHandler(OrtpLogLevel lev, const char *fmt, va_list args) +static void libLinphoneNativeOutputTraceHandler(const char *domain, OrtpLogLevel lev, const char *fmt, va_list args) { nativeOutputTraceHandler((int)lev, fmt, args); } -LibLinphoneTester::LibLinphoneTester() +NativeTester::NativeTester() { } -LibLinphoneTester::~LibLinphoneTester() +NativeTester::~NativeTester() { liblinphone_tester_uninit(); } -void LibLinphoneTester::setOutputTraceListener(OutputTraceListener^ traceListener) +void NativeTester::setOutputTraceListener(OutputTraceListener^ traceListener) { sTraceListener = traceListener; } -void LibLinphoneTester::initialize(StorageFolder^ writableDirectory, Platform::Boolean ui) +void NativeTester::initialize(StorageFolder^ writableDirectory, Platform::Boolean ui) { if (ui) { liblinphone_tester_init(nativeOutputTraceHandler); @@ -91,7 +91,7 @@ void LibLinphoneTester::initialize(StorageFolder^ writableDirectory, Platform::B } } -bool LibLinphoneTester::run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose) +bool NativeTester::run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose) { std::wstring all(L"ALL"); std::wstring wssuitename = suiteName->Data(); @@ -111,7 +111,7 @@ bool LibLinphoneTester::run(Platform::String^ suiteName, Platform::String^ caseN return bc_tester_run_tests(wssuitename == all ? 0 : csuitename, wscasename == all ? 0 : ccasename) != 0; } -void LibLinphoneTester::runAllToXml() +void NativeTester::runAllToXml() { auto workItem = ref new WorkItemHandler([this](IAsyncAction ^workItem) { bc_tester_start(NULL); @@ -120,12 +120,12 @@ void LibLinphoneTester::runAllToXml() _asyncAction = ThreadPool::RunAsync(workItem); } -unsigned int LibLinphoneTester::nbTestSuites() +unsigned int NativeTester::nbTestSuites() { return bc_tester_nb_suites(); } -unsigned int LibLinphoneTester::nbTests(Platform::String^ suiteName) +unsigned int NativeTester::nbTests(Platform::String^ suiteName) { std::wstring suitename = suiteName->Data(); char cname[MAX_SUITE_NAME_SIZE] = { 0 }; @@ -133,7 +133,7 @@ unsigned int LibLinphoneTester::nbTests(Platform::String^ suiteName) return bc_tester_nb_tests(cname); } -Platform::String^ LibLinphoneTester::testSuiteName(int index) +Platform::String^ NativeTester::testSuiteName(int index) { const char *cname = bc_tester_suite_name(index); wchar_t wcname[MAX_SUITE_NAME_SIZE]; @@ -141,7 +141,7 @@ Platform::String^ LibLinphoneTester::testSuiteName(int index) return ref new String(wcname); } -Platform::String^ LibLinphoneTester::testName(Platform::String^ suiteName, int testIndex) +Platform::String^ NativeTester::testName(Platform::String^ suiteName, int testIndex) { std::wstring suitename = suiteName->Data(); char csuitename[MAX_SUITE_NAME_SIZE] = { 0 }; diff --git a/tester/liblinphone_tester_windows.h b/tester/liblinphone_tester_windows.h index c7701143c..dec64cb48 100644 --- a/tester/liblinphone_tester_windows.h +++ b/tester/liblinphone_tester_windows.h @@ -3,39 +3,45 @@ #include "linphonecore.h" #include "liblinphone_tester.h" -namespace linphone_tester_runtime +namespace BelledonneCommunications { - public interface class OutputTraceListener + namespace Linphone { - public: - void outputTrace(Platform::String^ lev, Platform::String^ msg); - }; - - public ref class LibLinphoneTester sealed - { - public: - void setOutputTraceListener(OutputTraceListener^ traceListener); - unsigned int nbTestSuites(); - unsigned int nbTests(Platform::String^ suiteName); - Platform::String^ testSuiteName(int index); - Platform::String^ testName(Platform::String^ suiteName, int testIndex); - void initialize(Windows::Storage::StorageFolder^ writableDirectory, Platform::Boolean ui); - bool run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose); - void runAllToXml(); - - static property LibLinphoneTester^ Instance + namespace Tester { - LibLinphoneTester^ get() { return _instance; } - } - property Windows::Foundation::IAsyncAction^ AsyncAction - { - Windows::Foundation::IAsyncAction^ get() { return _asyncAction; } - } - private: - LibLinphoneTester(); - ~LibLinphoneTester(); + public interface class OutputTraceListener + { + public: + void outputTrace(Platform::String^ lev, Platform::String^ msg); + }; - static LibLinphoneTester^ _instance; - Windows::Foundation::IAsyncAction^ _asyncAction; - }; + public ref class NativeTester sealed + { + public: + void setOutputTraceListener(OutputTraceListener^ traceListener); + unsigned int nbTestSuites(); + unsigned int nbTests(Platform::String^ suiteName); + Platform::String^ testSuiteName(int index); + Platform::String^ testName(Platform::String^ suiteName, int testIndex); + void initialize(Windows::Storage::StorageFolder^ writableDirectory, Platform::Boolean ui); + bool run(Platform::String^ suiteName, Platform::String^ caseName, Platform::Boolean verbose); + void runAllToXml(); + + static property NativeTester^ Instance + { + NativeTester^ get() { return _instance; } + } + property Windows::Foundation::IAsyncAction^ AsyncAction + { + Windows::Foundation::IAsyncAction^ get() { return _asyncAction; } + } + private: + NativeTester(); + ~NativeTester(); + + static NativeTester^ _instance; + Windows::Foundation::IAsyncAction^ _asyncAction; + }; + } + } } \ No newline at end of file From 60e70816d222c650d89e453796fdc073be8b28b9 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 26 Jan 2016 15:23:22 +0100 Subject: [PATCH 08/18] Update ms2 submodule. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 7d0ab1d08..b49feebe9 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 7d0ab1d08127fa40b299f6ec80895e016a62e6b7 +Subproject commit b49feebe9e76ea8605bee0ca4f5803083c119f01 From 0965d49f7a4611ddd86655f3d3f0e4c85062ff8e Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 26 Jan 2016 17:24:54 +0100 Subject: [PATCH 09/18] handle expired client dialogs for p2p presence, and report them for LinphoneEvent. remove deprecation of LinphoneChatMessageStateCb, since it is already marked as deprecated in all functions using it. fix a few warnings --- console/commands.c | 7 ++++--- console/linphonec.c | 2 +- coreapi/bellesip_sal/sal_op_events.c | 11 ++++++++++- coreapi/bellesip_sal/sal_op_presence.c | 11 ++++++++++- coreapi/linphonecore.h | 2 +- mediastreamer2 | 2 +- 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/console/commands.c b/console/commands.c index cf462b990..6f527831e 100644 --- a/console/commands.c +++ b/console/commands.c @@ -414,7 +414,8 @@ linphonec_parse_command_line(LinphoneCore *lc, char *cl) { while ( isdigit(*cl) || *cl == '#' || *cl == '*' ) { - linphone_core_send_dtmf(lc, *cl); + if (linphone_core_get_current_call(lc)) + linphone_call_send_dtmf(linphone_core_get_current_call(lc), *cl); linphone_core_play_dtmf (lc,*cl,100); ms_sleep(1); // be nice ++cl; @@ -2336,12 +2337,12 @@ static int lpc_cmd_echolimiter(LinphoneCore *lc, char *args){ static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args) { - linphone_core_mute_mic(lc, 1); + linphone_core_enable_mic(lc, 0); return 1; } static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args){ - linphone_core_mute_mic(lc, 0); + linphone_core_enable_mic(lc, 1); return 1; } diff --git a/console/linphonec.c b/console/linphonec.c index 709940269..ee7b76617 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -102,7 +102,7 @@ static int linphonec_main_loop (LinphoneCore * opm); static int linphonec_idle_call (void); #ifdef HAVE_READLINE static int linphonec_initialize_readline(void); -static int linphonec_finish_readline(); +static int linphonec_finish_readline(void); static char **linephonec_readline_completion(const char *text, int start, int end); #endif diff --git a/coreapi/bellesip_sal/sal_op_events.c b/coreapi/bellesip_sal/sal_op_events.c index 631e23b36..802e5d334 100644 --- a/coreapi/bellesip_sal/sal_op_events.c +++ b/coreapi/bellesip_sal/sal_op_events.c @@ -61,10 +61,20 @@ static void subscribe_process_io_error(void *user_ctx, const belle_sip_io_error_ } static void subscribe_process_dialog_terminated(void *ctx, const belle_sip_dialog_terminated_event_t *event) { + belle_sip_dialog_t *dialog = belle_sip_dialog_terminated_event_get_dialog(event); SalOp* op= (SalOp*)ctx; if (op->dialog) { op->dialog=NULL; + if (!belle_sip_dialog_is_server(dialog) && belle_sip_dialog_terminated_event_is_expired(event)){ + /*notify the app that our subscription is dead*/ + const char *eventname = NULL; + if (op->event){ + eventname = belle_sip_header_get_unparsed_value(op->event); + } + op->base.root->callbacks.notify(op, SalSubscribeTerminated, eventname, NULL); + } sal_op_unref(op); + } } @@ -198,7 +208,6 @@ int sal_subscribe(SalOp *op, const char *from, const char *to, const char *event if (!op->dialog){ sal_op_subscribe_fill_cbs(op); - /*???sal_exosip_fix_route(op); make sure to ha ;lr*/ req=sal_op_build_request(op,"SUBSCRIBE"); if( req == NULL ) { return -1; diff --git a/coreapi/bellesip_sal/sal_op_presence.c b/coreapi/bellesip_sal/sal_op_presence.c index f5ec79ad8..dab484b1a 100644 --- a/coreapi/bellesip_sal/sal_op_presence.c +++ b/coreapi/bellesip_sal/sal_op_presence.c @@ -58,8 +58,17 @@ static void presence_process_dialog_terminated(void *ctx, const belle_sip_dialog if (!op->op_released){ op->base.root->callbacks.subscribe_presence_closed(op, sal_op_get_from(op)); } + set_or_update_dialog(op, NULL); + }else{ + if (belle_sip_dialog_terminated_event_is_expired(event)){ + ms_warning("Outgoing presence subscription expired."); + if (op->refresher){ + /*send a new SUBSCRIBE, that will attempt to establish a new dialog*/ + sal_subscribe_presence(op,NULL,NULL,-1); + } + } } - set_or_update_dialog(op, NULL); + } } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index d4925f50a..255dbcf2b 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1252,7 +1252,7 @@ typedef enum _LinphoneChatMessageState { * @param ud application user data * @deprecated */ -typedef LINPHONE_DEPRECATED void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud); +typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud); /** * Call back used to notify message delivery status diff --git a/mediastreamer2 b/mediastreamer2 index b49feebe9..f3651d2c5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit b49feebe9e76ea8605bee0ca4f5803083c119f01 +Subproject commit f3651d2c516ca74edd310e3868fa74d1149744c8 From 0a9ab97bd46833f99dd67e2ae2f20118a1ee4ec3 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 26 Jan 2016 21:32:55 +0100 Subject: [PATCH 10/18] keep using periodical updates (even for non-existent streams) at least for tests, because it is convenient to be notified everytime linphonecore updates bandwidth measurement. This may change in the future when bandwidth computations will be done in real time (every mediastreamer2 tick). --- coreapi/linphonecall.c | 27 +++++++++++++++------------ coreapi/linphonecore.c | 2 +- coreapi/private.h | 10 ++++++---- coreapi/upnp.c | 6 +++--- tester/call_tester.c | 15 +++++++-------- tester/liblinphone_tester.h | 2 -- tester/tester.c | 2 ++ 7 files changed, 34 insertions(+), 30 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 7e7ff388d..59af9315e 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -932,6 +932,7 @@ static void port_config_set(LinphoneCall *call, int stream_index, int min_port, static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from, LinphoneAddress *to){ int min_port, max_port; ms_message("New LinphoneCall [%p] initialized (LinphoneCore version: %s)",call,linphone_core_get_version()); + call->core->send_call_stats_periodical_updates = lp_config_get_int(call->core->config, "misc", "send_call_stats_periodical_updates", 0); call->main_audio_stream_index = LINPHONE_CALL_STATS_AUDIO; call->main_video_stream_index = LINPHONE_CALL_STATS_VIDEO; call->main_text_stream_index = LINPHONE_CALL_STATS_TEXT; @@ -4165,20 +4166,22 @@ static void report_bandwidth(LinphoneCall *call, MediaStream *as, MediaStream *v call->stats[LINPHONE_CALL_STATS_TEXT].rtcp_download_bandwidth=(ts_active) ? (float)(media_stream_get_rtcp_down_bw(ts)*1e-3) : 0.f; call->stats[LINPHONE_CALL_STATS_TEXT].rtcp_upload_bandwidth=(ts_active) ? (float)(media_stream_get_rtcp_up_bw(ts)*1e-3) : 0.f; - call->stats[LINPHONE_CALL_STATS_AUDIO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; - if (as_active) linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_AUDIO]); - call->stats[LINPHONE_CALL_STATS_AUDIO].updated=0; - if (as) update_local_stats(&call->stats[LINPHONE_CALL_STATS_AUDIO], as); + if (call->core->send_call_stats_periodical_updates){ + call->stats[LINPHONE_CALL_STATS_AUDIO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; + linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_AUDIO]); + call->stats[LINPHONE_CALL_STATS_AUDIO].updated=0; + if (as_active) update_local_stats(&call->stats[LINPHONE_CALL_STATS_AUDIO], as); - call->stats[LINPHONE_CALL_STATS_VIDEO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; - if (vs_active) linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_VIDEO]); - call->stats[LINPHONE_CALL_STATS_VIDEO].updated=0; - if (vs) update_local_stats(&call->stats[LINPHONE_CALL_STATS_VIDEO], vs); + call->stats[LINPHONE_CALL_STATS_VIDEO].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; + linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_VIDEO]); + call->stats[LINPHONE_CALL_STATS_VIDEO].updated=0; + if (vs_active) update_local_stats(&call->stats[LINPHONE_CALL_STATS_VIDEO], vs); - call->stats[LINPHONE_CALL_STATS_TEXT].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; - if (ts_active) linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_TEXT]); - call->stats[LINPHONE_CALL_STATS_TEXT].updated=0; - if (ts) update_local_stats(&call->stats[LINPHONE_CALL_STATS_TEXT], ts); + call->stats[LINPHONE_CALL_STATS_TEXT].updated|=LINPHONE_CALL_STATS_PERIODICAL_UPDATE; + linphone_core_notify_call_stats_updated(call->core, call, &call->stats[LINPHONE_CALL_STATS_TEXT]); + call->stats[LINPHONE_CALL_STATS_TEXT].updated=0; + if (ts_active) update_local_stats(&call->stats[LINPHONE_CALL_STATS_TEXT], ts); + } ms_message( "Bandwidth usage for call [%p]:\n" diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 0584c9b4f..034057a47 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7064,7 +7064,7 @@ void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *para params->realtimetext_enabled = linphone_core_realtime_text_enabled(lc); params->privacy=LinphonePrivacyDefault; params->avpf_enabled=linphone_core_get_avpf_mode(lc); - params->implicit_rtcp_fb = lp_config_get_int(lc->config,"rtp","rtcp_fb_implicit_rtcp_fb",TRUE); + params->implicit_rtcp_fb = lp_config_get_int(lc->config,"rtp","rtcp_fb_implicit_rtcp_fb",TRUE); params->audio_dir=LinphoneMediaDirectionSendRecv; params->video_dir=LinphoneMediaDirectionSendRecv; params->real_early_media=lp_config_get_int(lc->config,"misc","real_early_media",FALSE); diff --git a/coreapi/private.h b/coreapi/private.h index 8730bb1df..6f80e93ff 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -152,16 +152,17 @@ struct _LinphoneCallParams{ bool_t has_audio; bool_t has_video; bool_t avpf_enabled; /* RTCP feedback messages are enabled */ - bool_t implicit_rtcp_fb; + bool_t implicit_rtcp_fb; + bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/ bool_t in_conference; /*in conference mode */ - bool_t low_bandwidth; bool_t no_user_consent;/*when set to TRUE an UPDATE request will be used instead of reINVITE*/ + uint16_t avpf_rr_interval; /*in milliseconds*/ - bool_t internal_call_update; /*use mark that call update was requested internally (might be by ice) - unused for the moment*/ bool_t video_multicast_enabled; + bool_t audio_multicast_enabled; bool_t realtimetext_enabled; bool_t update_call_when_ice_completed; @@ -930,7 +931,8 @@ struct _LinphoneCore bool_t ringstream_autorelease; bool_t vtables_running; - bool_t pad[3]; + bool_t send_call_stats_periodical_updates; + bool_t pad[2]; char localip[LINPHONE_IPADDR_SIZE]; int device_rotation; int max_calls; diff --git a/coreapi/upnp.c b/coreapi/upnp.c index ef8b544aa..b41b8292c 100644 --- a/coreapi/upnp.c +++ b/coreapi/upnp.c @@ -89,7 +89,7 @@ bool_t linphone_core_upnp_hook(void *data); void linphone_upnp_update(UpnpContext *ctx); bool_t linphone_upnp_is_blacklisted(UpnpContext *ctx); -UpnpPortBinding *linphone_upnp_port_binding_new(); +UpnpPortBinding *linphone_upnp_port_binding_new(void); UpnpPortBinding *linphone_upnp_port_binding_new_with_parameters(upnp_igd_ip_protocol protocol, int local_port, int external_port); UpnpPortBinding *linphone_upnp_port_binding_new_or_collect(MSList *list, upnp_igd_ip_protocol protocol, int local_port, int external_port); UpnpPortBinding *linphone_upnp_port_binding_copy(const UpnpPortBinding *port); @@ -1089,7 +1089,7 @@ int linphone_core_update_local_media_description_from_upnp(SalMediaDescription * * uPnP Port Binding */ -UpnpPortBinding *linphone_upnp_port_binding_new() { +UpnpPortBinding *linphone_upnp_port_binding_new(void) { UpnpPortBinding *port = NULL; port = ms_new0(UpnpPortBinding,1); ms_mutex_init(&port->mutex, NULL); @@ -1221,7 +1221,7 @@ void linphone_upnp_port_binding_release(UpnpPortBinding *port) { * uPnP Stream */ -UpnpStream* linphone_upnp_stream_new() { +UpnpStream* linphone_upnp_stream_new(void) { UpnpStream *stream = ms_new0(UpnpStream,1); stream->state = LinphoneUpnpStateIdle; stream->rtp = NULL; diff --git a/tester/call_tester.c b/tester/call_tester.c index 1b0a59990..f015d5285 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -43,6 +43,7 @@ extern void libmsopenh264_init(void); #endif #endif + void call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg){ char* to=linphone_address_as_string(linphone_call_get_call_log(call)->to); char* from=linphone_address_as_string(linphone_call_get_call_log(call)->from); @@ -96,9 +97,6 @@ void call_stats_updated(LinphoneCore *lc, LinphoneCall *call, const LinphoneCall int tab_size = sizeof (counters->audio_download_bandwidth)/sizeof(int); int index = (counters->current_bandwidth_index++) % tab_size; - counters->current_audio_download_bandwidth = counters->audio_download_bandwidth + index; - counters->current_audio_upload_bandwidth = counters->audio_upload_bandwidth +index; - counters->audio_download_bandwidth[index] = (int)linphone_call_get_audio_stats(call)->download_bandwidth; counters->audio_upload_bandwidth[index] = (int)linphone_call_get_audio_stats(call)->upload_bandwidth; counters->video_download_bandwidth[index] = (int)linphone_call_get_video_stats(call)->download_bandwidth; @@ -532,7 +530,7 @@ static void call_outbound_with_multiple_proxy(void) { LinphoneProxyConfig* lpc = NULL; LinphoneProxyConfig* registered_lpc = linphone_core_create_proxy_config(marie->lc); - linphone_core_get_default_proxy(marie->lc, &lpc); + lpc = linphone_core_get_default_proxy_config(marie->lc); linphone_core_set_default_proxy(marie->lc,NULL); BC_ASSERT_FATAL(lpc != NULL); @@ -824,7 +822,7 @@ static void simple_call_compatibility_mode(void) { char*tmp; LCSipTransports transport; - linphone_core_get_default_proxy(lc_marie,&proxy); + proxy = linphone_core_get_default_proxy_config(lc_marie); BC_ASSERT_PTR_NOT_NULL (proxy); identity = linphone_proxy_config_get_identity_address(proxy); @@ -1466,7 +1464,8 @@ static void call_paused_resumed_with_video_base(bool_t sdp_200_ack vpol.automatically_initiate = TRUE; /* needed to present a video mline*/ linphone_core_set_video_policy(marie->lc, &vpol); - linphone_core_enable_video(marie->lc, TRUE, TRUE); + linphone_core_enable_video_capture(marie->lc, TRUE); + linphone_core_enable_video_display(marie->lc, TRUE); vpol.automatically_accept = FALSE; vpol.automatically_initiate = TRUE; @@ -2696,7 +2695,7 @@ static void call_with_privacy(void) { end_call(pauline, marie); /*test proxy config privacy*/ - linphone_core_get_default_proxy(pauline->lc,&pauline_proxy); + pauline_proxy = linphone_core_get_default_proxy_config(pauline->lc); linphone_proxy_config_set_privacy(pauline_proxy,LinphonePrivacyId); BC_ASSERT_TRUE(call(pauline,marie)); @@ -2730,7 +2729,7 @@ static void call_with_privacy2(void) { params=linphone_core_create_call_params(pauline->lc, NULL); linphone_call_params_set_privacy(params,LinphonePrivacyId); - linphone_core_get_default_proxy(pauline->lc,&pauline_proxy); + pauline_proxy = linphone_core_get_default_proxy_config(pauline->lc); linphone_proxy_config_edit(pauline_proxy); linphone_proxy_config_enable_register(pauline_proxy,FALSE); linphone_proxy_config_done(pauline_proxy); diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index d16134b4e..ee1b2eec8 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -234,9 +234,7 @@ typedef struct _stats { int number_of_LinphoneCoreLogCollectionUploadStateNotDelivered; int number_of_LinphoneCoreLogCollectionUploadStateInProgress; int audio_download_bandwidth[3]; - int *current_audio_download_bandwidth; int audio_upload_bandwidth[3]; - int *current_audio_upload_bandwidth; int video_download_bandwidth[3]; int video_upload_bandwidth[3]; diff --git a/tester/tester.c b/tester/tester.c index 40f1461e2..edc63322b 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -327,6 +327,8 @@ void linphone_core_manager_init(LinphoneCoreManager *mgr, const char* rc_file) { } linphone_core_set_user_certificates_path(mgr->lc,bc_tester_get_writable_dir_prefix()); + /*for now, we need the periodical updates facility to compute bandwidth measurements correctly during tests*/ + lp_config_set_int(linphone_core_get_config(mgr->lc), "misc", "send_call_stats_periodical_updates", 1); if (rc_path) ms_free(rc_path); } From a65aaa86fbb339d235b92fd1df14d0cf9b0e519e Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 27 Jan 2016 15:03:44 +0100 Subject: [PATCH 11/18] Update ms2 submodule. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index f3651d2c5..f6fdbb88c 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit f3651d2c516ca74edd310e3868fa74d1149744c8 +Subproject commit f6fdbb88c668171e6df3fabdee21416cb2d0ef98 From 142891969ec2ba99a404c4ba3fd0d9f22e420766 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 27 Jan 2016 15:04:47 +0100 Subject: [PATCH 12/18] Add possibility to assiocate tags with tests and to run the only the tests corresponding with a specific tag with the --tag option. --- tester/call_tester.c | 328 ++++++++++++++-------------- tester/common/bc_tester_utils.c | 64 ++++-- tester/common/bc_tester_utils.h | 12 +- tester/complex_sip_call_tester.c | 12 +- tester/dtmf_tester.c | 14 +- tester/eventapi_tester.c | 18 +- tester/flexisip_tester.c | 48 ++-- tester/log_collection_tester.c | 10 +- tester/message_tester.c | 88 ++++---- tester/multi_call_tester.c | 32 +-- tester/multicast_call_tester.c | 12 +- tester/offeranswer_tester.c | 94 ++++---- tester/player_tester.c | 6 +- tester/presence_tester.c | 28 +-- tester/proxy_config_tester.c | 8 +- tester/quality_reporting_tester.c | 18 +- tester/register_tester.c | 68 +++--- tester/remote_provisioning_tester.c | 18 +- tester/setup_tester.c | 28 +-- tester/stun_tester.c | 4 +- tester/tunnel_tester.c | 26 +-- tester/upnp_tester.c | 6 +- tester/video_tester.c | 10 +- 23 files changed, 498 insertions(+), 454 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index f015d5285..8eb458f93 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -5953,178 +5953,178 @@ static void call_with_zrtp_configured_calling_side(void) { } test_t call_tests[] = { - { "Early declined call", early_declined_call }, - { "Call declined", call_declined }, - { "Cancelled call", cancelled_call }, - { "Early cancelled call", early_cancelled_call}, - { "Call with DNS timeout", call_with_dns_time_out }, - { "Cancelled ringing call", cancelled_ringing_call }, - { "Call busy when calling self", call_busy_when_calling_self}, - { "Simple call", simple_call }, - { "Call terminated automatically by linphone_core_destroy", automatic_call_termination }, - { "Call with http proxy", call_with_http_proxy }, - { "Call with timeouted bye", call_with_timeouted_bye }, - { "Direct call over IPv6", direct_call_over_ipv6}, - { "Outbound call with multiple proxy possible", call_outbound_with_multiple_proxy }, - { "Audio call recording", audio_call_recording_test }, + TEST_NO_TAG("Early declined call", early_declined_call), + TEST_NO_TAG("Call declined", call_declined), + TEST_NO_TAG("Cancelled call", cancelled_call), + TEST_NO_TAG("Early cancelled call", early_cancelled_call), + TEST_NO_TAG("Call with DNS timeout", call_with_dns_time_out), + TEST_NO_TAG("Cancelled ringing call", cancelled_ringing_call), + TEST_NO_TAG("Call busy when calling self", call_busy_when_calling_self), + TEST_NO_TAG("Simple call", simple_call), + TEST_NO_TAG("Call terminated automatically by linphone_core_destroy", automatic_call_termination), + TEST_NO_TAG("Call with http proxy", call_with_http_proxy), + TEST_NO_TAG("Call with timeouted bye", call_with_timeouted_bye), + TEST_NO_TAG("Direct call over IPv6", direct_call_over_ipv6), + TEST_NO_TAG("Outbound call with multiple proxy possible", call_outbound_with_multiple_proxy), + TEST_NO_TAG("Audio call recording", audio_call_recording_test), #if 0 /* not yet activated because not implemented */ - { "Multiple answers to a call", multiple_answers_call }, + TEST_NO_TAG("Multiple answers to a call", multiple_answers_call), #endif - { "Multiple answers to a call with media relay", multiple_answers_call_with_media_relay }, - { "Call with media relay", call_with_media_relay}, - { "Call with media relay (random ports)", call_with_media_relay_random_ports}, - { "Simple call compatibility mode", simple_call_compatibility_mode }, - { "Early-media call", early_media_call }, - { "Early-media call with ringing", early_media_call_with_ringing }, - { "Early-media call with updated media session", early_media_call_with_session_update}, - { "Early-media call with updated codec", early_media_call_with_codec_update}, - { "Call terminated by caller", call_terminated_by_caller }, - { "Call without SDP", call_with_no_sdp}, - { "Call without SDP and ACK without SDP", call_with_no_sdp_ack_without_sdp}, - { "Call paused resumed", call_paused_resumed }, - { "Call paused resumed with video", call_paused_resumed_with_video }, - { "Call paused resumed with video no sdp ack", call_paused_resumed_with_no_sdp_ack}, - { "Call paused resumed with video no sdk ack using video policy for resume offers",call_paused_resumed_with_no_sdp_ack_using_video_policy}, - { "Call paused, updated and resumed with video no sdk ack using video policy for resume offers", call_paused_updated_resumed_with_no_sdp_ack_using_video_policy}, - { "Call paused, updated and resumed with video no sdk ack using video policy for resume offers with accept call update", call_paused_updated_resumed_with_no_sdp_ack_using_video_policy_and_accept_call_update}, - { "Call paused by both parties", call_paused_by_both }, - { "Call paused resumed with loss", call_paused_resumed_with_loss }, - { "Call paused resumed from callee", call_paused_resumed_from_callee }, - { "SRTP call", srtp_call }, - { "ZRTP call",zrtp_call}, - { "ZRTP SAS call",zrtp_sas_call}, - { "ZRTP Cipher call",zrtp_cipher_call}, - { "DTLS SRTP call",dtls_srtp_call}, - { "DTLS SRTP call with media relay", dtls_srtp_call_with_media_realy}, - { "ZRTP video call",zrtp_video_call}, - { "SRTP call with declined srtp", call_with_declined_srtp }, - { "SRTP call paused and resumed", call_srtp_paused_and_resumed }, - { "Call with file player", call_with_file_player}, - { "Call with mkv file player", call_with_mkv_file_player}, - { "Audio call with ICE no matching audio codecs", audio_call_with_ice_no_matching_audio_codecs }, + TEST_NO_TAG("Multiple answers to a call with media relay", multiple_answers_call_with_media_relay), + TEST_NO_TAG("Call with media relay", call_with_media_relay), + TEST_NO_TAG("Call with media relay (random ports)", call_with_media_relay_random_ports), + TEST_NO_TAG("Simple call compatibility mode", simple_call_compatibility_mode), + TEST_NO_TAG("Early-media call", early_media_call), + TEST_NO_TAG("Early-media call with ringing", early_media_call_with_ringing), + TEST_NO_TAG("Early-media call with updated media session", early_media_call_with_session_update), + TEST_NO_TAG("Early-media call with updated codec", early_media_call_with_codec_update), + TEST_NO_TAG("Call terminated by caller", call_terminated_by_caller), + TEST_NO_TAG("Call without SDP", call_with_no_sdp), + TEST_NO_TAG("Call without SDP and ACK without SDP", call_with_no_sdp_ack_without_sdp), + TEST_NO_TAG("Call paused resumed", call_paused_resumed), + TEST_NO_TAG("Call paused resumed with video", call_paused_resumed_with_video), + TEST_NO_TAG("Call paused resumed with video no sdp ack", call_paused_resumed_with_no_sdp_ack), + TEST_NO_TAG("Call paused resumed with video no sdk ack using video policy for resume offers", call_paused_resumed_with_no_sdp_ack_using_video_policy), + TEST_NO_TAG("Call paused, updated and resumed with video no sdk ack using video policy for resume offers", call_paused_updated_resumed_with_no_sdp_ack_using_video_policy), + TEST_NO_TAG("Call paused, updated and resumed with video no sdk ack using video policy for resume offers with accept call update", call_paused_updated_resumed_with_no_sdp_ack_using_video_policy_and_accept_call_update), + TEST_NO_TAG("Call paused by both parties", call_paused_by_both), + TEST_NO_TAG("Call paused resumed with loss", call_paused_resumed_with_loss), + TEST_NO_TAG("Call paused resumed from callee", call_paused_resumed_from_callee), + TEST_NO_TAG("SRTP call", srtp_call), + TEST_NO_TAG("ZRTP call", zrtp_call), + TEST_NO_TAG("ZRTP SAS call", zrtp_sas_call), + TEST_NO_TAG("ZRTP Cipher call", zrtp_cipher_call), + TEST_NO_TAG("DTLS SRTP call", dtls_srtp_call), + TEST_NO_TAG("DTLS SRTP call with media relay", dtls_srtp_call_with_media_realy), + TEST_NO_TAG("ZRTP video call", zrtp_video_call), + TEST_NO_TAG("SRTP call with declined srtp", call_with_declined_srtp), + TEST_NO_TAG("SRTP call paused and resumed", call_srtp_paused_and_resumed), + TEST_NO_TAG("Call with file player", call_with_file_player), + TEST_NO_TAG("Call with mkv file player", call_with_mkv_file_player), + TEST_ONE_TAG("Audio call with ICE no matching audio codecs", audio_call_with_ice_no_matching_audio_codecs, "ICE"), #ifdef VIDEO_ENABLED - { "Simple video call AVPF",video_call_avpf}, - { "Simple video call implicit AVPF both", video_call_using_policy_AVPF_implicit_caller_and_callee}, - { "Simple video call disable implicit AVPF on callee",video_call_disable_implicit_AVPF_on_callee}, - { "Simple video call disable implicit AVPF on caller",video_call_disable_implicit_AVPF_on_caller}, - { "Simple video call AVPF to implicit AVPF",video_call_AVPF_to_implicit_AVPF}, - { "Simple video call implicit AVPF to AVPF",video_call_implicit_AVPF_to_AVPF}, - { "Simple video call",video_call}, - { "Simple ZRTP video call",video_call_zrtp}, - { "Simple DTLS video call",video_call_dtls}, - { "Simple video call using policy",video_call_using_policy}, - { "Video call using policy with callee video disabled", video_call_using_policy_with_callee_video_disabled }, - { "Video call using policy with caller video disabled", video_call_using_policy_with_caller_video_disabled }, - { "Video call without SDP",video_call_no_sdp}, - { "SRTP ice video call", srtp_video_ice_call }, - { "ZRTP ice video call", zrtp_video_ice_call }, - { "Call with video added", call_with_video_added }, - { "Call with video added 2", call_with_video_added_2 }, - { "Call with video added (random ports)", call_with_video_added_random_ports }, - { "Call with several video switches", call_with_several_video_switches }, - { "SRTP call with several video switches", srtp_call_with_several_video_switches }, - { "Call with video declined", call_with_declined_video}, - { "Call with video declined despite policy", call_with_declined_video_despite_policy}, - { "Call with video declined using policy", call_with_declined_video_using_policy}, - { "Call with multiple early media", multiple_early_media }, - { "Call with ICE from video to non-video", call_with_ice_video_to_novideo}, - { "Call with ICE and video added", call_with_ice_video_added }, - { "Call with ICE and video added 2", call_with_ice_video_added_2 }, - { "Call with ICE and video added 3", call_with_ice_video_added_3 }, - { "Call with ICE and video added and refused", call_with_ice_video_added_and_refused }, - { "Call with ICE and video added with video policies to false", call_with_ice_video_added_with_video_policies_to_false }, + TEST_NO_TAG("Simple video call AVPF", video_call_avpf), + TEST_NO_TAG("Simple video call implicit AVPF both", video_call_using_policy_AVPF_implicit_caller_and_callee), + TEST_NO_TAG("Simple video call disable implicit AVPF on callee", video_call_disable_implicit_AVPF_on_callee), + TEST_NO_TAG("Simple video call disable implicit AVPF on caller", video_call_disable_implicit_AVPF_on_caller), + TEST_NO_TAG("Simple video call AVPF to implicit AVPF", video_call_AVPF_to_implicit_AVPF), + TEST_NO_TAG("Simple video call implicit AVPF to AVPF", video_call_implicit_AVPF_to_AVPF), + TEST_NO_TAG("Simple video call", video_call), + TEST_NO_TAG("Simple ZRTP video call", video_call_zrtp), + TEST_NO_TAG("Simple DTLS video call", video_call_dtls), + TEST_NO_TAG("Simple video call using policy", video_call_using_policy), + TEST_NO_TAG("Video call using policy with callee video disabled", video_call_using_policy_with_callee_video_disabled), + TEST_NO_TAG("Video call using policy with caller video disabled", video_call_using_policy_with_caller_video_disabled), + TEST_NO_TAG("Video call without SDP", video_call_no_sdp), + TEST_ONE_TAG("SRTP ice video call", srtp_video_ice_call, "ICE"), + TEST_ONE_TAG("ZRTP ice video call", zrtp_video_ice_call, "ICE"), + TEST_NO_TAG("Call with video added", call_with_video_added), + TEST_NO_TAG("Call with video added 2", call_with_video_added_2), + TEST_NO_TAG("Call with video added (random ports)", call_with_video_added_random_ports), + TEST_NO_TAG("Call with several video switches", call_with_several_video_switches), + TEST_NO_TAG("SRTP call with several video switches", srtp_call_with_several_video_switches), + TEST_NO_TAG("Call with video declined", call_with_declined_video), + TEST_NO_TAG("Call with video declined despite policy", call_with_declined_video_despite_policy), + TEST_NO_TAG("Call with video declined using policy", call_with_declined_video_using_policy), + TEST_NO_TAG("Call with multiple early media", multiple_early_media), + TEST_ONE_TAG("Call with ICE from video to non-video", call_with_ice_video_to_novideo, "ICE"), + TEST_ONE_TAG("Call with ICE and video added", call_with_ice_video_added, "ICE"), + TEST_ONE_TAG("Call with ICE and video added 2", call_with_ice_video_added_2, "ICE"), + TEST_ONE_TAG("Call with ICE and video added 3", call_with_ice_video_added_3, "ICE"), + TEST_ONE_TAG("Call with ICE and video added and refused", call_with_ice_video_added_and_refused, "ICE"), + TEST_ONE_TAG("Call with ICE and video added with video policies to false", call_with_ice_video_added_with_video_policies_to_false, "ICE"), #if ICE_WAS_WORKING_WITH_REAL_TIME_TEXT - { "Call with ICE, video and realtime text", call_with_ice_video_and_rtt }, + TEST_ONE_TAG("Call with ICE, video and realtime text", call_with_ice_video_and_rtt, "ICE"), #endif - { "Video call with ICE accepted using call params",video_call_ice_params}, - { "Audio call paused with caller video policy enabled",audio_call_with_video_policy_enabled}, - { "Video call recording (H264)", video_call_recording_h264_test }, - { "Video call recording (VP8)", video_call_recording_vp8_test }, - { "Snapshot", video_call_snapshot }, - { "Video call with early media and no matching audio codecs", video_call_with_early_media_no_matching_audio_codecs }, - { "DTLS SRTP video call",dtls_srtp_video_call}, - { "DTLS SRTP ice video call",dtls_srtp_ice_video_call}, - { "DTLS SRTP ice video call with relay",dtls_srtp_ice_video_call_with_relay}, - { "Video call with limited bandwidth", video_call_limited_bandwidth}, - { "Video call accepted in send only", accept_call_in_send_only}, - { "Video call accepted in send only with ice", accept_call_in_send_only_with_ice}, - { "2 Video call accepted in send only", two_accepted_call_in_send_only}, - { "Video call with re-invite(inactive) followed by re-invite", video_call_with_re_invite_inactive_followed_by_re_invite}, - { "Video call with re-invite(inactive) followed by re-invite(no sdp)", video_call_with_re_invite_inactive_followed_by_re_invite_no_sdp}, - { "SRTP Video call with re-invite(inactive) followed by re-invite", srtp_video_call_with_re_invite_inactive_followed_by_re_invite}, - { "SRTP Video call with re-invite(inactive) followed by re-invite(no sdp)", srtp_video_call_with_re_invite_inactive_followed_by_re_invite_no_sdp}, - { "Classic video entry phone setup", classic_video_entry_phone_setup }, + TEST_ONE_TAG("Video call with ICE accepted using call params", video_call_ice_params, "ICE"), + TEST_NO_TAG("Audio call paused with caller video policy enabled", audio_call_with_video_policy_enabled), + TEST_NO_TAG("Video call recording (H264)", video_call_recording_h264_test), + TEST_NO_TAG("Video call recording (VP8)", video_call_recording_vp8_test), + TEST_NO_TAG("Snapshot", video_call_snapshot), + TEST_NO_TAG("Video call with early media and no matching audio codecs", video_call_with_early_media_no_matching_audio_codecs), + TEST_NO_TAG("DTLS SRTP video call", dtls_srtp_video_call), + TEST_ONE_TAG("DTLS SRTP ice video call", dtls_srtp_ice_video_call, "ICE"), + TEST_ONE_TAG("DTLS SRTP ice video call with relay", dtls_srtp_ice_video_call_with_relay, "ICE"), + TEST_NO_TAG("Video call with limited bandwidth", video_call_limited_bandwidth), + TEST_NO_TAG("Video call accepted in send only", accept_call_in_send_only), + TEST_ONE_TAG("Video call accepted in send only with ice", accept_call_in_send_only_with_ice, "ICE"), + TEST_NO_TAG("2 Video call accepted in send only", two_accepted_call_in_send_only), + TEST_NO_TAG("Video call with re-invite(inactive) followed by re-invite", video_call_with_re_invite_inactive_followed_by_re_invite), + TEST_NO_TAG("Video call with re-invite(inactive) followed by re-invite(no sdp)", video_call_with_re_invite_inactive_followed_by_re_invite_no_sdp), + TEST_NO_TAG("SRTP Video call with re-invite(inactive) followed by re-invite", srtp_video_call_with_re_invite_inactive_followed_by_re_invite), + TEST_NO_TAG("SRTP Video call with re-invite(inactive) followed by re-invite(no sdp)", srtp_video_call_with_re_invite_inactive_followed_by_re_invite_no_sdp), + TEST_NO_TAG("Classic video entry phone setup", classic_video_entry_phone_setup), #endif - { "SRTP ice call", srtp_ice_call }, - { "ZRTP ice call", zrtp_ice_call }, - { "ZRTP ice call with relay", zrtp_ice_call_with_relay}, - { "DTLS SRTP ice call",dtls_srtp_ice_call}, - { "DTLS ice call with relay", dtls_ice_call_with_relay}, - { "Call with privacy", call_with_privacy }, - { "Call with privacy 2", call_with_privacy2 }, - { "Call rejected because of wrong credential", call_rejected_because_wrong_credentials}, - { "Call rejected without 403 because of wrong credential", call_rejected_without_403_because_wrong_credentials}, - { "Call rejected without 403 because of wrong credential and no auth req cb", call_rejected_without_403_because_wrong_credentials_no_auth_req_cb}, - { "Call with ICE", call_with_ice }, - { "Call with ICE without SDP", call_with_ice_no_sdp }, - { "Call with ICE (random ports)", call_with_ice_random_ports }, - { "Call from ICE to not ICE",ice_to_not_ice}, - { "Call from not ICE to ICE",not_ice_to_ice}, - { "Call with custom headers",call_with_custom_headers}, - { "Call with custom SDP attributes", call_with_custom_sdp_attributes }, - { "Call established with rejected INFO",call_established_with_rejected_info}, - { "Call established with rejected RE-INVITE",call_established_with_rejected_reinvite}, - { "Call established with rejected incoming RE-INVITE", call_established_with_rejected_incoming_reinvite }, - { "Call established with rejected RE-INVITE in error", call_established_with_rejected_reinvite_with_error}, - { "Call established with rejected RE-INVITE with trans pending error", call_established_with_rejected_reinvite_with_trans_pending_error}, - { "Call established with complex rejected operation",call_established_with_complex_rejected_operation}, - { "Call established with rejected info during re-invite",call_established_with_rejected_info_during_reinvite}, - { "Call redirected by callee", call_redirect}, - { "Call with specified codec bitrate", call_with_specified_codec_bitrate}, - { "Call with no audio codec", call_with_no_audio_codec}, - { "Video call with no audio and no video codec", video_call_with_no_audio_and_no_video_codec}, - { "Call with in-dialog UPDATE request", call_with_in_dialog_update }, - { "Call with in-dialog codec change", call_with_in_dialog_codec_change }, - { "Call with in-dialog codec change no sdp", call_with_in_dialog_codec_change_no_sdp }, - { "Call with pause no SDP on resume", call_with_paused_no_sdp_on_resume }, - { "Call with early media and no SDP in 200 Ok", call_with_early_media_and_no_sdp_in_200 }, - { "Call with early media and no SDP in 200 Ok with video", call_with_early_media_and_no_sdp_in_200_with_video }, - { "Call with ICE and no SDP in 200 OK", call_with_early_media_ice_and_no_sdp_in_200}, - { "Call with custom supported tags", call_with_custom_supported_tags }, - { "Call log from taken from asserted id",call_log_from_taken_from_p_asserted_id}, - { "Incoming INVITE with invalid SDP",incoming_invite_with_invalid_sdp}, - { "Outgoing INVITE with invalid ACK SDP",outgoing_invite_with_invalid_sdp}, - { "Incoming REINVITE with invalid SDP in ACK",incoming_reinvite_with_invalid_ack_sdp}, - { "Outgoing REINVITE with invalid SDP in ACK",outgoing_reinvite_with_invalid_ack_sdp}, - { "Call with generic CN", call_with_generic_cn }, - { "Call with transport change after released", call_with_transport_change_after_released }, - { "Unsuccessful call with transport change after released",unsucessfull_call_with_transport_change_after_released}, - { "Simple stereo call with L16", simple_stereo_call_l16 }, - { "Simple stereo call with opus", simple_stereo_call_opus }, - { "Simple mono call with opus", simple_mono_call_opus }, - { "Call with FQDN in SDP", call_with_fqdn_in_sdp}, - { "Call with RTP IO mode", call_with_rtp_io_mode }, - { "Call with generic NACK RTCP feedback", call_with_generic_nack_rtcp_feedback }, - { "Call with complex late offering", call_with_complex_late_offering }, + TEST_ONE_TAG("SRTP ice call", srtp_ice_call, "ICE"), + TEST_ONE_TAG("ZRTP ice call", zrtp_ice_call, "ICE"), + TEST_ONE_TAG("ZRTP ice call with relay", zrtp_ice_call_with_relay, "ICE"), + TEST_ONE_TAG("DTLS SRTP ice call", dtls_srtp_ice_call, "ICE"), + TEST_ONE_TAG("DTLS ice call with relay", dtls_ice_call_with_relay, "ICE"), + TEST_NO_TAG("Call with privacy", call_with_privacy), + TEST_NO_TAG("Call with privacy 2", call_with_privacy2), + TEST_NO_TAG("Call rejected because of wrong credential", call_rejected_because_wrong_credentials), + TEST_NO_TAG("Call rejected without 403 because of wrong credential", call_rejected_without_403_because_wrong_credentials), + TEST_NO_TAG("Call rejected without 403 because of wrong credential and no auth req cb", call_rejected_without_403_because_wrong_credentials_no_auth_req_cb), + TEST_ONE_TAG("Call with ICE", call_with_ice, "ICE"), + TEST_ONE_TAG("Call with ICE without SDP", call_with_ice_no_sdp, "ICE"), + TEST_ONE_TAG("Call with ICE (random ports)", call_with_ice_random_ports, "ICE"), + TEST_ONE_TAG("Call from ICE to not ICE", ice_to_not_ice, "ICE"), + TEST_ONE_TAG("Call from not ICE to ICE", not_ice_to_ice, "ICE"), + TEST_NO_TAG("Call with custom headers", call_with_custom_headers), + TEST_NO_TAG("Call with custom SDP attributes", call_with_custom_sdp_attributes), + TEST_NO_TAG("Call established with rejected INFO", call_established_with_rejected_info), + TEST_NO_TAG("Call established with rejected RE-INVITE", call_established_with_rejected_reinvite), + TEST_NO_TAG("Call established with rejected incoming RE-INVITE", call_established_with_rejected_incoming_reinvite), + TEST_NO_TAG("Call established with rejected RE-INVITE in error", call_established_with_rejected_reinvite_with_error), + TEST_NO_TAG("Call established with rejected RE-INVITE with trans pending error", call_established_with_rejected_reinvite_with_trans_pending_error), + TEST_NO_TAG("Call established with complex rejected operation", call_established_with_complex_rejected_operation), + TEST_NO_TAG("Call established with rejected info during re-invite", call_established_with_rejected_info_during_reinvite), + TEST_NO_TAG("Call redirected by callee", call_redirect), + TEST_NO_TAG("Call with specified codec bitrate", call_with_specified_codec_bitrate), + 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 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), + TEST_NO_TAG("Call with early media and no SDP in 200 Ok", call_with_early_media_and_no_sdp_in_200), + TEST_NO_TAG("Call with early media and no SDP in 200 Ok with video", call_with_early_media_and_no_sdp_in_200_with_video), + TEST_ONE_TAG("Call with ICE and no SDP in 200 OK", call_with_early_media_ice_and_no_sdp_in_200, "ICE"), + TEST_NO_TAG("Call with custom supported tags", call_with_custom_supported_tags), + TEST_NO_TAG("Call log from taken from asserted id", call_log_from_taken_from_p_asserted_id), + TEST_NO_TAG("Incoming INVITE with invalid SDP", incoming_invite_with_invalid_sdp), + TEST_NO_TAG("Outgoing INVITE with invalid ACK SDP", outgoing_invite_with_invalid_sdp), + TEST_NO_TAG("Incoming REINVITE with invalid SDP in ACK", incoming_reinvite_with_invalid_ack_sdp), + TEST_NO_TAG("Outgoing REINVITE with invalid SDP in ACK", outgoing_reinvite_with_invalid_ack_sdp), + TEST_NO_TAG("Call with generic CN", call_with_generic_cn), + TEST_NO_TAG("Call with transport change after released", call_with_transport_change_after_released), + TEST_NO_TAG("Unsuccessful call with transport change after released", unsucessfull_call_with_transport_change_after_released), + TEST_NO_TAG("Simple stereo call with L16", simple_stereo_call_l16), + TEST_NO_TAG("Simple stereo call with opus", simple_stereo_call_opus), + TEST_NO_TAG("Simple mono call with opus", simple_mono_call_opus), + TEST_NO_TAG("Call with FQDN in SDP", call_with_fqdn_in_sdp), + TEST_NO_TAG("Call with RTP IO mode", call_with_rtp_io_mode), + TEST_NO_TAG("Call with generic NACK RTCP feedback", call_with_generic_nack_rtcp_feedback), + TEST_NO_TAG("Call with complex late offering", call_with_complex_late_offering), #ifdef CALL_LOGS_STORAGE_ENABLED - { "Call log working if no db set", call_logs_if_no_db_set }, - { "Call log storage migration from rc to db", call_logs_migrate }, - { "Call log storage in sqlite database", call_logs_sqlite_storage }, + TEST_NO_TAG("Call log working if no db set", call_logs_if_no_db_set), + TEST_NO_TAG("Call log storage migration from rc to db", call_logs_migrate), + TEST_NO_TAG("Call log storage in sqlite database", call_logs_sqlite_storage), #endif - { "Call with custom RTP Modifier", call_with_custom_rtp_modifier }, - { "Call paused resumed with custom RTP Modifier", call_paused_resumed_with_custom_rtp_modifier }, - { "Call record with custom RTP Modifier", call_record_with_custom_rtp_modifier }, - { "Call with network switch", call_with_network_switch }, - { "Call with network switch in early state 1", call_with_network_switch_in_early_state_1 }, - { "Call with network switch in early state 2", call_with_network_switch_in_early_state_2 }, - { "Call with network switch and ICE", call_with_network_switch_and_ice }, - { "Call with network switch with socket refresh", call_with_network_switch_and_socket_refresh }, - { "Call with SIP and RTP independant switches", call_with_sip_and_rtp_independant_switches}, - { "Call with rtcp-mux", call_with_rtcp_mux}, - { "Call with rtcp-mux not accepted", call_with_rtcp_mux_not_accepted}, - { "Call with ICE and rtcp-mux", call_with_ice_and_rtcp_mux}, - { "Call with ICE and rtcp-mux without ICE re-invite", call_with_ice_and_rtcp_mux_without_reinvite}, - { "call with ZRTP configured calling side only", call_with_zrtp_configured_calling_side} + TEST_NO_TAG("Call with custom RTP Modifier", call_with_custom_rtp_modifier), + TEST_NO_TAG("Call paused resumed with custom RTP Modifier", call_paused_resumed_with_custom_rtp_modifier), + TEST_NO_TAG("Call record with custom RTP Modifier", call_record_with_custom_rtp_modifier), + TEST_NO_TAG("Call with network switch", call_with_network_switch), + TEST_NO_TAG("Call with network switch in early state 1", call_with_network_switch_in_early_state_1), + TEST_NO_TAG("Call with network switch in early state 2", call_with_network_switch_in_early_state_2), + TEST_ONE_TAG("Call with network switch and ICE", call_with_network_switch_and_ice, "ICE"), + TEST_NO_TAG("Call with network switch with socket refresh", call_with_network_switch_and_socket_refresh), + TEST_NO_TAG("Call with SIP and RTP independant switches", call_with_sip_and_rtp_independant_switches), + TEST_NO_TAG("Call with rtcp-mux", call_with_rtcp_mux), + TEST_NO_TAG("Call with rtcp-mux not accepted", call_with_rtcp_mux_not_accepted), + TEST_ONE_TAG("Call with ICE and rtcp-mux", call_with_ice_and_rtcp_mux, "ICE"), + TEST_ONE_TAG("Call with ICE and rtcp-mux without ICE re-invite", call_with_ice_and_rtcp_mux_without_reinvite, "ICE"), + TEST_NO_TAG("call with ZRTP configured calling side only", call_with_zrtp_configured_calling_side) }; test_suite_t call_test_suite = {"Single Call", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/common/bc_tester_utils.c b/tester/common/bc_tester_utils.c index b69de691a..5522caaca 100644 --- a/tester/common/bc_tester_utils.c +++ b/tester/common/bc_tester_utils.c @@ -80,8 +80,9 @@ static unsigned char curses = 0; char* xml_file = "CUnitAutomated-Results.xml"; int xml_enabled = 0; -char * suite_name; -char * test_name; +char * suite_name = NULL; +char * test_name = NULL; +char * tag_name = NULL; static long max_vm_kb = 0; void (*tester_printf_va)(int level, const char *format, va_list args); @@ -93,14 +94,38 @@ void bc_tester_printf(int level, const char *format, ...) { va_end (args); } -int bc_tester_run_suite(test_suite_t *suite) { +int bc_tester_run_suite(test_suite_t *suite, const char *tag_name) { int i; + CU_pSuite pSuite; - CU_pSuite pSuite = CU_add_suite(suite->name, suite->before_all, suite->after_all); - - for (i = 0; i < suite->nb_tests; i++) { - if (NULL == CU_add_test(pSuite, suite->tests[i].name, suite->tests[i].func)) { - return CU_get_error(); + if (tag_name != NULL) { + int j; + int nb_tests_for_tag = 0; + for (i = 0; i < suite->nb_tests; i++) { + for (j = 0; j < (sizeof(suite->tests[i].tags) / sizeof(suite->tests[i].tags[0])); j++) { + if ((suite->tests[i].tags[j] != NULL) && (strcasecmp(tag_name, suite->tests[i].tags[j]) == 0)) { + nb_tests_for_tag++; + } + } + } + if (nb_tests_for_tag > 0) { + pSuite = CU_add_suite(suite->name, suite->before_all, suite->after_all); + for (i = 0; i < suite->nb_tests; i++) { + for (j = 0; j < (sizeof(suite->tests[i].tags) / sizeof(suite->tests[i].tags[0])); j++) { + if ((suite->tests[i].tags[j] != NULL) && (strcasecmp(tag_name, suite->tests[i].tags[j]) == 0)) { + if (NULL == CU_add_test(pSuite, suite->tests[i].name, suite->tests[i].func)) { + return CU_get_error(); + } + } + } + } + } + } else { + pSuite = CU_add_suite(suite->name, suite->before_all, suite->after_all); + for (i = 0; i < suite->nb_tests; i++) { + if (NULL == CU_add_test(pSuite, suite->tests[i].name, suite->tests[i].func)) { + return CU_get_error(); + } } } @@ -251,7 +276,7 @@ static void test_complete_message_handler(const CU_pTest pTest, const CU_pSuite } #endif -int bc_tester_run_tests(const char *suite_name, const char *test_name) { +int bc_tester_run_tests(const char *suite_name, const char *test_name, const char *tag_name) { int i; /* initialize the CUnit test registry */ @@ -259,7 +284,7 @@ int bc_tester_run_tests(const char *suite_name, const char *test_name) { return CU_get_error(); for (i = 0; i < nb_test_suites; i++) { - bc_tester_run_suite(test_suite[i]); + bc_tester_run_suite(test_suite[i], tag_name); } #ifdef HAVE_CU_GET_SUITE CU_set_suite_start_handler(suite_start_message_handler); @@ -284,13 +309,21 @@ int bc_tester_run_tests(const char *suite_name, const char *test_name) { CU_pSuite suite; suite=CU_get_suite(suite_name); if (!suite) { - bc_tester_printf(bc_printf_verbosity_error, "Could not find suite '%s'. Available suites are:", suite_name); + if (tag_name != NULL) { + bc_tester_printf(bc_printf_verbosity_error, "Could not find suite '%s' or this suite has no tests with tag '%s'. Available suites are:", suite_name, tag_name); + } else { + bc_tester_printf(bc_printf_verbosity_error, "Could not find suite '%s'. Available suites are:", suite_name); + } bc_tester_list_suites(); return -1; } else if (test_name) { CU_pTest test=CU_get_test_by_name(test_name, suite); if (!test) { - bc_tester_printf(bc_printf_verbosity_error, "Could not find test '%s' in suite '%s'. Available tests are:", test_name, suite_name); + if (tag_name != NULL) { + bc_tester_printf(bc_printf_verbosity_error, "Could not find test '%s' in suite '%s' or this test is not tagged '%s'. Available tests are:", test_name, suite_name, tag_name); + } else { + bc_tester_printf(bc_printf_verbosity_error, "Could not find test '%s' in suite '%s'. Available tests are:", test_name, suite_name); + } // do not use suite_name here, since this method is case sensitive bc_tester_list_tests(suite->pName); return -2; @@ -464,9 +497,12 @@ int bc_tester_parse_args(int argc, char **argv, int argid) } else if (strcmp(argv[i],"--test")==0){ CHECK_ARG("--test", ++i, argc); test_name=argv[i]; - }else if (strcmp(argv[i],"--suite")==0){ + } else if (strcmp(argv[i],"--suite")==0){ CHECK_ARG("--suite", ++i, argc); suite_name=argv[i]; + } else if (strcmp(argv[i], "--tag") == 0) { + CHECK_ARG("--tag", ++i, argc); + tag_name = argv[i]; } else if (strcmp(argv[i],"--list-suites")==0){ bc_tester_list_suites(); return 0; @@ -518,7 +554,7 @@ int bc_tester_start(const char* prog_name) { free(xml_tmp_file); } - ret = bc_tester_run_tests(suite_name, test_name); + ret = bc_tester_run_tests(suite_name, test_name, tag_name); return ret; } diff --git a/tester/common/bc_tester_utils.h b/tester/common/bc_tester_utils.h index 158f77434..63fd87925 100644 --- a/tester/common/bc_tester_utils.h +++ b/tester/common/bc_tester_utils.h @@ -46,8 +46,16 @@ typedef int (*pre_post_function_t)(void); typedef struct { const char *name; test_function_t func; + const char *tags[2]; } test_t; +#define TEST_NO_TAG(name, func) \ + { name, func, { NULL, NULL } } +#define TEST_ONE_TAG(name, func, tag) \ + { name, func, { tag, NULL } } +#define TEST_TWO_TAGS(name, func, tag1, tag2) \ + { name, func, { tag1, tag2 } } + typedef struct { const char *name; /*suite name*/ pre_post_function_t @@ -89,8 +97,8 @@ void bc_tester_list_suites(void); void bc_tester_list_tests(const char *suite_name); const char * bc_tester_suite_name(int suite_index); const char * bc_tester_test_name(const char *suite_name, int test_index); -int bc_tester_run_suite(test_suite_t *suite); -int bc_tester_run_tests(const char *suite_name, const char *test_name); +int bc_tester_run_suite(test_suite_t *suite, const char *tag_name); +int bc_tester_run_tests(const char *suite_name, const char *test_name, const char *tag_name); int bc_tester_suite_index(const char *suite_name); const char * bc_tester_current_suite_name(void); const char * bc_tester_current_test_name(void); diff --git a/tester/complex_sip_call_tester.c b/tester/complex_sip_call_tester.c index 5e89e020b..09c7e8076 100644 --- a/tester/complex_sip_call_tester.c +++ b/tester/complex_sip_call_tester.c @@ -343,12 +343,12 @@ static void call_invite_200ok_without_contact_header(void) { static test_t tests[] = { - { "SIP UPDATE within incoming reinvite without sdp", sip_update_within_icoming_reinvite_with_no_sdp }, - { "Call with audio mline before video in sdp", call_with_audio_mline_before_video_in_sdp }, - { "Call with video mline before audio in sdp", call_with_video_mline_before_audio_in_sdp }, - { "Call with multiple audio mline in sdp", call_with_multiple_audio_mline_in_sdp }, - { "Call with multiple video mline in sdp", call_with_multiple_video_mline_in_sdp }, - { "Call invite 200ok without contact header", call_invite_200ok_without_contact_header } + TEST_NO_TAG("SIP UPDATE within incoming reinvite without sdp", sip_update_within_icoming_reinvite_with_no_sdp), + TEST_NO_TAG("Call with audio mline before video in sdp", call_with_audio_mline_before_video_in_sdp), + TEST_NO_TAG("Call with video mline before audio in sdp", call_with_video_mline_before_audio_in_sdp), + TEST_NO_TAG("Call with multiple audio mline in sdp", call_with_multiple_audio_mline_in_sdp), + TEST_NO_TAG("Call with multiple video mline in sdp", call_with_multiple_video_mline_in_sdp), + TEST_NO_TAG("Call invite 200ok without contact header", call_invite_200ok_without_contact_header) }; test_suite_t complex_sip_call_test_suite = { diff --git a/tester/dtmf_tester.c b/tester/dtmf_tester.c index e31102304..616002aae 100644 --- a/tester/dtmf_tester.c +++ b/tester/dtmf_tester.c @@ -163,13 +163,13 @@ static void send_dtmf_rfc2833_opus(void) { } test_t dtmf_tests[] = { - { "Send DTMF using RFC2833",send_dtmf_rfc2833}, - { "Send DTMF using SIP INFO",send_dtmf_sip_info}, - { "Send DTMF sequence using RFC2833",send_dtmfs_sequence_rfc2833}, - { "Send DTMF sequence using SIP INFO",send_dtmfs_sequence_sip_info}, - { "DTMF sequence not sent if invalid call",send_dtmfs_sequence_not_ready}, - { "DTMF sequence canceled if call state changed",send_dtmfs_sequence_call_state_changed}, - { "Send DTMF using RFC2833 using Opus",send_dtmf_rfc2833_opus}, + TEST_NO_TAG("Send DTMF using RFC2833",send_dtmf_rfc2833), + TEST_NO_TAG("Send DTMF using SIP INFO",send_dtmf_sip_info), + TEST_NO_TAG("Send DTMF sequence using RFC2833",send_dtmfs_sequence_rfc2833), + TEST_NO_TAG("Send DTMF sequence using SIP INFO",send_dtmfs_sequence_sip_info), + TEST_NO_TAG("DTMF sequence not sent if invalid call",send_dtmfs_sequence_not_ready), + TEST_NO_TAG("DTMF sequence canceled if call state changed",send_dtmfs_sequence_call_state_changed), + TEST_NO_TAG("Send DTMF using RFC2833 using Opus",send_dtmf_rfc2833_opus) }; test_suite_t dtmf_test_suite = {"DTMF", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/eventapi_tester.c b/tester/eventapi_tester.c index 46903f166..a8ada9ba2 100644 --- a/tester/eventapi_tester.c +++ b/tester/eventapi_tester.c @@ -359,15 +359,15 @@ static void publish_without_expires(void){ } test_t event_tests[] = { - { "Subscribe declined" , subscribe_test_declined }, - { "Subscribe terminated by subscriber", subscribe_test_terminated_by_subscriber }, - { "Subscribe with custom headers", subscribe_test_with_custom_header }, - { "Subscribe refreshed", subscribe_test_refreshed }, - { "Subscribe manually refreshed", subscribe_test_manually_refreshed }, - { "Subscribe terminated by notifier", subscribe_test_terminated_by_notifier }, - { "Publish", publish_test }, - { "Publish without expires", publish_without_expires }, - { "Publish without automatic refresh",publish_no_auto_test } + TEST_NO_TAG("Subscribe declined", subscribe_test_declined), + TEST_NO_TAG("Subscribe terminated by subscriber", subscribe_test_terminated_by_subscriber), + TEST_NO_TAG("Subscribe with custom headers", subscribe_test_with_custom_header), + TEST_NO_TAG("Subscribe refreshed", subscribe_test_refreshed), + TEST_NO_TAG("Subscribe manually refreshed", subscribe_test_manually_refreshed), + TEST_NO_TAG("Subscribe terminated by notifier", subscribe_test_terminated_by_notifier), + TEST_NO_TAG("Publish", publish_test), + TEST_NO_TAG("Publish without expires", publish_without_expires), + TEST_NO_TAG("Publish without automatic refresh",publish_no_auto_test) }; test_suite_t event_test_suite = {"Event", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index b75bd04f2..c85c400ea 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -1082,30 +1082,30 @@ static void test_list_subscribe (void) { test_t flexisip_tests[] = { - { "Subscribe forking", subscribe_forking }, - { "Message forking", message_forking }, - { "Message forking with unreachable recipients", message_forking_with_unreachable_recipients }, - { "Message forking with all recipients unreachable", message_forking_with_all_recipients_unreachable}, - { "Call forking", call_forking }, - { "Call forking cancelled", call_forking_cancelled }, - { "Call forking declined globaly", call_forking_declined_globaly }, - { "Call forking declined localy", call_forking_declined_localy }, - { "Call forking with urgent reply", call_forking_with_urgent_reply }, - { "Call forking with push notification (single)", call_forking_with_push_notification_single }, - { "Call forking with push notification (multiple)", call_forking_with_push_notification_multiple }, - { "Call forking not responded", call_forking_not_responded }, - { "Early-media call forking", early_media_call_forking }, - { "Call with sips", call_with_sips }, - { "Call with sips not achievable", call_with_sips_not_achievable }, - { "Call with ipv6", call_with_ipv6 }, - { "Subscribe Notify with sipp publisher", test_subscribe_notify_with_sipp_publisher }, - { "Subscribe Notify with sipp double publish", test_subscribe_notify_with_sipp_publisher_double_publish }, - { "Publish/unpublish", test_publish_unpublish }, - { "List subscribe", test_list_subscribe }, - { "File transfer message rcs to external body client", file_transfer_message_rcs_to_external_body_client }, - { "File transfer message external body to rcs client", file_transfer_message_external_body_to_rcs_client }, - { "File transfer message external body to external body client", file_transfer_message_external_body_to_external_body_client }, - { "DoS module trigger by sending a lot of chat messages", dos_module_trigger } + TEST_NO_TAG("Subscribe forking", subscribe_forking), + TEST_NO_TAG("Message forking", message_forking), + TEST_NO_TAG("Message forking with unreachable recipients", message_forking_with_unreachable_recipients), + TEST_NO_TAG("Message forking with all recipients unreachable", message_forking_with_all_recipients_unreachable), + TEST_NO_TAG("Call forking", call_forking), + TEST_NO_TAG("Call forking cancelled", call_forking_cancelled), + TEST_NO_TAG("Call forking declined globaly", call_forking_declined_globaly), + TEST_NO_TAG("Call forking declined localy", call_forking_declined_localy), + TEST_NO_TAG("Call forking with urgent reply", call_forking_with_urgent_reply), + TEST_NO_TAG("Call forking with push notification (single)", call_forking_with_push_notification_single), + TEST_NO_TAG("Call forking with push notification (multiple)", call_forking_with_push_notification_multiple), + TEST_NO_TAG("Call forking not responded", call_forking_not_responded), + TEST_NO_TAG("Early-media call forking", early_media_call_forking), + TEST_NO_TAG("Call with sips", call_with_sips), + TEST_NO_TAG("Call with sips not achievable", call_with_sips_not_achievable), + TEST_NO_TAG("Call with ipv6", call_with_ipv6), + TEST_NO_TAG("Subscribe Notify with sipp publisher", test_subscribe_notify_with_sipp_publisher), + TEST_NO_TAG("Subscribe Notify with sipp double publish", test_subscribe_notify_with_sipp_publisher_double_publish), + TEST_NO_TAG("Publish/unpublish", test_publish_unpublish), + TEST_NO_TAG("List subscribe", test_list_subscribe), + TEST_NO_TAG("File transfer message rcs to external body client", file_transfer_message_rcs_to_external_body_client), + TEST_NO_TAG("File transfer message external body to rcs client", file_transfer_message_external_body_to_rcs_client), + TEST_NO_TAG("File transfer message external body to external body client", file_transfer_message_external_body_to_external_body_client), + TEST_NO_TAG("DoS module trigger by sending a lot of chat messages", dos_module_trigger) }; test_suite_t flexisip_test_suite = {"Flexisip", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/log_collection_tester.c b/tester/log_collection_tester.c index 1a074b61f..caf96fb31 100644 --- a/tester/log_collection_tester.c +++ b/tester/log_collection_tester.c @@ -317,11 +317,11 @@ static void upload_collected_traces(void) { } test_t log_collection_tests[] = { - { "No file when disabled", collect_files_disabled}, - { "Collect files filled when enabled", collect_files_filled}, - { "Logs collected into small file", collect_files_small_size}, - { "Logs collected when decreasing max size", collect_files_changing_size}, - { "Upload collected traces", upload_collected_traces} + TEST_NO_TAG("No file when disabled", collect_files_disabled), + TEST_NO_TAG("Collect files filled when enabled", collect_files_filled), + TEST_NO_TAG("Logs collected into small file", collect_files_small_size), + TEST_NO_TAG("Logs collected when decreasing max size", collect_files_changing_size), + TEST_NO_TAG("Upload collected traces", upload_collected_traces) }; test_suite_t log_collection_test_suite = {"LogCollection", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/message_tester.c b/tester/message_tester.c index e49d97979..492d74f5f 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -1705,54 +1705,54 @@ void file_transfer_with_http_proxy(void) { } test_t message_tests[] = { - {"Text message", text_message}, - {"Text message within call dialog", text_message_within_call_dialog}, - {"Text message with credentials from auth callback", text_message_with_credential_from_auth_callback}, - {"Text message with privacy", text_message_with_privacy}, - {"Text message compatibility mode", text_message_compatibility_mode}, - {"Text message with ack", text_message_with_ack}, - {"Text message with send error", text_message_with_send_error}, - {"Text message with external body", text_message_with_external_body}, - {"Transfer message", transfer_message}, - {"Transfer message with http proxy", file_transfer_with_http_proxy}, - {"Transfer message with upload io error", transfer_message_with_upload_io_error}, - {"Transfer message with download io error", transfer_message_with_download_io_error}, - {"Transfer message upload cancelled", transfer_message_upload_cancelled}, - {"Transfer message download cancelled", transfer_message_download_cancelled}, - {"Transfer message using external body url", file_transfer_using_external_body_url}, - {"Transfer 2 messages simultaneously", file_transfer_2_messages_simultaneously}, - {"Text message denied", text_message_denied}, - {"Info message", info_message}, - {"Info message with body", info_message_with_body}, - {"IsComposing notification", is_composing_notification}, + TEST_NO_TAG("Text message", text_message), + TEST_NO_TAG("Text message within call dialog", text_message_within_call_dialog), + TEST_NO_TAG("Text message with credentials from auth callback", text_message_with_credential_from_auth_callback), + TEST_NO_TAG("Text message with privacy", text_message_with_privacy), + TEST_NO_TAG("Text message compatibility mode", text_message_compatibility_mode), + TEST_NO_TAG("Text message with ack", text_message_with_ack), + TEST_NO_TAG("Text message with send error", text_message_with_send_error), + TEST_NO_TAG("Text message with external body", text_message_with_external_body), + TEST_NO_TAG("Transfer message", transfer_message), + TEST_NO_TAG("Transfer message with http proxy", file_transfer_with_http_proxy), + TEST_NO_TAG("Transfer message with upload io error", transfer_message_with_upload_io_error), + TEST_NO_TAG("Transfer message with download io error", transfer_message_with_download_io_error), + TEST_NO_TAG("Transfer message upload cancelled", transfer_message_upload_cancelled), + TEST_NO_TAG("Transfer message download cancelled", transfer_message_download_cancelled), + TEST_NO_TAG("Transfer message using external body url", file_transfer_using_external_body_url), + TEST_NO_TAG("Transfer 2 messages simultaneously", file_transfer_2_messages_simultaneously), + TEST_NO_TAG("Text message denied", text_message_denied), + TEST_NO_TAG("Info message", info_message), + TEST_NO_TAG("Info message with body", info_message_with_body), + TEST_NO_TAG("IsComposing notification", is_composing_notification), #ifdef HAVE_LIME - {"Lime text message", lime_text_message}, - {"Lime text message to non lime", lime_text_message_to_non_lime}, - {"Lime transfer message", lime_transfer_message}, - {"Lime transfer message without encryption", lime_transfer_message_without_encryption}, - {"Lime unitary", lime_unit}, + TEST_NO_TAG("Lime text message", lime_text_message), + TEST_NO_TAG("Lime text message to non lime", lime_text_message_to_non_lime), + TEST_NO_TAG("Lime transfer message", lime_transfer_message), + TEST_NO_TAG("Lime transfer message without encryption", lime_transfer_message_without_encryption), + TEST_NO_TAG("Lime unitary", lime_unit), #endif /* HAVE_LIME */ #ifdef MSG_STORAGE_ENABLED - {"Database migration", database_migration}, - {"History range", history_range}, - {"History count", history_count}, + TEST_NO_TAG("Database migration", database_migration), + TEST_NO_TAG("History range", history_range), + TEST_NO_TAG("History count", history_count), #endif - {"Text status after destroying chat room", text_status_after_destroying_chat_room}, - {"Transfer not sent if invalid url", file_transfer_not_sent_if_invalid_url}, - {"Transfer not sent if host not found", file_transfer_not_sent_if_host_not_found}, - {"Transfer not sent if url moved permanently", file_transfer_not_sent_if_url_moved_permanently}, - {"Transfer io error after destroying chatroom", file_transfer_io_error_after_destroying_chatroom}, - {"Real Time Text message", real_time_text_message}, - {"Real Time Text conversation", real_time_text_conversation}, - {"Real Time Text without audio", real_time_text_without_audio}, - {"Real Time Text with srtp", real_time_text_srtp}, - {"Real Time Text with ice", real_time_text_ice}, - {"Real Time Text message compatibility crlf", real_time_text_message_compat_crlf}, - {"Real Time Text message compatibility lf", real_time_text_message_compat_lf}, - {"Real Time Text message with accented characters", real_time_text_message_accented_chars}, - {"Real Time Text offer answer with different payload numbers (sender side)", real_time_text_message_different_text_codecs_payload_numbers_sender_side}, - {"Real Time Text offer answer with different payload numbers (receiver side)", real_time_text_message_different_text_codecs_payload_numbers_receiver_side}, - {"Real Time Text copy paste", real_time_text_copy_paste}, + TEST_NO_TAG("Text status after destroying chat room", text_status_after_destroying_chat_room), + TEST_NO_TAG("Transfer not sent if invalid url", file_transfer_not_sent_if_invalid_url), + TEST_NO_TAG("Transfer not sent if host not found", file_transfer_not_sent_if_host_not_found), + TEST_NO_TAG("Transfer not sent if url moved permanently", file_transfer_not_sent_if_url_moved_permanently), + TEST_NO_TAG("Transfer io error after destroying chatroom", file_transfer_io_error_after_destroying_chatroom), + TEST_NO_TAG("Real Time Text message", real_time_text_message), + 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), + TEST_NO_TAG("Real Time Text with ice", real_time_text_ice), + TEST_NO_TAG("Real Time Text message compatibility crlf", real_time_text_message_compat_crlf), + TEST_NO_TAG("Real Time Text message compatibility lf", real_time_text_message_compat_lf), + TEST_NO_TAG("Real Time Text message with accented characters", real_time_text_message_accented_chars), + TEST_NO_TAG("Real Time Text offer answer with different payload numbers (sender side)", real_time_text_message_different_text_codecs_payload_numbers_sender_side), + TEST_NO_TAG("Real Time Text offer answer with different payload numbers (receiver side)", real_time_text_message_different_text_codecs_payload_numbers_receiver_side), + TEST_NO_TAG("Real Time Text copy paste", real_time_text_copy_paste), }; test_suite_t message_test_suite = { diff --git a/tester/multi_call_tester.c b/tester/multi_call_tester.c index 8a6d9aff6..58474c041 100644 --- a/tester/multi_call_tester.c +++ b/tester/multi_call_tester.c @@ -825,22 +825,22 @@ void eject_from_3_participants_remote_conference(void) { } test_t multi_call_tests[] = { - { "Call waiting indication", call_waiting_indication }, - { "Call waiting indication with privacy", call_waiting_indication_with_privacy }, - { "Incoming call accepted when outgoing call in progress", incoming_call_accepted_when_outgoing_call_in_progress}, - { "Incoming call accepted when outgoing call in outgoing ringing", incoming_call_accepted_when_outgoing_call_in_outgoing_ringing}, - { "Incoming call accepted when outgoing call in outgoing ringing early media", incoming_call_accepted_when_outgoing_call_in_outgoing_ringing_early_media}, - { "Simple conference", simple_conference }, - { "Simple conference with ICE", simple_conference_with_ice}, - { "Simple ZRTP conference with ICE",simple_zrtp_conference_with_ice}, - { "Eject from 3 participants conference", eject_from_3_participants_local_conference }, - { "Eject from 4 participants conference", eject_from_4_participants_conference }, - { "Simple call transfer", simple_call_transfer }, - { "Unattended call transfer", unattended_call_transfer }, - { "Unattended call transfer with error", unattended_call_transfer_with_error }, - { "Call transfer existing call outgoing call", call_transfer_existing_call_outgoing_call }, - { "Simple remote conference", simple_remote_conference }, - { "Eject from 3 participants in remote conference", eject_from_3_participants_remote_conference } + TEST_NO_TAG("Call waiting indication", call_waiting_indication), + TEST_NO_TAG("Call waiting indication with privacy", call_waiting_indication_with_privacy), + TEST_NO_TAG("Incoming call accepted when outgoing call in progress", incoming_call_accepted_when_outgoing_call_in_progress), + TEST_NO_TAG("Incoming call accepted when outgoing call in outgoing ringing", incoming_call_accepted_when_outgoing_call_in_outgoing_ringing), + TEST_NO_TAG("Incoming call accepted when outgoing call in outgoing ringing early media", incoming_call_accepted_when_outgoing_call_in_outgoing_ringing_early_media), + TEST_NO_TAG("Simple conference", simple_conference), + TEST_ONE_TAG("Simple conference with ICE", simple_conference_with_ice, "ICE"), + TEST_ONE_TAG("Simple ZRTP conference with ICE", simple_zrtp_conference_with_ice, "ICE"), + TEST_NO_TAG("Eject from 3 participants conference", eject_from_3_participants_local_conference), + TEST_NO_TAG("Eject from 4 participants conference", eject_from_4_participants_conference), + TEST_NO_TAG("Simple call transfer", simple_call_transfer), + TEST_NO_TAG("Unattended call transfer", unattended_call_transfer), + TEST_NO_TAG("Unattended call transfer with error", unattended_call_transfer_with_error), + TEST_NO_TAG("Call transfer existing call outgoing call", call_transfer_existing_call_outgoing_call), + TEST_NO_TAG("Simple remote conference", simple_remote_conference), + TEST_NO_TAG("Eject from 3 participants in remote conference", eject_from_3_participants_remote_conference) }; test_suite_t multi_call_test_suite = {"Multi call", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/multicast_call_tester.c b/tester/multicast_call_tester.c index 8d9123ad3..242be7664 100644 --- a/tester/multicast_call_tester.c +++ b/tester/multicast_call_tester.c @@ -244,13 +244,13 @@ static void early_media_with_multicast_video(void) { #endif test_t multicast_call_tests[] = { - { "Multicast audio call",call_multicast}, - { "Multicast call with pause/resume",multicast_audio_with_pause_resume}, - { "Early media multicast audio call",early_media_with_multicast_audio}, - { "Unicast incoming call with multicast activated",unicast_incoming_with_multicast_audio_on}, + TEST_NO_TAG("Multicast audio call",call_multicast), + TEST_NO_TAG("Multicast call with pause/resume",multicast_audio_with_pause_resume), + TEST_NO_TAG("Early media multicast audio call",early_media_with_multicast_audio), + TEST_NO_TAG("Unicast incoming call with multicast activated",unicast_incoming_with_multicast_audio_on), #ifdef VIDEO_ENABLED - { "Multicast video call",call_multicast_video}, - { "Early media multicast video call",early_media_with_multicast_video}, + TEST_NO_TAG("Multicast video call",call_multicast_video), + TEST_NO_TAG("Early media multicast video call",early_media_with_multicast_video), #endif }; diff --git a/tester/offeranswer_tester.c b/tester/offeranswer_tester.c index e40849aff..138bae80c 100644 --- a/tester/offeranswer_tester.c +++ b/tester/offeranswer_tester.c @@ -489,55 +489,55 @@ end: #endif static test_t offeranswer_tests[] = { - { "Start with no config", start_with_no_config }, - { "Call failed because of codecs", call_failed_because_of_codecs }, - { "Simple call with different codec mappings", simple_call_with_different_codec_mappings}, - { "AVP to AVP call", avp_to_avp_call }, - { "AVP to AVPF call", avp_to_avpf_call }, - { "AVP to SAVP call", avp_to_savp_call }, - { "AVP to SAVPF call", avp_to_savpf_call }, - { "AVPF to AVP call", avpf_to_avp_call }, - { "AVPF to AVPF call", avpf_to_avpf_call }, - { "AVPF to SAVP call", avpf_to_savp_call }, - { "AVPF to SAVPF call", avpf_to_savpf_call }, - { "SAVP to AVP call", savp_to_avp_call }, - { "SAVP to AVPF call", savp_to_avpf_call }, - { "SAVP to SAVP call", savp_to_savp_call }, - { "SAVP to SAVPF call", savp_to_savpf_call }, - { "SAVPF to AVP call", savpf_to_avp_call }, - { "SAVPF to AVPF call", savpf_to_avpf_call }, - { "SAVPF to SAVP call", savpf_to_savp_call }, - { "SAVPF to SAVPF call", savpf_to_savpf_call }, - { "SAVPF/DTLS to SAVPF/DTLS call", savpf_dtls_to_savpf_dtls_call}, - { "SAVPF/DTLS to SAVPF/DTLS encryption mandatory call", savpf_dtls_to_savpf_dtls_encryption_mandatory_call}, - { "SAVPF/DTLS to SAVPF call", savpf_dtls_to_savpf_call}, - { "SAVPF/DTLS to SAVPF encryption mandatory call", savpf_dtls_to_savpf_encryption_mandatory_call}, - { "SAVPF/DTLS to AVPF call", savpf_dtls_to_avpf_call}, + TEST_NO_TAG("Start with no config", start_with_no_config), + TEST_NO_TAG("Call failed because of codecs", call_failed_because_of_codecs), + TEST_NO_TAG("Simple call with different codec mappings", simple_call_with_different_codec_mappings), + TEST_NO_TAG("AVP to AVP call", avp_to_avp_call), + TEST_NO_TAG("AVP to AVPF call", avp_to_avpf_call), + TEST_NO_TAG("AVP to SAVP call", avp_to_savp_call), + TEST_NO_TAG("AVP to SAVPF call", avp_to_savpf_call), + TEST_NO_TAG("AVPF to AVP call", avpf_to_avp_call), + TEST_NO_TAG("AVPF to AVPF call", avpf_to_avpf_call), + TEST_NO_TAG("AVPF to SAVP call", avpf_to_savp_call), + TEST_NO_TAG("AVPF to SAVPF call", avpf_to_savpf_call), + TEST_NO_TAG("SAVP to AVP call", savp_to_avp_call), + TEST_NO_TAG("SAVP to AVPF call", savp_to_avpf_call), + TEST_NO_TAG("SAVP to SAVP call", savp_to_savp_call), + TEST_NO_TAG("SAVP to SAVPF call", savp_to_savpf_call), + TEST_NO_TAG("SAVPF to AVP call", savpf_to_avp_call), + TEST_NO_TAG("SAVPF to AVPF call", savpf_to_avpf_call), + TEST_NO_TAG("SAVPF to SAVP call", savpf_to_savp_call), + TEST_NO_TAG("SAVPF to SAVPF call", savpf_to_savpf_call), + TEST_NO_TAG("SAVPF/DTLS to SAVPF/DTLS call", savpf_dtls_to_savpf_dtls_call), + TEST_NO_TAG("SAVPF/DTLS to SAVPF/DTLS encryption mandatory call", savpf_dtls_to_savpf_dtls_encryption_mandatory_call), + TEST_NO_TAG("SAVPF/DTLS to SAVPF call", savpf_dtls_to_savpf_call), + TEST_NO_TAG("SAVPF/DTLS to SAVPF encryption mandatory call", savpf_dtls_to_savpf_encryption_mandatory_call), + TEST_NO_TAG("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}, + TEST_NO_TAG("AVP to AVP video call", avp_to_avp_video_call), + TEST_NO_TAG("AVP to AVPF video call", avp_to_avpf_video_call), + TEST_NO_TAG("AVP to SAVP video call", avp_to_savp_video_call), + TEST_NO_TAG("AVP to SAVPF video call", avp_to_savpf_video_call), + TEST_NO_TAG("AVPF to AVP video call", avpf_to_avp_video_call), + TEST_NO_TAG("AVPF to AVPF video call", avpf_to_avpf_video_call), + TEST_NO_TAG("AVPF to SAVP video call", avpf_to_savp_video_call), + TEST_NO_TAG("AVPF to SAVPF video call", avpf_to_savpf_video_call), + TEST_NO_TAG("SAVP to AVP video call", savp_to_avp_video_call), + TEST_NO_TAG("SAVP to AVPF video call", savp_to_avpf_video_call), + TEST_NO_TAG("SAVP to SAVP video call", savp_to_savp_video_call), + TEST_NO_TAG("SAVP to SAVPF video call", savp_to_savpf_video_call), + TEST_NO_TAG("SAVPF to AVP video call", savpf_to_avp_video_call), + TEST_NO_TAG("SAVPF to AVPF video call", savpf_to_avpf_video_call), + TEST_NO_TAG("SAVPF to SAVP video call", savpf_to_savp_video_call), + TEST_NO_TAG("SAVPF to SAVPF video call", savpf_to_savpf_video_call), + TEST_NO_TAG("SAVPF/DTLS to SAVPF/DTLS video call", savpf_dtls_to_savpf_dtls_video_call), + TEST_NO_TAG("SAVPF/DTLS to SAVPF/DTLS encryption mandatory video call", savpf_dtls_to_savpf_dtls_encryption_mandatory_video_call), + TEST_NO_TAG("SAVPF/DTLS to SAVPF video call", savpf_dtls_to_savpf_video_call), + TEST_NO_TAG("SAVPF/DTLS to SAVPF encryption mandatory video call", savpf_dtls_to_savpf_encryption_mandatory_video_call), + TEST_NO_TAG("SAVPF/DTLS to AVPF call", savpf_dtls_to_avpf_video_call), - { "Compatible AVPF features", compatible_avpf_features }, - { "Incompatible AVPF features", incompatible_avpf_features }, + TEST_NO_TAG("Compatible AVPF features", compatible_avpf_features), + TEST_NO_TAG("Incompatible AVPF features", incompatible_avpf_features) #endif }; diff --git a/tester/player_tester.c b/tester/player_tester.c index f5c0c3cb9..3354c5fa2 100644 --- a/tester/player_tester.c +++ b/tester/player_tester.c @@ -98,9 +98,9 @@ static void sintel_trailer_opus_vp8_test(void) { } test_t player_tests[] = { - { "Sintel trailer opus/h264" , sintel_trailer_opus_h264_test }, - { "Sintel trailer pcmu/h264" , sintel_trailer_pcmu_h264_test }, - { "Sintel trailer opus/VP8" , sintel_trailer_opus_vp8_test } + TEST_NO_TAG("Sintel trailer opus/h264", sintel_trailer_opus_h264_test), + TEST_NO_TAG("Sintel trailer pcmu/h264", sintel_trailer_pcmu_h264_test), + TEST_NO_TAG("Sintel trailer opus/VP8", sintel_trailer_opus_vp8_test) }; test_suite_t player_test_suite = {"Player", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/presence_tester.c b/tester/presence_tester.c index 9abda838c..6b4060e0b 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -774,22 +774,22 @@ static void test_presence_list_subscription_expire(void) { test_t presence_tests[] = { - { "Simple Subscribe", simple_subscribe }, - { "Simple Publish", simple_publish }, - { "Simple Publish with expires", publish_with_expires }, - /*{ "Call with presence", call_with_presence },*/ - { "Unsubscribe while subscribing", unsubscribe_while_subscribing }, - { "Presence information", presence_information }, - { "App managed presence failure", subscribe_failure_handle_by_app }, - { "Presence SUBSCRIBE forked", subscribe_presence_forked }, - { "Presence SUBSCRIBE expired", subscribe_presence_expired }, + TEST_NO_TAG("Simple Subscribe", simple_subscribe), + TEST_NO_TAG("Simple Publish", simple_publish), + TEST_NO_TAG("Simple Publish with expires", publish_with_expires), + /*TEST_NO_TAG("Call with presence", call_with_presence),*/ + TEST_NO_TAG("Unsubscribe while subscribing", unsubscribe_while_subscribing), + TEST_NO_TAG("Presence information", presence_information), + TEST_NO_TAG("App managed presence failure", subscribe_failure_handle_by_app), + TEST_NO_TAG("Presence SUBSCRIBE forked", subscribe_presence_forked), + TEST_NO_TAG("Presence SUBSCRIBE expired", subscribe_presence_expired), #if USE_PRESENCE_SERVER - { "Subscribe with late publish", test_subscribe_notify_publish }, - { "Forked subscribe with late publish", test_forked_subscribe_notify_publish }, + TEST_NO_TAG("Subscribe with late publish", test_subscribe_notify_publish), + TEST_NO_TAG("Forked subscribe with late publish", test_forked_subscribe_notify_publish), #endif - { "Presence list", test_presence_list }, - { "Presence list (subscribe before publish)", test_presence_list_subscribe_before_publish }, - { "Presence list, subscription expiration",test_presence_list_subscription_expire} + TEST_NO_TAG("Presence list", test_presence_list), + TEST_NO_TAG("Presence list (subscribe before publish)", test_presence_list_subscribe_before_publish), + TEST_NO_TAG("Presence list, subscription expiration",test_presence_list_subscription_expire) }; test_suite_t presence_test_suite = {"Presence", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/proxy_config_tester.c b/tester/proxy_config_tester.c index 771403e84..755f63de5 100644 --- a/tester/proxy_config_tester.c +++ b/tester/proxy_config_tester.c @@ -173,10 +173,10 @@ static void sip_uri_normalization(void) { } test_t proxy_config_tests[] = { - { "Phone normalization without proxy", phone_normalization_without_proxy }, - { "Phone normalization with proxy", phone_normalization_with_proxy }, - { "Phone normalization with dial escape plus", phone_normalization_with_dial_escape_plus }, - { "SIP URI normalization", sip_uri_normalization }, + TEST_NO_TAG("Phone normalization without proxy", phone_normalization_without_proxy), + TEST_NO_TAG("Phone normalization with proxy", phone_normalization_with_proxy), + TEST_NO_TAG("Phone normalization with dial escape plus", phone_normalization_with_dial_escape_plus), + TEST_NO_TAG("SIP URI normalization", sip_uri_normalization) }; test_suite_t proxy_config_test_suite = {"Proxy config", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/quality_reporting_tester.c b/tester/quality_reporting_tester.c index 1810b058d..ec321b2dd 100644 --- a/tester/quality_reporting_tester.c +++ b/tester/quality_reporting_tester.c @@ -424,17 +424,17 @@ static void quality_reporting_interval_report_video_and_rtt(void) { #endif test_t quality_reporting_tests[] = { - { "Not used if no config", quality_reporting_not_used_without_config}, - { "Call term session report not sent if call did not start", quality_reporting_not_sent_if_call_not_started}, - { "Call term session report not sent if low bandwidth", quality_reporting_not_sent_if_low_bandwidth}, - { "Call term session report invalid if missing mandatory fields", quality_reporting_invalid_report}, - { "Call term session report sent if call ended normally", quality_reporting_at_call_termination}, - { "Interval report if interval is configured", quality_reporting_interval_report}, + TEST_NO_TAG("Not used if no config", quality_reporting_not_used_without_config), + TEST_NO_TAG("Call term session report not sent if call did not start", quality_reporting_not_sent_if_call_not_started), + TEST_NO_TAG("Call term session report not sent if low bandwidth", quality_reporting_not_sent_if_low_bandwidth), + TEST_NO_TAG("Call term session report invalid if missing mandatory fields", quality_reporting_invalid_report), + TEST_NO_TAG("Call term session report sent if call ended normally", quality_reporting_at_call_termination), + TEST_NO_TAG("Interval report if interval is configured", quality_reporting_interval_report), #ifdef VIDEO_ENABLED - { "Interval report if interval is configured with video and realtime text", quality_reporting_interval_report_video_and_rtt}, - { "Session report sent if video stopped during call", quality_reporting_session_report_if_video_stopped}, + TEST_NO_TAG("Interval report if interval is configured with video and realtime text", quality_reporting_interval_report_video_and_rtt), + TEST_NO_TAG("Session report sent if video stopped during call", quality_reporting_session_report_if_video_stopped), #endif - { "Sent using custom route", quality_reporting_sent_using_custom_route}, + TEST_NO_TAG("Sent using custom route", quality_reporting_sent_using_custom_route) }; test_suite_t quality_reporting_test_suite = {"QualityReporting", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/register_tester.c b/tester/register_tester.c index 4a9282ebf..4397b3011 100644 --- a/tester/register_tester.c +++ b/tester/register_tester.c @@ -900,40 +900,40 @@ static void redirect(void){ } test_t register_tests[] = { - { "Simple register", simple_register }, - { "Simple register unregister", simple_unregister }, - { "TCP register", simple_tcp_register }, - { "Register with custom headers", register_with_custom_headers }, - { "TCP register compatibility mode", simple_tcp_register_compatibility_mode }, - { "TLS register", simple_tls_register }, - { "TLS register with alt. name certificate", tls_alt_name_register }, - { "TLS register with wildcard certificate", tls_wildcard_register }, - { "TLS certificate not verified",tls_certificate_failure}, - { "TLS with non tls server",tls_with_non_tls_server}, - { "Simple authenticated register", simple_authenticated_register }, - { "Ha1 authenticated register", ha1_authenticated_register }, - { "Digest auth without initial credentials", authenticated_register_with_no_initial_credentials }, - { "Digest auth with wrong credentials", authenticated_register_with_wrong_credentials }, - { "Digest auth with wrong credentials, check if registration attempts are stopped", authenticated_register_with_wrong_credentials_2 }, - { "Digest auth with wrong credentials without 403", authenticated_register_with_wrong_credentials_without_403}, - { "Authenticated register with wrong late credentials", authenticated_register_with_wrong_late_credentials}, - { "Authenticated register with late credentials", authenticated_register_with_late_credentials }, - { "Authenticated register with provided credentials", authenticated_register_with_provided_credentials }, - { "Register with refresh", simple_register_with_refresh }, - { "Authenticated register with refresh", simple_auth_register_with_refresh }, - { "Register with refresh and send error", register_with_refresh_with_send_error }, - { "Multi account", multiple_proxy }, - { "Transport changes", transport_change }, - { "Proxy transport changes", proxy_transport_change}, - { "Proxy transport changes with wrong address at first", proxy_transport_change_with_wrong_port}, - { "Proxy transport changes with wrong address, giving up",proxy_transport_change_with_wrong_port_givin_up}, - { "Change expires", change_expires}, - { "Network state change", network_state_change }, - { "Io recv error", io_recv_error }, - { "Io recv error with recovery", io_recv_error_retry_immediatly}, - { "Io recv error with late recovery", io_recv_error_late_recovery}, - { "Io recv error without active registration", io_recv_error_without_active_register}, - { "Simple redirect", redirect} + TEST_NO_TAG("Simple register", simple_register), + TEST_NO_TAG("Simple register unregister", simple_unregister), + TEST_NO_TAG("TCP register", simple_tcp_register), + TEST_NO_TAG("Register with custom headers", register_with_custom_headers), + TEST_NO_TAG("TCP register compatibility mode", simple_tcp_register_compatibility_mode), + TEST_NO_TAG("TLS register", simple_tls_register), + TEST_NO_TAG("TLS register with alt. name certificate", tls_alt_name_register), + TEST_NO_TAG("TLS register with wildcard certificate", tls_wildcard_register), + TEST_NO_TAG("TLS certificate not verified",tls_certificate_failure), + TEST_NO_TAG("TLS with non tls server",tls_with_non_tls_server), + TEST_NO_TAG("Simple authenticated register", simple_authenticated_register), + TEST_NO_TAG("Ha1 authenticated register", ha1_authenticated_register), + TEST_NO_TAG("Digest auth without initial credentials", authenticated_register_with_no_initial_credentials), + TEST_NO_TAG("Digest auth with wrong credentials", authenticated_register_with_wrong_credentials), + TEST_NO_TAG("Digest auth with wrong credentials, check if registration attempts are stopped", authenticated_register_with_wrong_credentials_2), + TEST_NO_TAG("Digest auth with wrong credentials without 403", authenticated_register_with_wrong_credentials_without_403), + TEST_NO_TAG("Authenticated register with wrong late credentials", authenticated_register_with_wrong_late_credentials), + TEST_NO_TAG("Authenticated register with late credentials", authenticated_register_with_late_credentials), + TEST_NO_TAG("Authenticated register with provided credentials", authenticated_register_with_provided_credentials), + TEST_NO_TAG("Register with refresh", simple_register_with_refresh), + TEST_NO_TAG("Authenticated register with refresh", simple_auth_register_with_refresh), + TEST_NO_TAG("Register with refresh and send error", register_with_refresh_with_send_error), + TEST_NO_TAG("Multi account", multiple_proxy), + TEST_NO_TAG("Transport changes", transport_change), + TEST_NO_TAG("Proxy transport changes", proxy_transport_change), + TEST_NO_TAG("Proxy transport changes with wrong address at first", proxy_transport_change_with_wrong_port), + TEST_NO_TAG("Proxy transport changes with wrong address, giving up",proxy_transport_change_with_wrong_port_givin_up), + TEST_NO_TAG("Change expires", change_expires), + TEST_NO_TAG("Network state change", network_state_change), + TEST_NO_TAG("Io recv error", io_recv_error), + TEST_NO_TAG("Io recv error with recovery", io_recv_error_retry_immediatly), + TEST_NO_TAG("Io recv error with late recovery", io_recv_error_late_recovery), + TEST_NO_TAG("Io recv error without active registration", io_recv_error_without_active_register), + TEST_NO_TAG("Simple redirect", redirect) }; test_suite_t register_test_suite = {"Register", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/remote_provisioning_tester.c b/tester/remote_provisioning_tester.c index 9bb1e41bf..76a81ab16 100644 --- a/tester/remote_provisioning_tester.c +++ b/tester/remote_provisioning_tester.c @@ -125,15 +125,15 @@ static void remote_provisioning_file(void) { test_t remote_provisioning_tests[] = { - { "Remote provisioning skipped", remote_provisioning_skipped }, - { "Remote provisioning successful behind http", remote_provisioning_http }, - { "Remote provisioning successful behind https", remote_provisioning_https }, - { "Remote provisioning 404 not found", remote_provisioning_not_found }, - { "Remote provisioning invalid", remote_provisioning_invalid }, - { "Remote provisioning transient successful", remote_provisioning_transient }, - { "Remote provisioning default values", remote_provisioning_default_values }, - { "Remote provisioning from file", remote_provisioning_file }, - { "Remote provisioning invalid URI", remote_provisioning_invalid_uri } + TEST_NO_TAG("Remote provisioning skipped", remote_provisioning_skipped), + TEST_NO_TAG("Remote provisioning successful behind http", remote_provisioning_http), + TEST_NO_TAG("Remote provisioning successful behind https", remote_provisioning_https), + TEST_NO_TAG("Remote provisioning 404 not found", remote_provisioning_not_found), + TEST_NO_TAG("Remote provisioning invalid", remote_provisioning_invalid), + TEST_NO_TAG("Remote provisioning transient successful", remote_provisioning_transient), + TEST_NO_TAG("Remote provisioning default values", remote_provisioning_default_values), + TEST_NO_TAG("Remote provisioning from file", remote_provisioning_file), + TEST_NO_TAG("Remote provisioning invalid URI", remote_provisioning_invalid_uri) }; test_suite_t remote_provisioning_test_suite = {"RemoteProvisioning", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/setup_tester.c b/tester/setup_tester.c index f41324d3f..7fc17c513 100644 --- a/tester/setup_tester.c +++ b/tester/setup_tester.c @@ -330,20 +330,20 @@ end: } test_t setup_tests[] = { - { "Version check", linphone_version_test }, - { "Linphone Address", linphone_address_test }, - { "Linphone proxy config address equal (internal api)", linphone_proxy_config_address_equal_test}, - { "Linphone proxy config server address change (internal api)", linphone_proxy_config_is_server_config_changed_test}, - { "Linphone core init/uninit", core_init_test }, - { "Linphone random transport port",core_sip_transport_test}, - { "Linphone interpret url", linphone_interpret_url_test }, - { "LPConfig from buffer", linphone_lpconfig_from_buffer }, - { "LPConfig zero_len value from buffer", linphone_lpconfig_from_buffer_zerolen_value }, - { "LPConfig zero_len value from file", linphone_lpconfig_from_file_zerolen_value }, - { "LPConfig zero_len value from XML", linphone_lpconfig_from_xml_zerolen_value }, - { "Chat room", chat_room_test }, - { "Devices reload", devices_reload_test }, - { "Codec usability", codec_usability_test } + TEST_NO_TAG("Version check", linphone_version_test), + TEST_NO_TAG("Linphone Address", linphone_address_test), + TEST_NO_TAG("Linphone proxy config address equal (internal api)", linphone_proxy_config_address_equal_test), + TEST_NO_TAG("Linphone proxy config server address change (internal api)", linphone_proxy_config_is_server_config_changed_test), + TEST_NO_TAG("Linphone core init/uninit", core_init_test), + TEST_NO_TAG("Linphone random transport port",core_sip_transport_test), + TEST_NO_TAG("Linphone interpret url", linphone_interpret_url_test), + TEST_NO_TAG("LPConfig from buffer", linphone_lpconfig_from_buffer), + TEST_NO_TAG("LPConfig zero_len value from buffer", linphone_lpconfig_from_buffer_zerolen_value), + TEST_NO_TAG("LPConfig zero_len value from file", linphone_lpconfig_from_file_zerolen_value), + TEST_NO_TAG("LPConfig zero_len value from XML", linphone_lpconfig_from_xml_zerolen_value), + TEST_NO_TAG("Chat room", chat_room_test), + TEST_NO_TAG("Devices reload", devices_reload_test), + TEST_NO_TAG("Codec usability", codec_usability_test) }; test_suite_t setup_test_suite = {"Setup", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/stun_tester.c b/tester/stun_tester.c index 38da6fe16..e52927386 100644 --- a/tester/stun_tester.c +++ b/tester/stun_tester.c @@ -115,8 +115,8 @@ static void linphone_stun_test_grab_ip(void) test_t stun_tests[] = { - { "Basic Stun test (Ping/public IP)", linphone_stun_test_grab_ip }, - { "STUN encode buffer protection", linphone_stun_test_encode }, + TEST_NO_TAG("Basic Stun test (Ping/public IP)", linphone_stun_test_grab_ip), + TEST_NO_TAG("STUN encode buffer protection", linphone_stun_test_encode) }; test_suite_t stun_test_suite = {"Stun", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/tunnel_tester.c b/tester/tunnel_tester.c index f3d383cf2..8ed406a26 100644 --- a/tester/tunnel_tester.c +++ b/tester/tunnel_tester.c @@ -245,20 +245,20 @@ static void tunnel_ice_call(void) { ms_warning("Could not test %s because tunnel functionality is not available",__FUNCTION__); } test_t tunnel_tests[] = { - { "Simple", call_with_tunnel }, - { "With SRTP", call_with_tunnel_srtp }, - { "Without SIP", call_with_tunnel_without_sip }, - { "In automatic mode", call_with_tunnel_auto }, - { "In automatic mode with SRTP without SIP", call_with_tunnel_auto_without_sip_with_srtp }, - { "Ice call", tunnel_ice_call }, - { "SRTP ice call", tunnel_srtp_ice_call }, - { "ZRTP ice call", tunnel_zrtp_ice_call }, + TEST_NO_TAG("Simple", call_with_tunnel), + TEST_NO_TAG("With SRTP", call_with_tunnel_srtp), + TEST_NO_TAG("Without SIP", call_with_tunnel_without_sip), + TEST_NO_TAG("In automatic mode", call_with_tunnel_auto), + TEST_NO_TAG("In automatic mode with SRTP without SIP", call_with_tunnel_auto_without_sip_with_srtp), + TEST_NO_TAG("Ice call", tunnel_ice_call), + TEST_NO_TAG("SRTP ice call", tunnel_srtp_ice_call), + TEST_NO_TAG("ZRTP ice call", tunnel_zrtp_ice_call), #ifdef VIDEO_ENABLED - { "Ice video call", tunnel_video_ice_call }, - { "With SIP - ice video call", full_tunnel_video_ice_call }, - { "SRTP ice video call", tunnel_srtp_video_ice_call }, - { "DTLS ice video call", tunnel_dtls_video_ice_call }, - { "ZRTP ice video call", tunnel_zrtp_video_ice_call }, + TEST_NO_TAG("Ice video call", tunnel_video_ice_call), + TEST_NO_TAG("With SIP - ice video call", full_tunnel_video_ice_call), + TEST_NO_TAG("SRTP ice video call", tunnel_srtp_video_ice_call), + TEST_NO_TAG("DTLS ice video call", tunnel_dtls_video_ice_call), + TEST_NO_TAG("ZRTP ice video call", tunnel_zrtp_video_ice_call), #endif }; diff --git a/tester/upnp_tester.c b/tester/upnp_tester.c index bef3a626f..b915606bb 100644 --- a/tester/upnp_tester.c +++ b/tester/upnp_tester.c @@ -54,9 +54,9 @@ static void upnp_check_ipaddress(void) { } test_t upnp_tests[] = { - { "Start and stop", upnp_start_n_stop }, - { "Check state", upnp_check_state }, - { "Check ip address", upnp_check_ipaddress }, + TEST_NO_TAG("Start and stop", upnp_start_n_stop), + TEST_NO_TAG("Check state", upnp_check_state), + TEST_NO_TAG("Check ip address", upnp_check_ipaddress) }; test_suite_t upnp_test_suite = {"Upnp", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/video_tester.c b/tester/video_tester.c index 6dc165bf6..fb732731b 100644 --- a/tester/video_tester.c +++ b/tester/video_tester.c @@ -552,12 +552,12 @@ static void enable_disable_camera_after_camera_switches(void) { } test_t video_tests[] = { #if HAVE_GTK - { "Early-media video during video call", early_media_video_during_video_call_test }, - { "Two incoming early-media video calls", two_incoming_early_media_video_calls_test }, - { "Early-media video with inactive audio", early_media_video_with_inactive_audio }, - { "Forked outgoing early-media video call with inactive audio", forked_outgoing_early_media_video_call_with_inactive_audio_test }, + TEST_NO_TAG("Early-media video during video call", early_media_video_during_video_call_test), + TEST_NO_TAG("Two incoming early-media video calls", two_incoming_early_media_video_calls_test), + TEST_NO_TAG("Early-media video with inactive audio", early_media_video_with_inactive_audio), + TEST_NO_TAG("Forked outgoing early-media video call with inactive audio", forked_outgoing_early_media_video_call_with_inactive_audio_test), #endif /*HAVE_GTK*/ - { "Enable/disable camera after camera switches", enable_disable_camera_after_camera_switches} + TEST_NO_TAG("Enable/disable camera after camera switches", enable_disable_camera_after_camera_switches) }; From 6df23bdc52db06181343ca649dcdf4fa08997459 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 28 Jan 2016 10:17:27 +0100 Subject: [PATCH 13/18] Fix build on Windows. --- tester/common/bc_tester_utils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tester/common/bc_tester_utils.h b/tester/common/bc_tester_utils.h index 63fd87925..f70c30ac7 100644 --- a/tester/common/bc_tester_utils.h +++ b/tester/common/bc_tester_utils.h @@ -27,6 +27,7 @@ #ifdef _WIN32 #ifndef snprintf #define snprintf _snprintf +#define strcasecmp _stricmp #endif #ifndef strdup #define strdup _strdup From fdaca52ec4aa225670ee978ddfc7f5fe7cd9df9b Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 28 Jan 2016 12:35:57 +0100 Subject: [PATCH 14/18] submodules: update ms2 to fix android build --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index f6fdbb88c..18bea4f5b 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit f6fdbb88c668171e6df3fabdee21416cb2d0ef98 +Subproject commit 18bea4f5b9e36e0873443cf961164bed1d81e6bc From a7cb065a9f48624c224157441d942a91fb430d2c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 28 Jan 2016 15:48:37 +0100 Subject: [PATCH 15/18] add lp-sendmsg tool, a new tool to send arbitrary SIP MESSAGE requests through a server. --- mediastreamer2 | 2 +- tools/CMakeLists.txt | 23 +++++++++++++++++++++++ tools/Makefile.am | 6 +++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index 18bea4f5b..7053d54e7 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 18bea4f5b9e36e0873443cf961164bed1d81e6bc +Subproject commit 7053d54e7e3375944ee54671b82c3b5f63eac072 diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 545ac16b8..88cd09173 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -75,3 +75,26 @@ install(TARGETS lp-auto-answer PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) +set(LP_SENDMSG_SOURCE_FILES + lpsendmsg.c +) + +add_definitions( + -DIN_LINPHONE +) + +apply_compile_flags(LP_SENDMSG_SOURCE_FILES "CPP" "C") +add_executable(lp-sendmsg ${LP_SENDMSG_SOURCE_FILES}) +target_link_libraries(lp-sendmsg linphone) + + +install(TARGETS lp-sendmsg + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +) + + + + diff --git a/tools/Makefile.am b/tools/Makefile.am index 8a2c21436..f59617a43 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -19,7 +19,7 @@ EXTRA_DIST=xml2lpc_jni.cc lpc2xml_jni.cc if BUILD_TOOLS -bin_PROGRAMS=xml2lpc_test lpc2xml_test lp-gen-wrappers lp-autoanswer lp-test-ecc +bin_PROGRAMS=xml2lpc_test lpc2xml_test lp-gen-wrappers lp-autoanswer lp-test-ecc lp-sendmsg xml2lpc_test_SOURCES=\ xml2lpc_test.c @@ -52,6 +52,10 @@ lp_test_ecc_SOURCES=test_ecc.c lp_test_ecc_CFLAGS=$(COMMON_CFLAGS) lp_test_ecc_LDADD=$(top_builddir)/coreapi/liblinphone.la +lp_sendmsg_SOURCES=lpsendmsg.c +lp_sendmsg_CFLAGS=$(COMMON_CFLAGS) +lp_sendmsg_LDADD=$(top_builddir)/coreapi/liblinphone.la + endif From e73f376c0daaf321c83bff575e2307890f9e9393 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 28 Jan 2016 17:42:50 +0100 Subject: [PATCH 16/18] add missing file --- tools/lpsendmsg.c | 197 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 tools/lpsendmsg.c diff --git a/tools/lpsendmsg.c b/tools/lpsendmsg.c new file mode 100644 index 000000000..a88407055 --- /dev/null +++ b/tools/lpsendmsg.c @@ -0,0 +1,197 @@ +/* +linphone +Copyright (C) 2016 Belledonne Communications SARL + (simon.morlat@linphone.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#ifdef IN_LINPHONE +#include "linphonecore.h" +#else +#include "linphone/linphonecore.h" +#endif +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include + +static bool_t running = TRUE; +static const char *passwd = NULL; + +static void stop(int signum){ + running=FALSE; +} + +static void helper(const char *progname) { + printf("%s --from --to --route --passwd --text \n" + "\t\t\t--help\n" + "\t\t\t--from uri to send from\n" + "\t\t\t--to uri to send to\n" + "\t\t\t--route uri to send the message through\n" + "\t\t\t--passwd \n" + "\t\t\t--text \n" + "\t\t\t--verbose\n", progname); + exit(0); +} + +static void on_msg_state_changed(LinphoneChatMessage *msg, LinphoneChatMessageState state){ + switch(state){ + case LinphoneChatMessageStateInProgress: + printf("Sending message...\n"); + break; + case LinphoneChatMessageStateNotDelivered: + fprintf(stderr, "Error sending message. Use --verbose to troubleshoot.\n"); + running = FALSE; + break; + case LinphoneChatMessageStateDelivered: + printf("Message transmitted succesfully.\n"); + running = FALSE; + break; + case LinphoneChatMessageStateFileTransferDone: + case LinphoneChatMessageStateFileTransferError: + case LinphoneChatMessageStateIdle: + break; + } +} + +static void auth_info_requested(LinphoneCore *lc, const char *realm, const char *username, const char *domain){ + running = FALSE; + if (passwd){ + fprintf(stderr, "Server rejected the supplied username or password\n"); + }else{ + fprintf(stderr, "Authentication requested by server. Please retry by supplying a password with --passwd.\n"); + } +} + +int main(int argc, char *argv[]){ + LinphoneCoreVTable vtable={0}; + LinphoneCore *lc; + int i; + LinphoneAddress *from = NULL; + LinphoneAddress *to = NULL; + LinphoneAddress *route = NULL; + LinphoneProxyConfig *cfg; + LinphoneChatMessage *msg; + LinphoneChatRoom *room; + LinphoneChatMessageCbs *cbs; + char * text = NULL; + char *tmp; + + signal(SIGINT,stop); + + for(i = 1; i < argc; ++i) { + if (strcmp(argv[i], "--verbose") == 0) { + linphone_core_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); + } else if (strcmp(argv[i], "--from") == 0){ + i++; + if (i < argc){ + from = linphone_address_new(argv[i]); + if (!from) { + fprintf(stderr, "Incorrect from specified\n"); + return -1; + } + } + } else if (strcmp(argv[i], "--to") == 0){ + i++; + if (i < argc){ + to = linphone_address_new(argv[i]); + if (!to) { + fprintf(stderr, "Incorrect to specified\n"); + return -1; + } + } + }else if (strcmp(argv[i], "--route") == 0){ + i++; + if (i < argc){ + route = linphone_address_new(argv[i]); + if (!route) { + fprintf(stderr, "Incorrect route specified\n"); + return -1; + } + } + } else if (strcmp(argv[i], "--passwd") == 0){ + i++; + if (i < argc){ + passwd = argv[i]; + } + } else if (strcmp(argv[i], "--text") == 0){ + i++; + if (i < argc){ + text = argv[i]; + } + } else { + helper(argv[0]); + } + } + + if (!from) { + fprintf(stderr, "Please specify from.\n"); + helper(argv[0]); + return -1; + } + if (!to) { + fprintf(stderr, "Please specify to.\n"); + helper(argv[0]); + return -1; + } + if (!text){ + fprintf(stderr, "Please specify text to send.\n"); + helper(argv[0]); + return -1; + } + + vtable.auth_info_requested = auth_info_requested; + lc=linphone_core_new(&vtable,NULL, NULL, NULL); + + if (passwd){ + LinphoneAuthInfo *ai = linphone_core_create_auth_info(lc, linphone_address_get_username(from), NULL, passwd, NULL, NULL, NULL); + linphone_core_add_auth_info(lc, ai); + linphone_auth_info_destroy(ai); + } + + if (!route){ + route = linphone_address_clone(from); + linphone_address_set_username(route, NULL); + linphone_address_set_display_name(route, NULL); + } + + cfg = linphone_core_create_proxy_config(lc); + linphone_proxy_config_set_identity_address(cfg, from); + tmp = linphone_address_as_string(route); + linphone_proxy_config_set_server_addr(cfg, tmp); + ms_free(tmp); + linphone_proxy_config_enable_register(cfg, FALSE); + linphone_core_add_proxy_config(lc, cfg); + linphone_proxy_config_unref(cfg); + + room = linphone_core_get_chat_room(lc, to); + msg = linphone_chat_room_create_message(room, text); + cbs = linphone_chat_message_get_callbacks(msg); + linphone_chat_message_cbs_set_msg_state_changed(cbs, on_msg_state_changed); + linphone_chat_room_send_chat_message(room, msg); + /* main loop for receiving notifications and doing background linphonecore work: */ + while(running){ + linphone_core_iterate(lc); + ms_usleep(50000); + } + linphone_address_destroy(from); + linphone_address_destroy(to); + linphone_address_destroy(route); + linphone_core_destroy(lc); + return 0; +} + From 58cb7a3f5731792b948ea2a6893e4d0f688266f6 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 28 Jan 2016 16:03:46 +0100 Subject: [PATCH 17/18] use belle-sip refresher with dialog terminated recovery capability --- coreapi/bellesip_sal/sal_impl.c | 4 +- coreapi/bellesip_sal/sal_op_events.c | 14 ++- coreapi/bellesip_sal/sal_op_impl.c | 4 +- coreapi/callbacks.c | 4 +- coreapi/event.c | 2 +- coreapi/friendlist.c | 19 ++++ coreapi/linphonecore.c | 7 ++ coreapi/private.h | 1 + coreapi/vtables.c | 2 +- include/sal/sal.h | 4 +- tester/eventapi_tester.c | 3 +- tester/flexisip/flexisip.conf | 1 + tester/presence_tester.c | 156 +++++++++++++++++++++++---- tester/register_tester.c | 2 +- tester/tester.c | 8 +- 15 files changed, 185 insertions(+), 46 deletions(-) diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index 123aadb3a..75597c3d2 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -542,8 +542,8 @@ void sal_set_callbacks(Sal *ctx, const SalCallbacks *cbs){ ctx->callbacks.notify=(SalOnNotify)unimplemented_stub; if (ctx->callbacks.subscribe_received==NULL) ctx->callbacks.subscribe_received=(SalOnSubscribeReceived)unimplemented_stub; - if (ctx->callbacks.subscribe_closed==NULL) - ctx->callbacks.subscribe_closed=(SalOnSubscribeClosed)unimplemented_stub; + if (ctx->callbacks.incoming_subscribe_closed==NULL) + ctx->callbacks.incoming_subscribe_closed=(SalOnIncomingSubscribeClosed)unimplemented_stub; if (ctx->callbacks.parse_presence_requested==NULL) ctx->callbacks.parse_presence_requested=(SalOnParsePresenceRequested)unimplemented_stub; if (ctx->callbacks.convert_presence_to_xml_requested==NULL) diff --git a/coreapi/bellesip_sal/sal_op_events.c b/coreapi/bellesip_sal/sal_op_events.c index 802e5d334..75f87a2d9 100644 --- a/coreapi/bellesip_sal/sal_op_events.c +++ b/coreapi/bellesip_sal/sal_op_events.c @@ -46,11 +46,15 @@ static void subscribe_refresher_listener (belle_sip_refresher_t* refresher if (status_code==200) sss=SalSubscribeActive; else if (status_code==202) sss=SalSubscribePending; set_or_update_dialog(op,belle_sip_transaction_get_dialog(tr)); - } - if (status_code>=200){ - sal_error_info_set(&op->error_info,SalReasonUnknown,status_code,reason_phrase,NULL); op->base.root->callbacks.subscribe_response(op,sss); - }else if (status_code==0){ + } else if (status_code >= 300) { + SalReason reason = SalReasonUnknown; + if (status_code == 503) { /*refresher returns 503 for IO error*/ + reason = SalReasonIOError; + } + sal_error_info_set(&op->error_info,reason,status_code,reason_phrase,NULL); + op->base.root->callbacks.subscribe_response(op,sss); + }if (status_code==0){ op->base.root->callbacks.on_expire(op); } @@ -172,7 +176,7 @@ static void subscribe_process_request_event(void *op_base, const belle_sip_reque ms_message("Unsubscribe received from [%s]",sal_op_get_from(op)); resp=sal_op_create_response_from_request(op,req,200); belle_sip_server_transaction_send_response(server_transaction,resp); - op->base.root->callbacks.subscribe_closed(op); + op->base.root->callbacks.incoming_subscribe_closed(op); } } break; diff --git a/coreapi/bellesip_sal/sal_op_impl.c b/coreapi/bellesip_sal/sal_op_impl.c index 345501b84..88d6cf0f9 100644 --- a/coreapi/bellesip_sal/sal_op_impl.c +++ b/coreapi/bellesip_sal/sal_op_impl.c @@ -518,14 +518,14 @@ SalReason _sal_reason_from_sip_code(int code) { return SalReasonNotImplemented; case 502: return SalReasonBadGateway; + case 503: + return SalReasonServiceUnavailable; case 504: return SalReasonServerTimeout; case 600: return SalReasonDoNotDisturb; case 603: return SalReasonDeclined; - case 503: - return SalReasonServiceUnavailable; default: return SalReasonUnknown; } diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 22af840f4..26e207d79 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -1343,7 +1343,7 @@ static void subscribe_received(SalOp *op, const char *eventname, const SalBodyHa } -static void subscribe_closed(SalOp *op){ +static void incoming_subscribe_closed(SalOp *op){ LinphoneEvent *lev=(LinphoneEvent*)sal_op_get_user_pointer(op); linphone_event_set_state(lev,LinphoneSubscriptionTerminated); @@ -1400,7 +1400,7 @@ SalCallbacks linphone_sal_callbacks={ is_composing_received, notify_refer, subscribe_received, - subscribe_closed, + incoming_subscribe_closed, subscribe_response, notify, subscribe_presence_received, diff --git a/coreapi/event.c b/coreapi/event.c index 7505fd723..2d6c8f270 100644 --- a/coreapi/event.c +++ b/coreapi/event.c @@ -35,7 +35,7 @@ const char *linphone_subscription_state_to_string(LinphoneSubscriptionState stat switch(state){ case LinphoneSubscriptionNone: return "LinphoneSubscriptionNone"; case LinphoneSubscriptionIncomingReceived: return "LinphoneSubscriptionIncomingReceived"; - case LinphoneSubscriptionOutgoingInit: return "LinphoneSubscriptionOutoingInit"; + case LinphoneSubscriptionOutgoingProgress: return "LinphoneSubscriptionOutgoingProgress"; case LinphoneSubscriptionPending: return "LinphoneSubscriptionPending"; case LinphoneSubscriptionActive: return "LinphoneSubscriptionActive"; case LinphoneSubscriptionTerminated: return "LinphoneSubscriptionTerminated"; diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index 22b9fc0e8..9201d6d9c 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -419,6 +419,7 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon linphone_content_set_string_buffer(content, xml_content); linphone_event_send_subscribe(list->event, content); linphone_content_unref(content); + linphone_event_set_user_data(list->event, list); } } if (address != NULL) linphone_address_unref(address); @@ -476,3 +477,21 @@ void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, Lin linphone_content_unref(first_part); } } +void linphone_friend_list_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state) { + LinphoneFriendList *list = (LinphoneFriendList *)linphone_event_get_user_data(lev); + if (!list) { + ms_warning("core [%p] Receiving unexpected state [%s] for event [%p], no associated friend list",lc + , linphone_subscription_state_to_string(state) + , lev); + } else { + ms_message("Receiving new state [%s] for event [%p] for friend list [%p]" + , linphone_subscription_state_to_string(state) + , lev + , list); + + if (state == LinphoneSubscriptionOutgoingProgress) { + ms_message("Resseting version count for friend list [%p]",list); + list->expected_notification_version = 0; + } + } +} diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 034057a47..604238120 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1654,6 +1654,12 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve } } +static void linphone_core_internal_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state) { + if (strcasecmp(linphone_event_get_name(lev), "Presence") == 0) { + linphone_friend_list_subscription_state_changed(lc, lev, state); + } +} + static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtable, LpConfig *config, void * userdata){ const char *remote_provisioning_uri = NULL; LinphoneCoreVTable* local_vtable= linphone_core_v_table_new(); @@ -1668,6 +1674,7 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab linphone_task_list_init(&lc->hooks); internal_vtable->notify_received = linphone_core_internal_notify_received; + internal_vtable->subscription_state_changed = linphone_core_internal_subscription_state_changed; _linphone_core_add_listener(lc, internal_vtable, TRUE, TRUE); memcpy(local_vtable,vtable,sizeof(LinphoneCoreVTable)); _linphone_core_add_listener(lc, local_vtable, TRUE, FALSE); diff --git a/coreapi/private.h b/coreapi/private.h index 6f80e93ff..3511671d9 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -406,6 +406,7 @@ const LinphoneAddress* linphone_proxy_config_get_service_route(const LinphonePro void linphone_friend_list_invalidate_subscriptions(LinphoneFriendList *list); void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, LinphoneEvent *lev, const LinphoneContent *body); +void linphone_friend_list_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state); void _linphone_friend_list_release(LinphoneFriendList *list); void linphone_friend_invalidate_subscription(LinphoneFriend *lf); void linphone_friend_close_subscriptions(LinphoneFriend *lf); diff --git a/coreapi/vtables.c b/coreapi/vtables.c index ae523925d..a8840b5eb 100644 --- a/coreapi/vtables.c +++ b/coreapi/vtables.c @@ -245,7 +245,7 @@ void linphone_core_notify_notify_received(LinphoneCore *lc, LinphoneEvent *lev, } void linphone_core_notify_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state) { - NOTIFY_IF_EXIST(subscription_state_changed, lc,lev,state); + NOTIFY_IF_EXIST_INTERNAL(subscription_state_changed,linphone_event_is_internal(lev), lc,lev,state); cleanup_dead_vtable_refs(lc); } diff --git a/include/sal/sal.h b/include/sal/sal.h index 58c63f0c5..ca06b1d13 100644 --- a/include/sal/sal.h +++ b/include/sal/sal.h @@ -489,7 +489,7 @@ typedef void (*SalOnNotifyRefer)(SalOp *op, SalReferStatus state); typedef void (*SalOnSubscribeResponse)(SalOp *op, SalSubscribeStatus status); typedef void (*SalOnNotify)(SalOp *op, SalSubscribeStatus status, const char *event, SalBodyHandler *body); typedef void (*SalOnSubscribeReceived)(SalOp *salop, const char *event, const SalBodyHandler *body); -typedef void (*SalOnSubscribeClosed)(SalOp *salop); +typedef void (*SalOnIncomingSubscribeClosed)(SalOp *salop); typedef void (*SalOnParsePresenceRequested)(SalOp *salop, const char *content_type, const char *content_subtype, const char *content, SalPresenceModel **result); typedef void (*SalOnConvertPresenceToXMLRequested)(SalOp *salop, SalPresenceModel *presence, const char *contact, char **content); typedef void (*SalOnNotifyPresence)(SalOp *op, SalSubscribeStatus ss, SalPresenceModel *model, const char *msg); @@ -523,7 +523,7 @@ typedef struct SalCallbacks{ SalOnIsComposingReceived is_composing_received; SalOnNotifyRefer notify_refer; SalOnSubscribeReceived subscribe_received; - SalOnSubscribeClosed subscribe_closed; + SalOnIncomingSubscribeClosed incoming_subscribe_closed; SalOnSubscribeResponse subscribe_response; SalOnNotify notify; SalOnSubscribePresenceReceived subscribe_presence_received; diff --git a/tester/eventapi_tester.c b/tester/eventapi_tester.c index a8ada9ba2..82f7d8f76 100644 --- a/tester/eventapi_tester.c +++ b/tester/eventapi_tester.c @@ -38,8 +38,9 @@ const char *liblinphone_tester_get_notify_content(void){ void linphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char *eventname, const LinphoneContent *content){ LinphoneCoreManager *mgr; + const char * ua = linphone_event_get_custom_header(lev, "User-Agent"); BC_ASSERT_PTR_NOT_NULL_FATAL(content); - if (!linphone_content_is_multipart(content)) { + if (!linphone_content_is_multipart(content) && (!ua || !strcasestr(ua, "flexisip"))) { /*disable check for full presence serveur support*/ /*hack to disable content checking for list notify */ BC_ASSERT_STRING_EQUAL(notify_content,(const char*)linphone_content_get_buffer(content)); } diff --git a/tester/flexisip/flexisip.conf b/tester/flexisip/flexisip.conf index 5943e57a3..9aaceda2f 100644 --- a/tester/flexisip/flexisip.conf +++ b/tester/flexisip/flexisip.conf @@ -617,6 +617,7 @@ ban-time=1 [module::Presence] enabled=true presence-server = +only-list-subscription = !(user-agent contains 'full-presence-support') [presence-server] expires = 600 diff --git a/tester/presence_tester.c b/tester/presence_tester.c index 6b4060e0b..a1e7e06ff 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -21,6 +21,8 @@ #include "private.h" #include "liblinphone_tester.h" +static void enable_publish(LinphoneCoreManager *mgr, bool_t enable); + static LinphoneCoreManager* presence_linphone_core_manager_new(char* username) { LinphoneCoreManager* mgr= linphone_core_manager_new2( "empty_rc", FALSE); char* identity_char; @@ -400,25 +402,25 @@ static void subscribe_presence_expired(void){ lcs = ms_list_append(lcs, pauline1->lc); lp_config_set_int(marie->lc->config, "sip", "subscribe_expires", 10); - + lf = linphone_core_create_friend(marie->lc); linphone_friend_set_address(lf, pauline1->identity); linphone_friend_enable_subscribes(lf, TRUE); linphone_core_add_friend(marie->lc, lf); linphone_friend_unref(lf); - BC_ASSERT_TRUE(wait_for_list(lcs,&pauline1->stat.number_of_NewSubscriptionRequest,1, 5000)); BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphonePresenceActivityOnline,1, 2000)); lf = linphone_core_find_friend(pauline1->lc, marie->identity); BC_ASSERT_PTR_NOT_NULL(lf->insubs); + /*marie comes offline suddenly*/ linphone_core_set_network_reachable(marie->lc, FALSE); /*after a certain time, pauline shall see the incoming SUBSCRIBE expired*/ wait_for_list(lcs,NULL, 0, 11000); - BC_ASSERT_PTR_NULL(lf->insubs); + /*just make network reachable so that marie can unregister properly*/ linphone_core_set_network_reachable(marie->lc, TRUE); BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneRegistrationOk,2, 10000)); @@ -428,10 +430,56 @@ static void subscribe_presence_expired(void){ ms_list_free(lcs); } +static void subscriber_no_longuer_reachable(void){ + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline1 = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneFriend *lf; + MSList *lcs = NULL; + LinphonePresenceModel * presence; + + lcs = ms_list_append(lcs, marie->lc); + lcs = ms_list_append(lcs, pauline1->lc); + + lp_config_set_int(marie->lc->config, "sip", "subscribe_expires", 40); + linphone_core_set_user_agent(marie->lc, "full-presence-support", NULL); + linphone_core_set_user_agent(pauline1->lc, "full-presence-support", NULL); + + enable_publish(pauline1, TRUE); + + lf = linphone_core_create_friend(marie->lc); + linphone_friend_set_address(lf, pauline1->identity); + linphone_friend_enable_subscribes(lf, TRUE); + + linphone_core_add_friend(marie->lc, lf); + linphone_friend_unref(lf); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphonePresenceActivityOnline,1, 2000)); + + + presence =linphone_presence_model_new_with_activity(LinphonePresenceActivityBusy,NULL); + linphone_core_set_presence_model(pauline1->lc,presence); -#define USE_PRESENCE_SERVER 0 + /*don't schedule marie to simulate Notify timeout server side*/ + wait_for_until(pauline1->lc, NULL, 0, 0, 35000); + + //sal_set_send_error(marie->lc->sal,0); + + /*because of notify timeout detected by server, so subscription is reset*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphonePresenceActivityOffline,2, 4000)); + + // now subscribetion is supposed to be dead because notify was not answered in time. + presence =linphone_presence_model_new_with_activity(LinphonePresenceActivityOnline,NULL); + linphone_core_set_presence_model(pauline1->lc,presence); + + /*becasue subscription is automatically restarted*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphonePresenceActivityOnline,2, 4000)); + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline1); + + ms_list_free(lcs); + +} -#if USE_PRESENCE_SERVER static void test_subscribe_notify_publish(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); @@ -439,6 +487,8 @@ static void test_subscribe_notify_publish(void) { LinphoneProxyConfig* proxy; LinphonePresenceModel* presence; + linphone_core_set_user_agent(marie->lc, "full-presence-support", NULL); + linphone_core_set_user_agent(pauline->lc, "full-presence-support", NULL); LpConfig *pauline_lp = linphone_core_get_config(pauline->lc); char* lf_identity=linphone_address_as_string_uri_only(marie->identity); LinphoneFriend *lf = linphone_core_create_friend_with_address(pauline->lc,lf_identity); @@ -453,7 +503,7 @@ static void test_subscribe_notify_publish(void) { /*enable publish*/ - linphone_core_get_default_proxy(marie->lc,&proxy); + proxy = linphone_core_get_default_proxy_config(marie->lc); linphone_proxy_config_edit(proxy); linphone_proxy_config_enable_publish(proxy,TRUE); @@ -502,7 +552,11 @@ static void test_forked_subscribe_notify_publish(void) { lcs=ms_list_append(lcs,marie->lc); lcs=ms_list_append(lcs,marie->lc); lcs=ms_list_append(lcs,marie2->lc); + linphone_core_set_user_agent(marie->lc, "full-presence-support", NULL); + linphone_core_set_user_agent(marie2->lc, "full-presence-support", NULL); + linphone_core_set_user_agent(pauline->lc, "full-presence-support", NULL); + pauline_lp = linphone_core_get_config(pauline->lc); lf_identity=linphone_address_as_string_uri_only(marie->identity); lf = linphone_core_create_friend_with_address(pauline->lc,lf_identity); @@ -546,16 +600,14 @@ static void test_forked_subscribe_notify_publish(void) { linphone_core_set_presence_model(marie2->lc,presence); /*wait for new status*/ wait_for_list(lcs,&pauline->stat.number_of_NotifyPresenceReceived,5,2000); - BC_ASSERT_EQUAL(LinphoneStatusBusy,linphone_friend_get_status(lf), int, "%d"); /*because liblinphone compositor is very simple for now (I.E only take first occurence)*/ + BC_ASSERT_TRUE(LinphoneStatusBusy == linphone_friend_get_status(lf) + || LinphoneStatusDoNotDisturb == linphone_friend_get_status(lf)); /*because liblinphone compositor is very simple for now */ linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie2); linphone_core_manager_destroy(pauline); } - -#endif - const char * get_identity(LinphoneCoreManager *mgr) { LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(mgr->lc); return linphone_proxy_config_get_identity(cfg); @@ -743,7 +795,7 @@ static void test_presence_list_subscribe_before_publish(void) { linphone_core_manager_destroy(pauline); } -static void test_presence_list_subscription_expire(void) { +static void test_presence_list_subscription_expire_for_unknown(void) { LinphoneCoreManager *laure = linphone_core_manager_new("laure_tcp_rc"); const char *rls_uri = "sip:rls@sip.example.org"; LinphoneFriendList *lfl; @@ -762,16 +814,77 @@ static void test_presence_list_subscription_expire(void) { /* wait for refresh*/ BC_ASSERT_FALSE(wait_for_until(laure->lc, NULL, &laure->stat.number_of_NotifyPresenceReceived, 1, 4000)); - /*sal_set_send_error(laure->lc->sal,1500);*/ /*make sure no refresh is sent, trash the message without generating error*/ - - /*make sure we don't received any notify, even when subscribtion has expired*/ - /*BC_ASSERT_FALSE(wait_for_until(laure->lc, NULL, &laure->stat.number_of_NotifyPresenceReceived, 1, 5000)); - - sal_set_send_error(laure->lc->sal,0);*/ - linphone_core_manager_destroy(laure); } +static void test_presence_list_subscribe_dialog_expire(void) { + LinphoneCoreManager *laure = linphone_core_manager_new("laure_tcp_rc"); + LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + const char *rls_uri = "sip:rls@sip.example.org"; + LinphoneFriendList *lfl; + LinphoneFriend *lf; + const char *pauline_identity; + MSList* lcs = NULL; + int dummy = 0; + lp_config_set_int(laure->lc->config, "sip", "rls_presence_expires", 3); + + + pauline_identity = get_identity(pauline); + + linphone_core_set_presence_model(pauline->lc, linphone_core_create_presence_model_with_activity(pauline->lc, LinphonePresenceActivityVacation, NULL)); + + lfl = linphone_core_create_friend_list(laure->lc); + linphone_friend_list_set_rls_uri(lfl, rls_uri); + lf = linphone_core_create_friend_with_address(laure->lc, pauline_identity); + linphone_friend_list_add_friend(lfl, lf); + lf = linphone_core_create_friend_with_address(laure->lc, "sip:michelle@sip.inexistentdomain.com"); + linphone_friend_list_add_friend(lfl, lf); + linphone_core_set_friend_list(laure->lc, lfl); + linphone_friend_list_unref(lfl); + linphone_core_set_presence_model(laure->lc, linphone_core_create_presence_model_with_activity(laure->lc, LinphonePresenceActivityOnline, NULL)); + linphone_friend_list_update_subscriptions(laure->lc->friendlist, NULL, FALSE); + + lcs = ms_list_append(lcs, laure->lc); + lcs = ms_list_append(lcs, pauline->lc); + + wait_for_list(lcs, &dummy, 1, 2000); /* Wait a little bit for the subscribe to happen */ + + enable_publish(pauline, TRUE); + wait_for_list(lcs, &pauline->stat.number_of_NotifyPresenceReceived, 1, 2000); + BC_ASSERT_GREATER(laure->stat.number_of_NotifyPresenceReceived, 1, int, "%d"); + BC_ASSERT_GREATER(laure->lc->friendlist->expected_notification_version, 1, int, "%d"); + lf = linphone_friend_list_find_friend_by_uri(laure->lc->friendlist, pauline_identity); + BC_ASSERT_EQUAL(linphone_friend_get_status(lf), LinphoneStatusVacation, int, "%d"); + BC_ASSERT_EQUAL(lf->presence_received, TRUE, int, "%d"); + BC_ASSERT_EQUAL(lf->subscribe_active, TRUE, int, "%d"); + lf = linphone_friend_list_find_friend_by_uri(laure->lc->friendlist, "sip:michelle@sip.inexistentdomain.com"); + BC_ASSERT_EQUAL(linphone_friend_get_status(lf), LinphoneStatusOffline, int, "%d"); + BC_ASSERT_EQUAL(lf->presence_received, FALSE, int, "%d"); + BC_ASSERT_EQUAL(lf->subscribe_active, TRUE, int, "%d"); + + BC_ASSERT_TRUE(wait_for_until(laure->lc, pauline->lc, &laure->stat.number_of_NotifyPresenceReceived, 2, 5000)); + ms_message("Simulating in/out packets losses"); + sal_set_send_error(laure->lc->sal,1500); /*make sure no refresh is sent, trash the message without generating error*/ + sal_set_recv_error(laure->lc->sal, 1500); /*make sure server notify to close the dialog is also ignored*/ + + wait_for_list(lcs, &dummy, 1, 3000); /* Wait a little bit for the subscribe to happen */ + + /*restart normal behavior*/ + sal_set_send_error(laure->lc->sal,0); + sal_set_recv_error(laure->lc->sal, 1); + + + linphone_core_set_presence_model(pauline->lc, linphone_core_create_presence_model_with_activity(pauline->lc, LinphonePresenceActivityAway, NULL)); + + BC_ASSERT_TRUE(wait_for_until(laure->lc, pauline->lc, &laure->stat.number_of_NotifyPresenceReceived, 3, 5000)); + lf = linphone_friend_list_find_friend_by_uri(laure->lc->friendlist, pauline_identity); + BC_ASSERT_EQUAL(linphone_friend_get_status(lf), LinphoneStatusAway, int, "%d"); + + linphone_core_manager_destroy(laure); + linphone_core_manager_destroy(pauline); +} + + test_t presence_tests[] = { TEST_NO_TAG("Simple Subscribe", simple_subscribe), @@ -783,13 +896,12 @@ test_t presence_tests[] = { TEST_NO_TAG("App managed presence failure", subscribe_failure_handle_by_app), TEST_NO_TAG("Presence SUBSCRIBE forked", subscribe_presence_forked), TEST_NO_TAG("Presence SUBSCRIBE expired", subscribe_presence_expired), -#if USE_PRESENCE_SERVER + TEST_NO_TAG("Subscriber no loguer reachable using server",subscriber_no_longuer_reachable), TEST_NO_TAG("Subscribe with late publish", test_subscribe_notify_publish), TEST_NO_TAG("Forked subscribe with late publish", test_forked_subscribe_notify_publish), -#endif TEST_NO_TAG("Presence list", test_presence_list), - TEST_NO_TAG("Presence list (subscribe before publish)", test_presence_list_subscribe_before_publish), - TEST_NO_TAG("Presence list, subscription expiration",test_presence_list_subscription_expire) + TEST_NO_TAG("Presence list, subscription expiration for unknown contact",test_presence_list_subscription_expire_for_unknown), + TEST_NO_TAG("Presence list, silent subscription expiration", test_presence_list_subscribe_dialog_expire) }; test_suite_t presence_test_suite = {"Presence", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/register_tester.c b/tester/register_tester.c index 4397b3011..a8fa71a82 100644 --- a/tester/register_tester.c +++ b/tester/register_tester.c @@ -216,7 +216,7 @@ static void simple_unregister(void){ LinphoneProxyConfig* proxy_config; register_with_refresh_base(lcm->lc,FALSE,NULL,NULL); - linphone_core_get_default_proxy(lcm->lc,&proxy_config); + proxy_config = linphone_core_get_default_proxy_config(lcm->lc); linphone_proxy_config_edit(proxy_config); reset_counters(counters); /*clear stats*/ diff --git a/tester/tester.c b/tester/tester.c index edc63322b..ba1130f1a 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -255,11 +255,6 @@ bool_t transport_supported(LinphoneTransportType transport) { return supported; } - -static void display_status(LinphoneCore *lc, const char *status){ - ms_message("display_status(): %s",status); -} - void linphone_core_manager_init(LinphoneCoreManager *mgr, const char* rc_file) { char *rc_path = NULL; char *hellopath = bc_tester_res("sounds/hello8000.wav"); @@ -282,7 +277,6 @@ void linphone_core_manager_init(LinphoneCoreManager *mgr, const char* rc_file) { mgr->v_table.network_reachable=network_reachable; mgr->v_table.dtmf_received=dtmf_received; mgr->v_table.call_stats_updated=call_stats_updated; - mgr->v_table.display_status=display_status; reset_counters(&mgr->stat); if (rc_file) rc_path = ms_strdup_printf("rcfiles/%s", rc_file); @@ -354,7 +348,7 @@ void linphone_core_manager_start(LinphoneCoreManager *mgr, int check_for_proxies BC_ASSERT_EQUAL(mgr->stat.number_of_LinphoneRegistrationOk,proxy_count, int, "%d"); enable_codec(mgr->lc,"PCMU",8000); - linphone_core_get_default_proxy(mgr->lc,&proxy); + proxy = linphone_core_get_default_proxy_config(mgr->lc); if (proxy) { mgr->identity = linphone_address_clone(linphone_proxy_config_get_identity_address(proxy)); linphone_address_clean(mgr->identity); From 3aed512e65f0e1dca3d960a73b6348a505f0986e Mon Sep 17 00:00:00 2001 From: buildbot Date: Fri, 29 Jan 2016 08:55:51 +0100 Subject: [PATCH 18/18] fix gcc compilation issue --- tester/eventapi_tester.c | 3 +-- tester/presence_tester.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tester/eventapi_tester.c b/tester/eventapi_tester.c index 82f7d8f76..ce7c60c31 100644 --- a/tester/eventapi_tester.c +++ b/tester/eventapi_tester.c @@ -24,7 +24,6 @@ #include #include "liblinphone_tester.h" - static const char *subscribe_content="blabla"; static const char *notify_content="blabla"; @@ -40,7 +39,7 @@ void linphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char * LinphoneCoreManager *mgr; const char * ua = linphone_event_get_custom_header(lev, "User-Agent"); BC_ASSERT_PTR_NOT_NULL_FATAL(content); - if (!linphone_content_is_multipart(content) && (!ua || !strcasestr(ua, "flexisip"))) { /*disable check for full presence serveur support*/ + if (!linphone_content_is_multipart(content) && (!ua || !strstr(ua, "flexisip"))) { /*disable check for full presence serveur support*/ /*hack to disable content checking for list notify */ BC_ASSERT_STRING_EQUAL(notify_content,(const char*)linphone_content_get_buffer(content)); } diff --git a/tester/presence_tester.c b/tester/presence_tester.c index a1e7e06ff..77815e847 100644 --- a/tester/presence_tester.c +++ b/tester/presence_tester.c @@ -486,12 +486,15 @@ static void test_subscribe_notify_publish(void) { LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); LinphoneProxyConfig* proxy; LinphonePresenceModel* presence; + LpConfig *pauline_lp; + char* lf_identity; + LinphoneFriend *lf; linphone_core_set_user_agent(marie->lc, "full-presence-support", NULL); linphone_core_set_user_agent(pauline->lc, "full-presence-support", NULL); - LpConfig *pauline_lp = linphone_core_get_config(pauline->lc); - char* lf_identity=linphone_address_as_string_uri_only(marie->identity); - LinphoneFriend *lf = linphone_core_create_friend_with_address(pauline->lc,lf_identity); + pauline_lp = linphone_core_get_config(pauline->lc); + lf_identity=linphone_address_as_string_uri_only(marie->identity); + lf = linphone_core_create_friend_with_address(pauline->lc,lf_identity); lp_config_set_int(pauline_lp,"sip","subscribe_expires",5); @@ -744,7 +747,7 @@ static void test_presence_list(void) { linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); } - +#if 0 static void test_presence_list_subscribe_before_publish(void) { LinphoneCoreManager *laure = linphone_core_manager_new("laure_tcp_rc"); LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); @@ -794,7 +797,7 @@ static void test_presence_list_subscribe_before_publish(void) { linphone_core_manager_destroy(laure); linphone_core_manager_destroy(pauline); } - +#endif static void test_presence_list_subscription_expire_for_unknown(void) { LinphoneCoreManager *laure = linphone_core_manager_new("laure_tcp_rc"); const char *rls_uri = "sip:rls@sip.example.org";