From 41d885bc208113a7c0c9513b77caff3e81c4074d Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 10 May 2013 15:42:08 +0200 Subject: [PATCH] fix call without SDP add specific test for this case add missing EXTRA_DIST --- coreapi/bellesip_sal/sal_op_call.c | 6 ++++-- tester/Makefile.am | 2 ++ tester/call_tester.c | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index 7dd98f2ce..28a46bd93 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -260,11 +260,10 @@ static void call_response_event(void *op_base, const belle_sip_response_event_t ack=belle_sip_dialog_create_ack(op->dialog,belle_sip_dialog_get_local_seq_number(op->dialog)); if (ack==NULL) { ms_error("This call has been already terminated."); - return ; } if (op->sdp_answer){ - set_sdp(BELLE_SIP_MESSAGE(response),op->sdp_answer); + set_sdp(BELLE_SIP_MESSAGE(ack),op->sdp_answer); belle_sip_object_unref(op->sdp_answer); op->sdp_answer=NULL; } @@ -558,6 +557,7 @@ int sal_call(SalOp *op, const char *from, const char *to){ } + void sal_op_call_fill_cbs(SalOp*op) { op->callbacks.process_io_error=call_process_io_error; op->callbacks.process_response_event=call_response_event; @@ -567,6 +567,7 @@ void sal_op_call_fill_cbs(SalOp*op) { op->callbacks.process_dialog_terminated=process_dialog_terminated; op->type=SalOpCall; } + static void handle_offer_answer_response(SalOp* op, belle_sip_response_t* response) { if (op->base.local_media){ /*this is the case where we received an invite without SDP*/ @@ -584,6 +585,7 @@ static void handle_offer_answer_response(SalOp* op, belle_sip_response_t* respon ms_error("You are accepting a call but not defined any media capabilities !"); } } + int sal_call_notify_ringing(SalOp *op, bool_t early_media){ int status_code =early_media?183:180; belle_sip_request_t* req=belle_sip_transaction_get_request(BELLE_SIP_TRANSACTION(op->pending_server_trans)); diff --git a/tester/Makefile.am b/tester/Makefile.am index 24523893f..6b5e9edae 100644 --- a/tester/Makefile.am +++ b/tester/Makefile.am @@ -1,3 +1,5 @@ +EXTRA_DIST=pauline_rc laure_rc marie_rc marie_no_sdp_rc + if BUILD_CUNIT_TESTS diff --git a/tester/call_tester.c b/tester/call_tester.c index 62683d2fa..6c1f51137 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -384,6 +384,20 @@ static void call_terminated_by_caller(void) { linphone_core_manager_destroy(pauline); } +static void call_with_no_sdp(void) { + LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_no_sdp_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc"); + + CU_ASSERT_TRUE(call(marie,pauline)); + /*just to sleep*/ + linphone_core_terminate_all_calls(pauline->lc); + CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallEnd,1)); + CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallEnd,1)); + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} + static void call_with_ice(void) { LinphoneCoreManager* marie = linphone_core_manager_new(liblinphone_tester_file_prefix, "marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new(liblinphone_tester_file_prefix, "pauline_rc"); @@ -805,6 +819,7 @@ test_t call_tests[] = { { "Simple call compatibility mode", simple_call_compatibility_mode }, { "Early-media call", early_media_call }, { "Call terminated by caller", call_terminated_by_caller }, + { "Call without SDP", call_with_no_sdp}, { "Call paused resumed", call_paused_resumed }, { "Call paused resumed from callee", call_paused_resumed_from_callee }, #ifdef SRTP_ENABLED