Hello,
I wonder if it is possible to use a default value for an accounting field. I
would require this to keep track of the Calling-Station-Id value, which does
not always get transmitted to us by the telco. Specifically, the telco does
not transmit it, when a customer uses the ISDN hide-callerid feature on his
phone line.
The times it does not get transmitted, the AuthBy SQL generates an error
because of the missing field.
I have set the column to be of type varchar(20) in the accounting SQL table.
The default value could be '' (empty field) but it must be present, else the
SQL insert fails.
Is there a possibility to set a default value to the field if it is not
there ??
Thanks for any ideas, hacks, etc...
Here is an output from the trace 4 log and the relevant part of the
configuration file :
<Handler NAS-IP-Address=/xxxxxxxxx/>
AuthByPolicy ContinueWhileReject
<AuthBy SQL>
DBSource dbi:Pg:dbname=xxxxx;host=xxxxxx
DBUsername xxxxxx
DBAuth xxxxxx
AccountingStopsOnly
AuthSelect
AccountingTable ACCOUNTING
AcctColumnDef USERNAME,User-Name
AcctColumnDef TIME_STAMP,Timestamp,integer
AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type
AcctColumnDef ACCTDELAYTIME,Acct-Delay-Time,integer
AcctColumnDef ACCTINPUTOCTETS,Acct-Input-Octets,integer
AcctColumnDef ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
AcctColumnDef ACCTSESSIONID,Acct-Session-Id
AcctColumnDef ACCTSESSIONTIME,Acct-Session-Time,integer
AcctColumnDef
ACCTTERMINATECAUSE,Acct-Terminate-Cause,integer
AcctColumnDef NASIDENTIFIER,NAS-Identifier
AcctColumnDef NASPORT,NAS-Port,integer
AcctColumnDef FRAMEDIPADDRESS,Framed-IP-Address
AcctColumnDef CALLERID,Calling-Station-Id
AcctFailedLogFilename /var/adm/radacct/%c/misseddetails
</AuthBy>
<AuthBy DBFILE>
Filename /etc/raddb/users
</AuthBy>
</Handler>
Wed Mar 28 17:15:36 2001: DEBUG: Check if Handler
NAS-IP-Address=/144.85.80.[1-3][1-3]/ should be used to handle this request
Wed Mar 28 17:15:36 2001: DEBUG: Handling request with Handler
'NAS-IP-Address=/144.85.80.[1-3][1-3]/'
Wed Mar 28 17:15:36 2001: DEBUG: Adding session for gve0272, 144.85.80.11,
259
Wed Mar 28 17:15:36 2001: DEBUG: Handling with Radius::AuthSQL
Wed Mar 28 17:15:36 2001: DEBUG: Handling accounting with Radius::AuthSQL
Wed Mar 28 17:15:36 2001: DEBUG: Accounting accepted
Wed Mar 28 17:15:37 2001: DEBUG: Check if Handler
NAS-IP-Address=/144.85.80.[1-3][1-3]/ should be used to handle this request
Wed Mar 28 17:15:37 2001: DEBUG: Handling request with Handler
'NAS-IP-Address=/144.85.80.[1-3][1-3]/'
Wed Mar 28 17:15:37 2001: DEBUG: Deleting session for gve1908,
144.85.80.11, 2321
Wed Mar 28 17:15:37 2001: DEBUG: Handling with Radius::AuthSQL
Wed Mar 28 17:15:37 2001: DEBUG: Handling accounting with Radius::AuthSQL
Wed Mar 28 17:15:37 2001: DEBUG: do query is: insert into SPAN
(USERNAME, TIME_STAMP, ACCTSTATUSTYPE, ACCTDELAYTIME,
ACCTINPUTOCTETS, ACCTOUTPUTOCTETS, ACCTSESSIONID, ACCTSESSIONTIME,
ACCTTERMINATECAUSE, NASPORT, FRAMEDIPADDRESS, CALLERID)
values
('gve1908', 985792537, 'Stop', 0, 3230, 20284, '152045108',
40, 1, 2321, '195.15.81.20', )
Wed Mar 28 17:15:37 2001: ERR: do failed for 'insert into SPAN
(USERNAME, TIME_STAMP, ACCTSTATUSTYPE, ACCTDELAYTIME,
ACCTINPUTOCTETS, ACCTOUTPUTOCTETS, ACCTSESSIONID, ACCTSESSIONTIME,
ACCTTERMINATECAUSE, NASPORT, FRAMEDIPADDRESS, CALLERID)
values
('gve1908', 985792537, 'Stop', 0, 3230, 20284, '152045108',
40, 1, 2321, '195.15.81.20', )': ERROR: parser:
parse error at or near ")"
Robert von Bismarck
Head of UNIX Application Management
Cable & Wireless
Operations
25, Rue des Caroubiers
1227 Carouge
Tel : +41 (0)22 304 47 47
Fax : +41 (0)22 304 47 99
E-mail : [EMAIL PROTECTED]
Web : http://www.cw.com/ch
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.