diff --git a/kamailio/registrar-role.cfg b/kamailio/registrar-role.cfg index cfdd0e6..3474fd0 100644 --- a/kamailio/registrar-role.cfg +++ b/kamailio/registrar-role.cfg @@ -126,6 +126,9 @@ route[AUTHORIZATION_CHECK] route[ATTEMPT_AUTHORIZATION] { + #!ifdef PUSHER_ROLE + route(PUSHER_ATTEMPT_REGISTRATION); + #!endif $var(nonce) = $(uuid(g){s.rm,-}); #!ifdef OPENBTS_AUTH_ROLE @@ -208,33 +211,27 @@ route[KAZOO_AUTHORIZATION_ERROR] route[CHECK_AUTHORIZATION] { - if($ua =~ "OpenBTS") { xlog("L_INFO", "$ci|end|OPENBTS attempt for $Au $si:$sp\n"); } else { - 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; - } - - if (!pv_auth_check("$fd", "$var(password)", "0", "0")) { - #!ifdef ANTIFLOOD_ROLE - route(ANITFLOOD_FAILED_AUTH); - #!endif + 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; + } - auth_challenge("$fd", "0"); - xlog("L_WARNING", "$ci|end|issued auth challenge to failed registration attempt for $Au from IP $si:$sp\n"); - exit; - } + if (!pv_auth_check("$fd", "$var(password)", "0", "0")) { + #!ifdef ANTIFLOOD_ROLE + route(ANITFLOOD_FAILED_AUTH); + #!endif + auth_challenge("$fd", "0"); + xlog("L_WARNING", "$ci|end|issued auth challenge to failed registration attempt for $Au from IP $si:$sp\n"); + exit; + } } - - - - #!ifdef ANTIFLOOD_ROLE route(ANTIFLOOD_SUCCESSFUL_AUTH); #!endif @@ -248,7 +245,6 @@ route[CHECK_AUTHORIZATION] route[SAVE_LOCATION] { - if ($sht(auth_cache=>$Au) == $null) { xlog("L_INFO", "$ci|log|caching sip credentials for $Au\n"); }; @@ -331,7 +327,7 @@ route[SAVE_LOCATION] #!ifdef KZ_TCP_REGISTRAR_PORT case "tcp": - $var(port) = KZ_UDP_REGISTRAR_PORT; + $var(port) = KZ_TCP_REGISTRAR_PORT; break; #!endif