ai->usecount++;
}else{
if (ai && ai->works==FALSE) {
- register_failure(h, SalErrorFailure, SalReasonForbidden, _("Authentication failure"));
+ sal_op_cancel_authentication(h);
}
if (lc->vtable.auth_info_requested)
lc->vtable.auth_info_requested(lc,realm,username);
void sal_op_set_to(SalOp *op, const char *to);
void sal_op_release(SalOp *h);
void sal_op_authenticate(SalOp *h, const SalAuthInfo *info);
+void sal_op_cancel_authentication(SalOp *h);
void sal_op_set_user_pointer(SalOp *h, void *up);
int sal_op_get_auth_requested(SalOp *h, const char **realm, const char **username);
const char *sal_op_get_from(const SalOp *op);
#endif
#include "sal_eXosip2.h"
-
+#include "private.h"
#include "offeranswer.h"
static void text_received(Sal *sal, eXosip_event_t *ev);
h->auth_info=sal_auth_info_clone(info); /*store auth info for subsequent request*/
}
}
+void sal_op_cancel_authentication(SalOp *h) {
+ if (h->rid >0) {
+ sal_op_get_sal(h)->callbacks.register_failure(h,SalErrorFailure, SalReasonForbidden,_("Authentication failure"));
+ } else if (h->cid >0) {
+ sal_op_get_sal(h)->callbacks.call_failure(h,SalErrorFailure, SalReasonForbidden,_("Authentication failure"),0);
+ } else {
+ ms_warning("Auth failure not handled");
+ }
+}
static void set_network_origin(SalOp *op, osip_message_t *req){
const char *received=NULL;
int rport=5060;