From aae5ae888c24542bda99ecdef882f0fa0f607670 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 15 May 2013 10:53:34 +0200 Subject: [PATCH] improve custom header so that they work with responses too --- coreapi/bellesip_sal/sal_impl.c | 2 ++ coreapi/bellesip_sal/sal_op_impl.c | 2 ++ coreapi/linphonecall.c | 4 ++-- tester/call_tester.c | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index 9bce7aee6..a241f1692 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -233,6 +233,8 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even if (!op->base.call_id) { op->base.call_id=ms_strdup(belle_sip_header_call_id_get_call_id(BELLE_SIP_HEADER_CALL_ID(belle_sip_message_get_header_by_type(BELLE_SIP_MESSAGE(response), belle_sip_header_call_id_t)))); } + sal_op_assign_recv_headers(op,(belle_sip_message_t*)response); + if (op->callbacks.process_response_event) { if (op->base.root->nat_helper_enabled) { diff --git a/coreapi/bellesip_sal/sal_op_impl.c b/coreapi/bellesip_sal/sal_op_impl.c index a18037ba8..a7f8b796a 100644 --- a/coreapi/bellesip_sal/sal_op_impl.c +++ b/coreapi/bellesip_sal/sal_op_impl.c @@ -27,6 +27,7 @@ SalOp * sal_op_new(Sal *sal){ sal_op_ref(op); return op; } + void sal_op_release(SalOp *op){ op->state=SalOpStateTerminated; sal_op_set_user_pointer(op,NULL);/*mandatory because releasing op doesn not mean freeing op. Make sure back pointer will not be used later*/ @@ -35,6 +36,7 @@ void sal_op_release(SalOp *op){ } sal_op_unref(op); } + void sal_op_release_impl(SalOp *op){ ms_message("Destroying op [%p] of type [%s]",op,sal_op_type_to_string(op->type)); if (op->pending_auth_transaction) belle_sip_object_unref(op->pending_auth_transaction); diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 1e9d9b048..5735cb777 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -827,9 +827,9 @@ const LinphoneCallParams * linphone_call_get_remote_params(LinphoneCall *call){ cp->low_bandwidth=TRUE; } } - cp->custom_headers=(SalCustomHeader*)sal_op_get_recv_custom_header(call->op); - return cp; } + cp->custom_headers=(SalCustomHeader*)sal_op_get_recv_custom_header(call->op); + return cp; } return NULL; } diff --git a/tester/call_tester.c b/tester/call_tester.c index 6c1f51137..4b74cabe8 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -466,6 +466,8 @@ static void call_with_custom_headers(void) { CU_ASSERT_PTR_NOT_NULL(hvalue); CU_ASSERT_TRUE(strcmp(hvalue,"bad")==0); + CU_ASSERT_PTR_NOT_NULL(linphone_call_get_remote_contact(c1)); + /*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));