]> sjero.net Git - linphone/commitdiff
Expose SalReasonNotFound to Linphone application
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@linphone.org>
Thu, 12 Jan 2012 15:08:03 +0000 (16:08 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@linphone.org>
Fri, 13 Jan 2012 14:08:05 +0000 (15:08 +0100)
coreapi/callbacks.c
coreapi/linphonecore.c
coreapi/linphonecore.h

index 31aca35c5cbb287670f27dab2569df76412da2fc..a2dfffee3779c60e687caa9a9fb6a76f5ffd9fb3 100644 (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);
        }
 }
 
index 9a8c5120865fd9a4e5e00a8f8a006eb02ad5435a..33c168522498166fd64680f07eb1235cac48ac3a 100644 (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";
 }
index 7f0b18c115577432536ccc05b5540ea1dfd8875e..14c850de836952363e74a5de24a180a2330f8d23 100644 (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;