(RADIATOR) PreProcessing Hooks

Timothy G. Wells Tim.Wells at goodnews.net
Thu Apr 25 22:20:31 CDT 2002


Greetings,

For reasons of making my config file easier to read I would like to set a 
variable to be available for various logging routines.

It seems that the %{Provider} does resolve correctly in any AuthLog items 
but not for the Session databases.

I have a PreProcessingHook defined in a handler clause with a snippet of 
code shown below...

<Handler Called-Station-Id = /4400|6184647|4991/>

         AuthByPolicy ContinueWhileAccept


         AcctLogFileName         %L/details
         # ExcludeFromPasswordLog        admin

         SessionDatabase         goodnews-modems
     AuthLog             goodnews
     AuthLog             goodnews-sql


         PreProcessingHook       sub {${$_[0]} -> add_attr('Provider', 
%{GlobalVar:ISP-GoodNews});}



Here's the SessionDatabase clause ... The AddQuery with a comment character 
was the one that didn't seem to work. I commented it out to go back to the 
way I was doing it.




<SessionDatabase SQL>
         DBSource            dbi:mysql:radius
         DBUsername          tgwells
         DBAuth              debbie9
         Identifier          goodnews-modems
         AddQuery            insert into online (username, naslocation, 
nasidentifier, nasport, acctsessionid, framedipaddress, nasporttype, 
connectinfo, callingstationid, provider) values 
('%U','%{Client:Identifier}','%N','%{NAS-Port}','%{Acct-Session-Id}','%{Framed-IP-Address}','%{NAS-Port-Type}', 
'%{Connect-Info}%{Ascend-Xmit-Rate}', '%{Calling-Station-Id}', 
'%{GlobalVar:ISP-GoodNews}')
#       AddQuery            insert into online (username, naslocation, 
nasidentifier, nasport, acctsessionid, framedipaddress, nasporttype, 
connectinfo, callingstationid, provider) values 
('%U','%{Client:Identifier}','%N','%{NAS-Port}','%{Acct-Session-Id}','%{Framed-IP-Address}','%{NAS-Port-Type}', 
'%{Connect-Info}%{Ascend-Xmit-Rate}', '%{Calling-Station-Id}', '%{Provider}')
         DeleteQuery         delete from online where username='%U' and 
nasidentifier='%N' and nasport='%{NAS-Port}' and 
provider='%{GlobalVar:ISP-GoodNews}'
#       DeleteQuery         delete from online where username='%U' and 
nasidentifier='%N' and nasport='%{NAS-Port}' and provider='%{Provider}'
         ClearNasQuery   delete from online where nasidentifier='%N'
         CountQuery          select nasidentifier, nasport, acctsessionid 
from online where username='%U' and provider='%{GlobalVar:ISP-GoodNews}'
</SessionDatabase>


Another Question related to this:

Is there a way to define a varaible with a value that can be read by any 
processes related to that handler / realm where that variable was given a 
value?

Thanks,

-- Tim



===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list