~ubuntu-branches/ubuntu/dapper/freeradius/dapper-updates

« back to all changes in this revision

Viewing changes to raddb/pgsql-voip.conf

  • Committer: Bazaar Package Importer
  • Author(s): Paul Hampson
  • Date: 2004-12-29 20:19:42 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041229201942-uj2e95la965uthc7
Tags: 1.0.1-2
* freeradius-dialupadmin Suggests php4-mysql | php4-pgsql
   Closes: #279419
* Added a two-second pause to restart in init.d script
   Closes: #262635
* FreeRADIUS module packages now depend on the same source
  version of the main FreeRADIUS package.
   Closes: #284353
* FreeRADIUS-dialupadmin's default paths in admin.conf are
  now correct.
   Closes: #280942
* FreeRADIUS-dialupadmin's help.php3 can now find README.
   Closes: #280941
* Fixes stolen from 1.0.2 CVS:
  - Bug fix to make udpfromto code work
  - radrelay shouldn't dump core if it can't read a VP from the
    detail file.
  - Only initialize the random pool once.
  - In rlm_sql, don't escape characters twice.
  - In rlm_ldap, only claim Auth-Type if a plain text password is present.
  - Locking fixes in threading code
  - Fix building on gcc-4.0 by not trying to access static auth_port from
    other files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#  Id: postgresql.conf,v 1.8.2.11 2003/07/15 11:15:43 pnixon Exp $
 
2
#
 
3
#  Configuration for the SQL module, when doing H323 VoIP billing.
 
4
#
 
5
#  The database schema is available at:
 
6
#
 
7
#   src/radiusd/src/billing/h323_db_postgresql.sql
 
8
#
 
9
sql pgsql-voip {
 
10
 
 
11
        # Database type currently must be rlm_sql_postgresql to work with this setup.
 
12
        driver = "rlm_sql_postgresql"
 
13
 
 
14
        # Connect info
 
15
        server = "localhost"
 
16
        login = "postgres"
 
17
        password = ""
 
18
        
 
19
        # Database configuration
 
20
        radius_db = "radius"
 
21
                
 
22
        # Database table configuration
 
23
        acct_table1 = "Start"
 
24
        acct_table2 = "Stop"
 
25
                
 
26
        authcheck_table = "radcheck"
 
27
        authreply_table = "radreply"
 
28
        
 
29
        groupcheck_table = "radgroupcheck"
 
30
        groupreply_table = "radgroupreply"
 
31
        
 
32
        usergroup_table = "usergroup"
 
33
        
 
34
        # Remove stale session if checkrad does not see a double login
 
35
        deletestalesessions = yes
 
36
 
 
37
        # Print all SQL statements when in debug mode (-x)
 
38
        sqltrace = no
 
39
        sqltracefile = ${logdir}/sqltrace.sql
 
40
 
 
41
        # number of sql connections to make to server
 
42
        num_sql_socks = 25
 
43
        
 
44
        # Radius server name so you can tell which radius server handled a request
 
45
        # when you have multiple radius servers and one database.
 
46
        radius_server_name = myservername
 
47
 
 
48
        #######################################################################
 
49
        #  Query config:  Username
 
50
        #######################################################################
 
51
        # This is the username that will get substituted, escaped, and added 
 
52
        # as attribute 'SQL-User-Name'.  '%{SQL-User-Name}' should be used below 
 
53
        # everywhere a username substitution is needed so you you can be sure 
 
54
        # the username passed from the client is escaped properly.  
 
55
        #
 
56
        #  Uncomment the next line, if you want the sql_user_name to mean:
 
57
        #
 
58
        #    Use Stripped-User-Name, if it's there.
 
59
        #    Else use User-Name, if it's there,
 
60
        #    Else use hard-coded string "none" as the user name.
 
61
        #
 
62
        #sql_user_name = "%{Stripped-User-Name:-%{User-Name:-none}}"
 
63
        #
 
64
        sql_user_name = "%{User-Name}"
 
65
 
 
66
 
 
67
        #######################################################################
 
68
        #  Accounting Queries
 
69
        #######################################################################
 
70
        # accounting_onoff_query        - query for Accounting On/Off packets 
 
71
        # accounting_update_query       - query for Accounting update packets 
 
72
        # accounting_update_query_alt   - query for Accounting update packets 
 
73
        #                               (alternate in case first query fails)
 
74
        # accounting_start_query        - query for Accounting start packets 
 
75
        # accounting_start_query_alt    - query for Accounting start packets 
 
76
        #                               (alternate in case first query fails)
 
77
        # accounting_stop_query         - query for Accounting stop packets 
 
78
        # accounting_stop_query_alt     - query for Accounting start packets 
 
79
        #                               (alternate in case first query doesn't
 
80
        #                                affect any existing rows in the table)
 
81
        #######################################################################
 
82
 
 
83
        # Note: The VoIP accouting does not need Alternate queries in the shipped
 
84
        # configuration as all queries are INSERTS, hence should always work.
 
85
        # If they do not work then you probably have duplicate records in your table.
 
86
        
 
87
 
 
88
        accounting_start_query = "INSERT into ${acct_table1}%{h323-call-type} \
 
89
                (RadiusServerName, UserName, NASIPAddress, AcctTime, CalledStationId, \
 
90
                CallingStationId, AcctDelayTime, h323gwid, h323callorigin, h323setuptime, H323ConnectTime, callid) \
 
91
                values('${radius_server_name}', '%{SQL-User-Name}', \
 
92
                '%{NAS-IP-Address}', now(), '%{Called-Station-Id}', \
 
93
                '%{Calling-Station-Id}', '%{Acct-Delay-Time:-0}', '%{h323-gw-id}', \
 
94
                '%{h323-call-origin}', strip_dot('%{h323-setup-time}'), strip_dot('%{h323-connect-time}'), pick_id('%{h323-conf-id}', '%{call-id}'))"
 
95
 
 
96
 
 
97
        accounting_stop_query = "INSERT into ${acct_table2}%{h323-call-type} \
 
98
                (RadiusServerName, UserName, NASIPAddress, AcctTime, \
 
99
                AcctSessionTime, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, \
 
100
                AcctDelayTime, H323RemoteAddress, CiscoNASPort, h323callorigin, callid, \
 
101
                h323connecttime, h323disconnectcause, h323disconnecttime, h323gwid, h323setuptime) \
 
102
                values('${radius_server_name}', '%{SQL-User-Name}', '%{NAS-IP-Address}', now(), '%{Acct-Session-Time:-0}', \
 
103
                '%{Acct-Input-Octets:-0}', '%{Acct-Output-Octets:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', \
 
104
                '%{Acct-Delay-Time:-0}', NULLIF('%{h323-remote-address}', '')::inet, NULLIF('%{Cisco-NAS-Port}', ''), \
 
105
                '%{h323-call-origin}', pick_id('%{h323-conf-id}', '%{call-id}'), strip_dot('%{h323-connect-time}'), '%{h323-disconnect-cause}', \
 
106
                strip_dot('%{h323-disconnect-time}'), '%{h323-gw-id}', strip_dot('%{h323-setup-time}'))"
 
107
 
 
108
 
 
109
}