3.38.24. NoReplyHook Previous topic Parent topic Child topic Next topic

This optional parameter allows you to define a Perl function that will be called if no reply is received from any remote RADIUS server. A reference to the original request received from the NAS is passed as the first argument. A reference to the request that was forwarded to the remote RADIUS server is passed as the second argument. A reference to the reply packet being constructed for return to the NAS is passed as the third argument (note that the normal behaviour in case of no reply, is for no reply to be sent to the NAS).
The hook code is compiled by Perl when Radiator starts up. Compilation errors in your hook code will be reported to the log file at start-up time. Runtime errors in your hook will also be reported to the log file when your hook executes. Multiline hooks (i.e. with trailing backslashes (\)) are parsed by Radiator into one long line. Therefore you should not use trailing comments in your hook.
NoReplyHook can be an arbitrarily complicated Perl function, that might run external processes, consult databases, change the contents of the current request or many other things.
# Call an AuthBy SQL to handle accounting that
# failed to get to the remote server
NoReplyHook sub { Radius::AuthGeneric::find('SQL')\
      ->handle_request(${$_[0]}, ${$_[2]});}
See NoReplyReject parameter in case you need to return a reject back to the NAS. Setting this parameter may be quicker than creating a hook to trigger a reject.