Browse Source

check invalid returns from auth (#129)

4.1
lazedo 9 years ago
committed by GitHub
parent
commit
16dd47fcda
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      kamailio/registrar-role.cfg

+ 10
- 4
kamailio/registrar-role.cfg View File

@ -168,9 +168,15 @@ route[KAZOO_AUTHORIZATION_OK]
$sht(auth_cache=>$Au::nonce) = $var(nonce); $sht(auth_cache=>$Au::nonce) = $var(nonce);
} }
#!endif #!endif
$xavp(ulattrs=>custom_channel_vars) = $(kzR{kz.json,Custom-Channel-Vars});
xlog("L_INFO", "$ci|log|authenticating $Au via Kazoo query response\n");
route(CHECK_AUTHORIZATION);
if( $(kzR{kz.json,Event-Name}) == "authn_err" ) {
auth_challenge("$fd", "0");
xlog("L_INFO", "$ci|end|issued auth challenge to registration attempt for $Au $si:$sp\n");
exit;
} else {
$xavp(ulattrs=>custom_channel_vars) = $(kzR{kz.json,Custom-Channel-Vars});
xlog("L_INFO", "$ci|log|authenticating $Au via Kazoo query response\n");
route(CHECK_AUTHORIZATION);
}
} }
route[KAZOO_AUTHORIZATION_ERROR] route[KAZOO_AUTHORIZATION_ERROR]
@ -188,7 +194,7 @@ route[CHECK_AUTHORIZATION]
xlog("L_INFO", "$ci|end|OPENBTS attempt for $Au $si:$sp\n"); xlog("L_INFO", "$ci|end|OPENBTS attempt for $Au $si:$sp\n");
} else { } else {
if($var(password) == $null) {
if($var(password) == $null || $var(password) == "") {
auth_challenge("$fd", "0"); auth_challenge("$fd", "0");
xlog("L_INFO", "$ci|end|issued auth challenge to registration attempt for $Au $si:$sp\n"); xlog("L_INFO", "$ci|end|issued auth challenge to registration attempt for $Au $si:$sp\n");
exit; exit;


Loading…
Cancel
Save