Skip to content

Commit

Permalink
check invalid returns from auth (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo authored Jan 20, 2017
1 parent 84b8d8b commit 16dd47f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions kamailio/registrar-role.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,15 @@ route[KAZOO_AUTHORIZATION_OK]
$sht(auth_cache=>$Au::nonce) = $var(nonce);
}
#!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]
Expand All @@ -188,7 +194,7 @@ route[CHECK_AUTHORIZATION]
xlog("L_INFO", "$ci|end|OPENBTS attempt for $Au $si:$sp\n");
} else {

if($var(password) == $null) {
if($var(password) == $null || $var(password) == "") {
auth_challenge("$fd", "0");
xlog("L_INFO", "$ci|end|issued auth challenge to registration attempt for $Au $si:$sp\n");
exit;
Expand Down

0 comments on commit 16dd47f

Please sign in to comment.