]> sjero.net Git - linphone/commitdiff
add error reason reporting api
authorSimon Morlat <simon.morlat@linphone.org>
Fri, 24 Sep 2010 11:12:43 +0000 (13:12 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Fri, 24 Sep 2010 11:12:43 +0000 (13:12 +0200)
coreapi/linphonecore.c
coreapi/linphonecore.h

index c0f7d83fdff16708154e617a757b58e40e4757f8..384943a93ae5f6adca64d26f05ca002fffe86395 100644 (file)
@@ -3919,3 +3919,15 @@ LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *l
        p->has_video=linphone_core_video_enabled(lc);
        return p;
 }
+
+const char *linphone_error_to_string(LinphoneError err){
+       switch(err){
+               case LinphoneErrorNone:
+                       return "No error";
+               case LinphoneErrorNoResponse:
+                       return "No response";
+               case LinphoneErrorBadCredentials:
+                       return "Bad credentials";
+       }
+       return "unknown error";
+}
index 35623d5903f848816c8135ce13d9ed0b72139a11..40c231dff8fcf60522c01a7486446a419d43e48a 100644 (file)
@@ -166,6 +166,19 @@ typedef struct _LinphoneCallParams LinphoneCallParams;
 void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled);
 void linphone_call_params_destroy(LinphoneCallParams *cp);
 
+/**
+ * Enum describing failure reasons.
+**/
+enum _LinphoneError{
+       LinphoneErrorNone,
+       LinphoneErrorNoResponse, /**<No response received from remote*/
+       LinphoneErrorBadCredentials /**<Authentication failed due to bad or missing credentials*/
+};
+
+typedef enum _LinphoneError LinphoneError;
+
+const char *linphone_error_to_string(LinphoneError err);
+
 /**
  * The LinphoneCall object represents a call issued or received by the LinphoneCore
 **/
@@ -206,6 +219,9 @@ const char *linphone_call_get_refer_to(const LinphoneCall *call);
 bool_t linphone_call_has_transfer_pending(const LinphoneCall *call);
 int linphone_call_get_duration(const LinphoneCall *call);
 const LinphoneCallParams linphone_call_get_current_params(const LinphoneCall *call);
+void linphone_call_enable_camera(LinphoneCall *lc, bool_t enabled);
+bool_t linphone_call_camera_enabled(const LinphoneCall *lc);
+LinphoneError linphone_call_get_error(const LinphoneCall *call);
 void *linphone_call_get_user_pointer(LinphoneCall *call);
 void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
 
@@ -320,6 +336,8 @@ struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig
 bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
 const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfig *cfg);
 
+LinphoneError linphone_proxy_config_get_error(const LinphoneProxyConfig *cfg);
+
 /* destruction is called automatically when removing the proxy config */
 void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
 void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type);