This file is indexed.

/etc/freeradius/sql/postgresql/voip-postpaid.conf is in freeradius-postgresql 2.1.12+dfsg-1.2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
# -*- text -*-
##
## voip-postpaid.conf -- PostgreSQL configuration for H323 VoIP billingx
##			 (cisco_h323_db_schema.sql)
##
##	$Id$

sql pgsql-voip {

	# Database type currently must be rlm_sql_postgresql to work with this setup.
	driver = "rlm_sql_postgresql"

	# Connect info
	server = "localhost"
	login = "postgres"
	password = ""
	
	# Database configuration
	radius_db = "radius"
		
	# Database table configuration
	acct_table1 = "Start"
	acct_table2 = "Stop"
		
	authcheck_table = "radcheck"
	authreply_table = "radreply"
	
	groupcheck_table = "radgroupcheck"
	groupreply_table = "radgroupreply"
	
	usergroup_table = "radusergroup"
	
	# Remove stale session if checkrad does not see a double login
	deletestalesessions = yes

	# Print all SQL statements when in debug mode (-x)
	sqltrace = no
	sqltracefile = ${logdir}/sqltrace.sql

	# number of sql connections to make to server
	num_sql_socks = 25
	
	# Radius server name so you can tell which radius server handled a request
	# when you have multiple radius servers and one database.
	radius_server_name = FreeRADIUS

	#######################################################################
	#  Query config:  Username
	#######################################################################
	# This is the username that will get substituted, escaped, and added 
	# as attribute 'SQL-User-Name'.  '%{SQL-User-Name}' should be used below 
	# everywhere a username substitution is needed so you you can be sure 
	# the username passed from the client is escaped properly.  
	#
	#  Uncomment the next line, if you want the sql_user_name to mean:
	#
	#    Use Stripped-User-Name, if it's there.
	#    Else use User-Name, if it's there,
	#    Else use hard-coded string "none" as the user name.
	#
	#sql_user_name = "%{Stripped-User-Name:-%{User-Name:-none}}"
	#
	sql_user_name = "%{User-Name}"


	#######################################################################
	#  Accounting Queries
	#######################################################################
	# accounting_onoff_query	- query for Accounting On/Off packets 
	# accounting_update_query	- query for Accounting update packets 
	# accounting_update_query_alt	- query for Accounting update packets 
	#                               (alternate in case first query fails)
	# accounting_start_query	- query for Accounting start packets 
	# accounting_start_query_alt	- query for Accounting start packets 
	#                               (alternate in case first query fails)
	# accounting_stop_query		- query for Accounting stop packets 
	# accounting_stop_query_alt	- query for Accounting start packets 
	#                               (alternate in case first query doesn't
	#                                affect any existing rows in the table)
	#######################################################################

	# Note: The VoIP accouting does not need Alternate queries in the shipped
	# configuration as all queries are INSERTS, hence should always work.
	# If they do not work then you probably have duplicate records in your table.
	

        accounting_start_query = "INSERT into ${acct_table1}%{h323-call-type} \
		(RadiusServerName, UserName, NASIPAddress, AcctTime, CalledStationId, \
		CallingStationId, AcctDelayTime, h323gwid, h323callorigin, h323setuptime, H323ConnectTime, callid) \
		values('${radius_server_name}', '%{SQL-User-Name}', \
		'%{NAS-IP-Address}', now(), '%{Called-Station-Id}', \
		'%{Calling-Station-Id}', '%{Acct-Delay-Time:-0}', '%{h323-gw-id}', \
		'%{h323-call-origin}', strip_dot('%{h323-setup-time}'), strip_dot('%{h323-connect-time}'), pick_id('%{h323-conf-id}', '%{call-id}'))"


	accounting_stop_query = "INSERT into ${acct_table2}%{h323-call-type} \
		(RadiusServerName, UserName, NASIPAddress, AcctTime, \
		AcctSessionTime, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, \
		AcctDelayTime, H323RemoteAddress, H323VoiceQuality, CiscoNASPort, h323callorigin, callid, \
		h323connecttime, h323disconnectcause, h323disconnecttime, h323gwid, h323setuptime) \
		values('${radius_server_name}', '%{SQL-User-Name}', '%{NAS-IP-Address}', now(), '%{Acct-Session-Time:-0}', \
		'%{Acct-Input-Octets:-0}', '%{Acct-Output-Octets:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', \
		'%{Acct-Delay-Time:-0}', NULLIF('%{h323-remote-address}', '')::inet, NULLIF('%{h323-voice-quality}','')::integer, NULLIF('%{Cisco-NAS-Port}', ''), \
		'%{h323-call-origin}', pick_id('%{h323-conf-id}', '%{call-id}'), strip_dot('%{h323-connect-time}'), '%{h323-disconnect-cause}', \
		strip_dot('%{h323-disconnect-time}'), '%{h323-gw-id}', strip_dot('%{h323-setup-time}'))"
 

}