From ae0857e88c8bac66c5e825de10c261ff322614f6 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 12 Jan 2012 16:08:03 +0100 Subject: [PATCH] Expose SalReasonNotFound to Linphone application --- coreapi/callbacks.c | 9 ++++++--- coreapi/linphonecore.c | 2 ++ coreapi/linphonecore.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 31aca35c5..a2dfffee3 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -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); } } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 9a8c51208..33c168522 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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"; } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 7f0b18c11..14c850de8 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -202,6 +202,7 @@ enum _LinphoneReason{ LinphoneReasonNoResponse, /**