Expose SalReasonNotFound to Linphone application

This commit is contained in:
Pierre-Eric Pelloux-Prayer 2012-01-12 16:08:03 +01:00
parent d58f20004c
commit ae0857e88c
3 changed files with 9 additions and 3 deletions

View file

@ -523,7 +523,6 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
lc->vtable.display_status(lc,msg480);
break;
case SalReasonNotFound:
msg=_("Not found");
if (lc->vtable.display_status)
lc->vtable.display_status(lc,msg);
break;
@ -563,10 +562,14 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
lc->ringstream=NULL;
}
linphone_call_stop_media_streams (call);
if (sr!=SalReasonDeclined) linphone_call_set_state(call,LinphoneCallError,msg);
else{
if (sr == SalReasonDeclined) {
call->reason=LinphoneReasonDeclined;
linphone_call_set_state(call,LinphoneCallEnd,"Call declined.");
} else if (sr == SalReasonNotFound) {
call->reason=LinphoneReasonNotFound;
linphone_call_set_state(call,LinphoneCallError,"User not found.");
} else {
linphone_call_set_state(call,LinphoneCallError,msg);
}
}

View file

@ -4365,6 +4365,8 @@ const char *linphone_reason_to_string(LinphoneReason err){
return "Bad credentials";
case LinphoneReasonDeclined:
return "Call declined";
case LinphoneReasonNotFound:
return "User not found";
}
return "unknown error";
}

View file

@ -202,6 +202,7 @@ enum _LinphoneReason{
LinphoneReasonNoResponse, /**<No response received from remote*/
LinphoneReasonBadCredentials, /**<Authentication failed due to bad or missing credentials*/
LinphoneReasonDeclined, /**<The call has been declined*/
LinphoneReasonNotFound,
};
typedef enum _LinphoneReason LinphoneReason;