if (ok && !(profile->pflags & PFLAG_BLIND_REG)) {
type = REG_AUTO_REGISTER;
} else if (!ok) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by acl %s\n", network_ip, profile->reg_acl[x]);
- nua_respond(nh, SIP_403_FORBIDDEN, NUTAG_WITH_THIS(nua), TAG_END());
goto end;
}
}
char hexdigest[2 * SU_MD5_DIGEST_SIZE + 1] = "";
char *domain_name = NULL;
switch_event_t *params = NULL;
+ const char *auth_acl = NULL;
username = realm = nonce = uri = qop = cnonce = nc = response = NULL;
ret = AUTH_FORBIDDEN;
goto end;
}
-
+
if (!(mailbox = (char *) switch_xml_attr(user, "mailbox"))) {
mailbox = username;
}
passwd = val;
}
+ if (!strcasecmp(var, "auth_acl")) {
+ auth_acl = val;
+ }
+
if (!strcasecmp(var, "a1-hash")) {
a1_hash = val;
}
passwd = val;
}
+ if (!strcasecmp(var, "auth_acl")) {
+ auth_acl = val;
+ }
+
if (!strcasecmp(var, "a1-hash")) {
a1_hash = val;
}
}
}
+ if (auth_acl) {
+ if (!switch_check_network_list_ip(ip, auth_acl)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by user acl %s\n", ip, auth_acl);
+ ret = AUTH_FORBIDDEN;
+ goto end;
+ }
+ }
+
if (switch_strlen_zero(passwd) && switch_strlen_zero(a1_hash)) {
ret = AUTH_OK;
goto skip_auth;