<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EstiloCorreo17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=ES link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US>Hi, first of all I want to clarify that I
am a new user of Radiator and my knowledge of Perl language is very poor. We
are trying to move from version 3.15 to 4.3.1 and some problems a problem
appered to us with the old Global "preClientHook" statement in the
new version. How should I call PreClientHook.cfg to work in using ClientListSQL
?. I´ve already finish reading the revision history of versions 4.3 and 4.3.1
and the reference manual but I still have very clear how to implement this in
our server. <br>
<br>
Our radius.conf looks something like this: <br>
------------------------------------------------------------- <br>
<ClientListSQL> <br>
DBSource
dbi:Oracle:%{GlobalVar:DBInstance} <br>
DBUsername
%{GlobalVar:DBUsername} <br>
DBAuth
%{GlobalVar:DBAuth} <br>
DBSource
dbi:Oracle:%{GlobalVar:DBInstance} <br>
DBUsername
%{GlobalVar:DBUsername} <br>
DBAuth
%{GlobalVar:DBAuth} <br>
GetClientQuery
SELECT nas_ip_address,secret from tbl_radclient WHERE nas_ip_address IS
NOT NULL and secret IS NOT NULL <br>
BackupFilename
%D/clientlist.%{GlobalVar:CodeType}.%{GlobalVar:IpAddress}.dat <br>
RefreshPeriod
3600 <br>
Timeout
2 <br>
FailureBackoffTime 0 <br>
ConnectionHook
file:"%D/ConnectionHook.cfg" <br>
</ClientListSQL> <br>
<br>
PreClientHook file:"%D/PreClientHook.cfg" <br>
------------------------------------------------- <br>
<br>
PreClientHook.cfg----->>> <br>
<br>
sub { <br>
my $p=${$_[0]}; <br>
my $nasip=$p->get_attr('NAS-IP-Address'); <br>
my $ip=&Radius::Util::format_special('%c', $p);
<br>
my $nasport=$p->get_attr('NAS-Port'); <br>
my $callid=$p->get_attr('Calling-Station-Id'); <br>
<br>
&main::log($main::LOG_DEBUG,'Into
PreClientHook'); <br>
&main::log($main::LOG_DEBUG,"NASIP=[$nasip]
NASPORT=[$nasport] SOURCE_IP=[$ip] CallId=[$callid]"); <br>
if($ip ne '192.168.0.1' and $ip ne
'192.168.0.2') { <br>
$p->change_attr('NAS-IP-Address',$ip) if $nasip ne $ip; <br>
} <br>
<br>
$p->add_attr('NAS-Port',$callid) unless defined
$nasport; <br>
$p->delete_attr('State'); <br>
if ($p->code eq 'Accounting-Request' &&
$p->get_attr('Acct-Status-Type') eq 'Stop') { <br>
my %ascend2ietf = ( <br>
'remoteEndHungup' => 'User-Request', <br>
'pppRcvTerminate' => 'User-Request', <br>
'sessTimeOut' =>
'Session-Timeout', <br>
'240'
=> 'Host-Request', <br>
); <br>
<br>
my
$ascend_disconnect_cause = $p->get_attr('Ascend-Disconnect-Cause'); <br>
if($ascend_disconnect_cause) { <br>
my $newval=$ascend2ietf{$ascend_disconnect_cause}; <br>
$newval='Lost-Carrier' <br>
unless defined $newval; <br>
$p->change_attr('Acct-Terminate-Cause', $newval); <br>
} <br>
} <br>
} <br>
------------------------------------------- <br>
<br>
thanks, <br>
Dario Aguilar<o:p></o:p></span></p>
</div>
</body>
</html>