Commit db0191ec authored by Sandrine Avakian's avatar Sandrine Avakian
Browse files

Renaming functions :

-linphone_call_error_info_to_sal_op into linphone_error_info_to_sal as there is no LinponeCall object  involved here.
- linphone_call_terminate_with_error into linphone_call_terminate_with_error_info
Fixes in linphone_call_terminate_with_error_info.
parent 5f9ba4ea
......@@ -5088,7 +5088,7 @@ int linphone_call_terminate(LinphoneCall *call) {
return 0;
}
static void linphone_call_error_info_to_sal_op(const LinphoneErrorInfo* ei, SalErrorInfo* sei){
static void linphone_error_info_to_sal(const LinphoneErrorInfo* ei, SalErrorInfo* sei){
sei->reason = linphone_error_info_get_reason(ei);
sei->status_string = bctbx_strdup(ei->phrase);
......@@ -5098,13 +5098,9 @@ static void linphone_call_error_info_to_sal_op(const LinphoneErrorInfo* ei, SalE
sei->protocol = bctbx_strdup(ei->protocol);
}
int linphone_call_terminate_with_error(LinphoneCall *call , const LinphoneErrorInfo *ei){
int linphone_call_terminate_with_error_info(LinphoneCall *call , const LinphoneErrorInfo *ei){
SalErrorInfo sei;
if (ei != NULL)
{
linphone_call_error_info_to_sal_op(ei, &sei);
}
ms_message("Terminate call [%p] which is currently in state %s", call, linphone_call_state_to_string(call->state));
switch (call->state) {
case LinphoneCallReleased:
......@@ -5121,14 +5117,18 @@ int linphone_call_terminate_with_error(LinphoneCall *call , const LinphoneErrorI
call->op = NULL;
break;
default:
if (ei == NULL){
sal_call_terminate(call->op);
}
else{
linphone_error_info_to_sal(ei, &sei);
sal_call_terminate_with_error(call->op, &sei);
sal_error_info_reset(&sei);
}
break;
}
terminate_call(call);
return 0;
......
......@@ -383,7 +383,7 @@ LINPHONE_PUBLIC int linphone_call_resume(LinphoneCall *call);
* @param[in] call LinphoneCall object
* @return 0 on success, -1 on failure
**/
LINPHONE_PUBLIC int linphone_call_terminate_with_error(LinphoneCall *call, const LinphoneErrorInfo *ei);
LINPHONE_PUBLIC int linphone_call_terminate_with_error_info(LinphoneCall *call, const LinphoneErrorInfo *ei);
/**
* Redirect the specified call to the given redirect URI.
......
......@@ -981,14 +981,17 @@ static void simple_call_compatibility_mode(void) {
}
static void terminate_call_with_error(void) {
LinphoneCall* call_callee ;
LinphoneErrorInfo *ei ;
const LinphoneErrorInfo *rei ;
LinphoneCoreManager *callee_mgr = linphone_core_manager_new("marie_rc");
LinphoneCoreManager *caller_mgr = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
LinphoneCall* out_call = linphone_core_invite_address(caller_mgr->lc,callee_mgr->identity);
LinphoneCall* call_callee ;
linphone_call_ref(out_call);
LinphoneErrorInfo *ei = linphone_error_info_new();
ei = linphone_error_info_new();
linphone_error_info_set(ei, NULL, LinphoneReasonNone, 200, "Call completed elsewhere", NULL);
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallOutgoingInit,1));
......@@ -1006,9 +1009,9 @@ static void terminate_call_with_error(void) {
BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallStreamsRunning, 1));
const LinphoneErrorInfo *rei = ei;
rei = ei;
linphone_call_terminate_with_error(out_call,rei);
linphone_call_terminate_with_error_info(out_call,rei);
BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_PTR_NOT_NULL(rei);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment