From 5f7ed789788c5b0d70d27b3e45baafad43951806 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 12 Jan 2016 15:58:27 +0100 Subject: [PATCH 1/6] comment log --- tester/call_tester.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tester/call_tester.c b/tester/call_tester.c index cae7ccaa6..3f7b475f7 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -5031,6 +5031,7 @@ static int rtptm_on_send(RtpTransportModifier *rtptm, mblk_t *msg) { // This is probably a STUN packet, so don't count it (oRTP won't) and don't encrypt it either return (int)msgdsize(msg); } + /*ms_message("rtptm_on_send: rtpm=%p seq=%u", rtptm, (int)ntohs(rtp_get_seqnumber(msg)));*/ data->packetSentCount += 1; ms_queue_put(&data->to_send, dupmsg(msg)); @@ -5170,6 +5171,7 @@ static void custom_rtp_modifier(bool_t pauseResumeTest, bool_t recordTest) { v_table = linphone_core_v_table_new(); v_table->call_state_changed = call_state_changed_4; linphone_core_add_listener(marie->lc,v_table); + if (recordTest) { // When we do the record test, we need a file player to play the content of a sound file /*make sure the record file doesn't already exists, otherwise this test will append new samples to it*/ From 10c41db79fb6121a4c5f29fbeb2457d0027ded63 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Tue, 12 Jan 2016 16:10:11 +0100 Subject: [PATCH 2/6] Adding tests for outgoing audio call without audio codecs and outgoing video call with no codec audio or video. Adding bug fix for outgoing video call with no video+audio codecs. --- coreapi/linphonecall.c | 19 ++++---- tester/call_tester.c | 103 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 107 insertions(+), 15 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 1eff5f2da..7beedbc78 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -714,11 +714,7 @@ void linphone_call_make_local_media_description(LinphoneCall *call) { codec_hints.previously_used=old_md ? old_md->streams[call->main_audio_stream_index].already_assigned_payloads : NULL; l=make_codec_list(lc, &codec_hints, SalAudio, lc->codecs_conf.audio_codecs); - // in case where no audio codec was found for this stream, the audio is disabled - if (l == NULL) { - params->has_audio = FALSE; - } - if (params->has_audio) { + if (params->has_audio && l != NULL) { strncpy(md->streams[call->main_audio_stream_index].rtp_addr,linphone_call_get_public_ip_for_stream(call,call->main_audio_stream_index),sizeof(md->streams[call->main_audio_stream_index].rtp_addr)); strncpy(md->streams[call->main_audio_stream_index].rtcp_addr,linphone_call_get_public_ip_for_stream(call,call->main_audio_stream_index),sizeof(md->streams[call->main_audio_stream_index].rtcp_addr)); strncpy(md->streams[call->main_audio_stream_index].name,"Audio",sizeof(md->streams[call->main_audio_stream_index].name)-1); @@ -757,16 +753,17 @@ void linphone_call_make_local_media_description(LinphoneCall *call) { md->streams[call->main_video_stream_index].rtcp_mux = rtcp_mux; strncpy(md->streams[call->main_video_stream_index].name,"Video",sizeof(md->streams[call->main_video_stream_index].name)-1); - if (params->has_video){ + codec_hints.bandwidth_limit=0; + codec_hints.max_codecs=-1; + codec_hints.previously_used=old_md ? old_md->streams[call->main_video_stream_index].already_assigned_payloads : NULL; + l=make_codec_list(lc, &codec_hints, SalVideo, lc->codecs_conf.video_codecs); + + if (params->has_video && l != NULL){ strncpy(md->streams[call->main_video_stream_index].rtp_addr,linphone_call_get_public_ip_for_stream(call,call->main_video_stream_index),sizeof(md->streams[call->main_video_stream_index].rtp_addr)); strncpy(md->streams[call->main_video_stream_index].rtcp_addr,linphone_call_get_public_ip_for_stream(call,call->main_video_stream_index),sizeof(md->streams[call->main_video_stream_index].rtcp_addr)); md->streams[call->main_video_stream_index].rtp_port=call->media_ports[call->main_video_stream_index].rtp_port; md->streams[call->main_video_stream_index].rtcp_port=call->media_ports[call->main_video_stream_index].rtcp_port; - codec_hints.bandwidth_limit=0; - codec_hints.max_codecs=-1; - codec_hints.previously_used=old_md ? old_md->streams[call->main_video_stream_index].already_assigned_payloads : NULL; - l=make_codec_list(lc, &codec_hints, SalVideo, lc->codecs_conf.video_codecs); - md->streams[call->main_video_stream_index].payloads=l; + md->streams[call->main_video_stream_index].payloads=l; if (call->videostream && call->videostream->ms.sessions.rtp_session) { char* me = linphone_address_as_string_uri_only(call->me); md->streams[call->main_video_stream_index].rtp_ssrc=rtp_session_get_send_ssrc(call->videostream->ms.sessions.rtp_session); diff --git a/tester/call_tester.c b/tester/call_tester.c index 3f7b475f7..8c3c2aecc 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -701,6 +701,99 @@ end: linphone_core_manager_destroy(pauline); } + +static void disable_all_codecs(const MSList* elem, LinphoneCoreManager* call){ + + PayloadType *pt; + + for(;elem!=NULL;elem=elem->next){ + pt=(PayloadType*)elem->data; + linphone_core_enable_payload_type(call->lc,pt,FALSE); + } +} +/*** + Disable all audio codecs , sends an INVITE with RTP port 0 and payload 0. + Wait for SIP 488 unacceptable. + ***/ +static void call_with_no_audio_codec(void){ + + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCall* out_call ; + + const MSList* elem =linphone_core_get_audio_codecs(caller->lc); + + disable_all_codecs(elem, caller); + + + out_call = linphone_core_invite_address(caller->lc,callee->identity); + linphone_call_ref(out_call); + BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); + + + BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); + BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); + BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + linphone_call_unref(out_call); + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); + +} + +static void video_call_with_no_audio_and_no_video_codec(void){ + + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCall* out_call ; + LinphoneVideoPolicy callee_policy, caller_policy; + LinphoneCallTestParams caller_test_params = {0}, callee_test_params = {0}; + + const MSList* elem_video =linphone_core_get_video_codecs(caller->lc); + + const MSList* elem_audio =linphone_core_get_audio_codecs(caller->lc); + + disable_all_codecs(elem_audio, caller); + disable_all_codecs(elem_video, caller); + + callee_policy.automatically_initiate=FALSE; + callee_policy.automatically_accept=TRUE; + caller_policy.automatically_initiate=TRUE; + caller_policy.automatically_accept=FALSE; + + linphone_core_set_video_policy(callee->lc,&callee_policy); + linphone_core_set_video_policy(caller->lc,&caller_policy); + + + linphone_core_enable_video_display(callee->lc, TRUE); + linphone_core_enable_video_capture(callee->lc, TRUE); + + linphone_core_enable_video_display(caller->lc, TRUE); + linphone_core_enable_video_capture(caller->lc, TRUE); + + /* Create call params */ + caller_test_params.base = linphone_core_create_call_params(caller->lc, NULL); + + + out_call = linphone_core_invite_address_with_params(caller->lc, callee->identity,caller_test_params.base); + linphone_call_ref(out_call); + + linphone_call_params_destroy(caller_test_params.base); + if (callee_test_params.base) linphone_call_params_destroy(callee_test_params.base); + + + BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); + + BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); + BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); + BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + linphone_call_unref(out_call); + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); + +} + static void simple_call_compatibility_mode(void) { char route[256]; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); @@ -2082,16 +2175,16 @@ void video_call_base_3(LinphoneCoreManager* caller,LinphoneCoreManager* callee, LinphoneCall* callee_call; LinphoneCall* caller_call; - LinphoneVideoPolicy callee_policy, pauline_policy; + LinphoneVideoPolicy callee_policy, caller_policy; if (using_policy) { callee_policy.automatically_initiate=FALSE; callee_policy.automatically_accept=TRUE; - pauline_policy.automatically_initiate=TRUE; - pauline_policy.automatically_accept=FALSE; + caller_policy.automatically_initiate=TRUE; + caller_policy.automatically_accept=FALSE; linphone_core_set_video_policy(callee->lc,&callee_policy); - linphone_core_set_video_policy(caller->lc,&pauline_policy); + linphone_core_set_video_policy(caller->lc,&caller_policy); } linphone_core_enable_video_display(callee->lc, callee_video_enabled); @@ -5875,6 +5968,8 @@ test_t call_tests[] = { { "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 }, From 511d97746210ee8caef02ec3eda8f82934212cd6 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Tue, 12 Jan 2016 17:09:57 +0100 Subject: [PATCH 3/6] Formating: using tabs instead of spaces in previous bug fix. --- coreapi/linphonecall.c | 12 ++-- tester/call_tester.c | 140 ++++++++++++++++++++--------------------- 2 files changed, 76 insertions(+), 76 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 7beedbc78..550c0fb29 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -753,17 +753,17 @@ void linphone_call_make_local_media_description(LinphoneCall *call) { md->streams[call->main_video_stream_index].rtcp_mux = rtcp_mux; strncpy(md->streams[call->main_video_stream_index].name,"Video",sizeof(md->streams[call->main_video_stream_index].name)-1); - codec_hints.bandwidth_limit=0; - codec_hints.max_codecs=-1; - codec_hints.previously_used=old_md ? old_md->streams[call->main_video_stream_index].already_assigned_payloads : NULL; - l=make_codec_list(lc, &codec_hints, SalVideo, lc->codecs_conf.video_codecs); + codec_hints.bandwidth_limit=0; + codec_hints.max_codecs=-1; + codec_hints.previously_used=old_md ? old_md->streams[call->main_video_stream_index].already_assigned_payloads : NULL; + l=make_codec_list(lc, &codec_hints, SalVideo, lc->codecs_conf.video_codecs); - if (params->has_video && l != NULL){ + if (params->has_video && l != NULL){ strncpy(md->streams[call->main_video_stream_index].rtp_addr,linphone_call_get_public_ip_for_stream(call,call->main_video_stream_index),sizeof(md->streams[call->main_video_stream_index].rtp_addr)); strncpy(md->streams[call->main_video_stream_index].rtcp_addr,linphone_call_get_public_ip_for_stream(call,call->main_video_stream_index),sizeof(md->streams[call->main_video_stream_index].rtcp_addr)); md->streams[call->main_video_stream_index].rtp_port=call->media_ports[call->main_video_stream_index].rtp_port; md->streams[call->main_video_stream_index].rtcp_port=call->media_ports[call->main_video_stream_index].rtcp_port; - md->streams[call->main_video_stream_index].payloads=l; + md->streams[call->main_video_stream_index].payloads=l; if (call->videostream && call->videostream->ms.sessions.rtp_session) { char* me = linphone_address_as_string_uri_only(call->me); md->streams[call->main_video_stream_index].rtp_ssrc=rtp_session_get_send_ssrc(call->videostream->ms.sessions.rtp_session); diff --git a/tester/call_tester.c b/tester/call_tester.c index 8c3c2aecc..c0e5858c7 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -717,80 +717,80 @@ static void disable_all_codecs(const MSList* elem, LinphoneCoreManager* call){ ***/ static void call_with_no_audio_codec(void){ - LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); - LinphoneCall* out_call ; - - const MSList* elem =linphone_core_get_audio_codecs(caller->lc); - - disable_all_codecs(elem, caller); - - - out_call = linphone_core_invite_address(caller->lc,callee->identity); - linphone_call_ref(out_call); - BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); - - - BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); - BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); - BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); - - linphone_call_unref(out_call); - linphone_core_manager_destroy(callee); - linphone_core_manager_destroy(caller); + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCall* out_call ; + + const MSList* elem =linphone_core_get_audio_codecs(caller->lc); + + disable_all_codecs(elem, caller); + + + out_call = linphone_core_invite_address(caller->lc,callee->identity); + linphone_call_ref(out_call); + BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); + + + BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); + BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); + BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + linphone_call_unref(out_call); + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); } static void video_call_with_no_audio_and_no_video_codec(void){ - - LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); - LinphoneCall* out_call ; - LinphoneVideoPolicy callee_policy, caller_policy; - LinphoneCallTestParams caller_test_params = {0}, callee_test_params = {0}; - - const MSList* elem_video =linphone_core_get_video_codecs(caller->lc); - - const MSList* elem_audio =linphone_core_get_audio_codecs(caller->lc); - - disable_all_codecs(elem_audio, caller); - disable_all_codecs(elem_video, caller); - - callee_policy.automatically_initiate=FALSE; - callee_policy.automatically_accept=TRUE; - caller_policy.automatically_initiate=TRUE; - caller_policy.automatically_accept=FALSE; - - linphone_core_set_video_policy(callee->lc,&callee_policy); - linphone_core_set_video_policy(caller->lc,&caller_policy); - - - linphone_core_enable_video_display(callee->lc, TRUE); - linphone_core_enable_video_capture(callee->lc, TRUE); - - linphone_core_enable_video_display(caller->lc, TRUE); - linphone_core_enable_video_capture(caller->lc, TRUE); - - /* Create call params */ - caller_test_params.base = linphone_core_create_call_params(caller->lc, NULL); - - - out_call = linphone_core_invite_address_with_params(caller->lc, callee->identity,caller_test_params.base); - linphone_call_ref(out_call); - - linphone_call_params_destroy(caller_test_params.base); - if (callee_test_params.base) linphone_call_params_destroy(callee_test_params.base); - - - BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); - - BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); - BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); - BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); - - linphone_call_unref(out_call); - linphone_core_manager_destroy(callee); - linphone_core_manager_destroy(caller); + + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCall* out_call ; + LinphoneVideoPolicy callee_policy, caller_policy; + LinphoneCallTestParams caller_test_params = {0}, callee_test_params = {0}; + + const MSList* elem_video =linphone_core_get_video_codecs(caller->lc); + + const MSList* elem_audio =linphone_core_get_audio_codecs(caller->lc); + + disable_all_codecs(elem_audio, caller); + disable_all_codecs(elem_video, caller); + + callee_policy.automatically_initiate=FALSE; + callee_policy.automatically_accept=TRUE; + caller_policy.automatically_initiate=TRUE; + caller_policy.automatically_accept=FALSE; + + linphone_core_set_video_policy(callee->lc,&callee_policy); + linphone_core_set_video_policy(caller->lc,&caller_policy); + + + linphone_core_enable_video_display(callee->lc, TRUE); + linphone_core_enable_video_capture(callee->lc, TRUE); + + linphone_core_enable_video_display(caller->lc, TRUE); + linphone_core_enable_video_capture(caller->lc, TRUE); + + /* Create call params */ + caller_test_params.base = linphone_core_create_call_params(caller->lc, NULL); + + + out_call = linphone_core_invite_address_with_params(caller->lc, callee->identity,caller_test_params.base); + linphone_call_ref(out_call); + + linphone_call_params_destroy(caller_test_params.base); + if (callee_test_params.base) linphone_call_params_destroy(callee_test_params.base); + + + BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); + + BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); + BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); + BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + linphone_call_unref(out_call); + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); } From e3e67de9a564be9710faebd00ae2dfe7a0bbc6cf Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Wed, 13 Jan 2016 13:51:53 +0100 Subject: [PATCH 4/6] Updating oRTP for MP4 to be able to use RTCP feedback FIR and PLI. --- oRTP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oRTP b/oRTP index 5208b686f..c774404b8 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 5208b686f0d1abf55d8dcfe84f749ec4878e451c +Subproject commit c774404b804f8383871f4f59368cbcfde29387b0 From fc392c38c2bd063e4d326097b07a0c3c57b7a40d Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 14 Jan 2016 12:11:36 +0100 Subject: [PATCH 5/6] update ortp --- oRTP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oRTP b/oRTP index c774404b8..3c0e10e3a 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit c774404b804f8383871f4f59368cbcfde29387b0 +Subproject commit 3c0e10e3a4ec3e6b69820f890012db8fe3cba6f7 From 48b5d06445b24ce6f3cf433fabd1ef8fe87a2977 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 14 Jan 2016 14:38:23 +0100 Subject: [PATCH 6/6] add user-agent field in ACKs of accepted INVITE transactions --- coreapi/bellesip_sal/sal_op_call.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index 42e636390..482413d6d 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -308,7 +308,7 @@ static void call_process_response(void *op_base, const belle_sip_response_event_ if (code >=200 && code<300) { handle_sdp_from_response(op,response); ack=belle_sip_dialog_create_ack(op->dialog,belle_sip_dialog_get_local_seq_number(op->dialog)); - if (ack==NULL) { + if (ack == NULL) { ms_error("This call has been already terminated."); return ; } @@ -317,6 +317,7 @@ static void call_process_response(void *op_base, const belle_sip_response_event_ belle_sip_object_unref(op->sdp_answer); op->sdp_answer=NULL; } + belle_sip_message_add_header(BELLE_SIP_MESSAGE(ack),BELLE_SIP_HEADER(op->base.root->user_agent)); belle_sip_dialog_send_ack(op->dialog,ack); op->base.root->callbacks.call_accepted(op); /*INVITE*/ op->state=SalOpStateActive;