|
|
|
@ -79,22 +79,26 @@ route[ATTEMPT_AUTHORIZATION] |
|
|
|
} else { |
|
|
|
$var(amqp_payload_request) = "{'Event-Category' : 'directory' , 'Event-Name' : 'authn_req', 'Method' : 'REGISTER', 'Auth-Realm' : '" + $fd + "', 'Auth-User' : '" + $fU + "', 'From' : '" + $fu + "', 'To' : '" + $tu +"' }"; |
|
|
|
$var(amqp_routing_key) = "authn.req." + $(fd{kz.encode}); |
|
|
|
sl_send_reply("100", "Attempting K query"); |
|
|
|
sl_send_reply("100", "Attempting registrar query"); |
|
|
|
if(kazoo_query("callmgr", $var(amqp_routing_key), $var(amqp_payload_request))) { |
|
|
|
$var(password) = $(kzR{kz.json,Auth-Password}); |
|
|
|
$xavp(ulattrs=>custom_channel_vars) = $(kzR{kz.json,Custom-Channel-Vars}); |
|
|
|
xlog("L_INFO", "$ci|log|authenticating $Au via Kazoo query response"); |
|
|
|
xlog("L_INFO", "$ci|log|authenticating $Au via registrar query response"); |
|
|
|
} else { |
|
|
|
xlog("L_INFO", "$ci|log|failed to query Kazoo for authentication credentials for $Au $si:$sp"); |
|
|
|
xlog("L_INFO", "$ci|log|failed to query registrar for authentication credentials for $Au $si:$sp"); |
|
|
|
append_to_reply("Retry-After: 60\r\n"); |
|
|
|
sl_send_reply("500", "Retry Later"); |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if($var(password) == $null) { |
|
|
|
if($var(password) == $null || $var(password) == "") { |
|
|
|
#!ifdef ANTIFLOOD-ROLE |
|
|
|
route(ANITFLOOD_FAILED_AUTH); |
|
|
|
#!endif |
|
|
|
|
|
|
|
auth_challenge("$fd", "0"); |
|
|
|
xlog("L_INFO", "$ci|end|issued auth challenge to registration attempt for $Au $si:$sp"); |
|
|
|
xlog("L_INFO", "$ci|end|issued auth challenge to registration attempt for $Au $si:$sp due to empty password"); |
|
|
|
exit; |
|
|
|
} |
|
|
|
|
|
|
|
|