#include "private.h"
#include "mediastreamer2/mediastream.h"
+static void register_failure(SalOp *op, SalError error, SalReason reason, const char *details);
static void linphone_connect_incoming(LinphoneCore *lc, LinphoneCall *call){
if (lc->ringstream!=NULL){
sal_op_authenticate(h,&sai);
ai->usecount++;
}else{
+ if (ai && ai->works==FALSE) {
+ register_failure(h, SalErrorFailure, SalReasonForbidden, _("Authentication failure"));
+ }
if (lc->vtable.auth_info_requested)
lc->vtable.auth_info_requested(lc,realm,username);
}
char *msg;
cfg->registered=registered;
+ linphone_proxy_config_set_error(cfg,LinphoneErrorNone);
linphone_proxy_config_set_state(cfg, registered ? LinphoneRegistrationOk : LinphoneRegistrationCleared ,
registered ? "Registration sucessful" : "Unregistration done");
if (lc->vtable.display_status){
lc->vtable.display_status(lc,msg);
ms_free(msg);
}
+ if (error== SalErrorFailure && reason == SalReasonForbidden) {
+ linphone_proxy_config_set_error(cfg, LinphoneErrorBadCredentials);
+ } else if (error == SalErrorNoResponse) {
+ linphone_proxy_config_set_error(cfg, LinphoneErrorNoResponse);
+ }
linphone_proxy_config_set_state(cfg,LinphoneRegistrationFailed,details);
}
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);
+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);
int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, LinphoneProxyConfig *dest_proxy);
void linphone_core_start_pending_refered_calls(LinphoneCore *lc);
extern SalCallbacks linphone_sal_callbacks;
-
+void linphone_proxy_config_set_error(LinphoneProxyConfig *cfg,LinphoneError error);
struct _LinphoneProxyConfig
{
bool_t dial_escape_plus;
void* user_data;
time_t deletion_date;
+ LinphoneError error;
};
struct _LinphoneAuthInfo