Here is a best guess.
 
FR is only going to issue queries as defined in the config file for oracle. 
The only queries that are going to work for auths are going to be selects, since you must retreive data for an auth.
 
I think you need to calculate the credit time based on a DB trigger in the Accounting table at the conclusion of each call, and use that to update radreply and or radcheck as may be necessary.  Each trigger execution should probably be something like "time left=time left-call duration" so that if you purge the accounting tables, the lost records won't matter.
 
This will likely perform better for auths also, since you aren't executing a potentially long running trigger at auth time.
 
I dont think ExecProgramWait is going to do what you want at all.
 
Tim
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Alex Zhang
Sent: Wednesday, January 15, 2003 9:28 PM
To: [EMAIL PROTECTED]
Subject: Authorization

Hi,
I'm trying to use freeradius0.8.1 and oracle with quintum box to build a prepaid voip system.
currently, i have a problem:
 
i can not modify or insert the h323-credit-time in radreply when authorizing. If I can insert the calledsessionid and username into oracle, i think i can write a database trigger to calcute the credit-time and insert it into radreply. but the problem is i don't know how to interact with oracle in authorizaion stage. 
 
I checked this list to find "Exec-Program-Wait" can be used. One of the method is to write a c programm. Is it possible to use sqlplus and sql script file? have anyone tried this way?
 
Thanks in advanced.
 
Alex Zhang

Reply via email to