From 56efb47f2cd1c95a4baee4eee1fb266b12c750d0 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 26 Sep 2017 15:07:18 +0200 Subject: [PATCH] Fix NULL reason header & missed call when time out --- coreapi/bellesip_sal/sal_op_call.c | 2 +- coreapi/linphonecall.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index a7e91639c..1236331f3 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -927,7 +927,7 @@ int sal_call_accept(SalOp*h){ } static belle_sip_header_reason_t *sal_call_make_reason_header( const SalErrorInfo *info){ - if (info != NULL){ + if (info != NULL && info->reason != SalReasonNone){ belle_sip_header_reason_t* reason = BELLE_SIP_HEADER_REASON(belle_sip_header_reason_new()); belle_sip_header_reason_set_text(reason, info->status_string); belle_sip_header_reason_set_protocol(reason,info->protocol); diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 60f708906..e295a6733 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1862,19 +1862,19 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const #ifdef __ANDROID__ ms_message("Call [%p] acquires both wifi and multicast lock",call); linphone_core_wifi_lock_acquire(call->core); - linphone_core_multicast_lock_acquire(call->core); /*does no affect battery more than regular rtp traffic*/ + linphone_core_multicast_lock_acquire(call->core); //does no affect battery more than regular rtp traffic*/ #endif break; case LinphoneCallEnd: case LinphoneCallError: switch(linphone_error_info_get_reason(linphone_call_get_error_info(call))) { case LinphoneReasonDeclined: - call->log->status=LinphoneCallDeclined; + if(call->log->status == LinphoneCallSuccess) // Do not re-change the status of a call if it's already set + call->log->status = LinphoneCallDeclined; break; case LinphoneReasonNotAnswered: - if (call->log->dir == LinphoneCallIncoming){ - call->log->status=LinphoneCallMissed; - } + if (call->log->dir == LinphoneCallIncoming) + call->log->status = LinphoneCallMissed; break; case LinphoneReasonNone: if (call->log->dir == LinphoneCallIncoming){