add error reason reporting api

This commit is contained in:
Simon Morlat 2010-09-24 13:12:43 +02:00
parent 8fbba8c7f0
commit e40e702d3a
2 changed files with 30 additions and 0 deletions

View 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";
}

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