Fix NULL reason header & missed call when time out

This commit is contained in:
Benjamin Reis 2017-09-26 15:07:18 +02:00
parent 9d35ff433b
commit 56efb47f2c
2 changed files with 6 additions and 6 deletions

View file

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

View file

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