sub {
	my $custlog = "/usr/local/radius/logs/customer.login";
	my $dolog = 1;
	my $time = time;
	my $ctime = localtime($time);

	my $nas_ip = ${$_[0]}->get_attr('NAS-IP-Address');
	my $phone = ${$_[0]}->get_attr('Called-Station-Id');
	my $acctyp = ${$_[0]}->get_attr('Acct-Status-Type');
	my $user = ${$_[0]}->get_attr('User-Name');
	my $reply = ${$_[1]}->get_attr('Reply-Message'); 
	my $res = "NULL";

	$res = "DENY"
        	if ${$_[2]} == $main::REJECT;
	$res = "ACCEPT"
        	if ${$_[2]} == $main::ACCEPT;

	if ($nas_ip eq "203.12.144.18")
	{
        	$nas_ip = "POP3 mail";
		$reply = "NULL";
	}
        if ($nas_ip eq "203.12.144.11")
        {
                $nas_ip = "Shell login";
		$reply = "NULL";
        }

	if (($acctyp eq "Start") || ($acctyp eq "Stop") || ($acctyp eq "Alive"))
	{
        	$dolog = 0;
	}

	if ($dolog == 1)
	{
        	open(LOG, ">>$custlog");
        	print LOG "$ctime: UserName \"$user\": Dialed $phone - $nas_ip - $reply - $res \n";
        	close(LOG);
	}
}
