fix call without SDP

add specific test for this case
add missing EXTRA_DIST
This commit is contained in:
Simon Morlat 2013-05-10 15:42:08 +02:00
parent 9ac3d64c86
commit 41d885bc20
3 changed files with 21 additions and 2 deletions

View file

@ -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));

View file

@ -1,3 +1,5 @@
EXTRA_DIST=pauline_rc laure_rc marie_rc marie_no_sdp_rc
if BUILD_CUNIT_TESTS

View file

@ -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