⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 postgresql.conf

📁 H.323网守实现
💻 CONF
字号:
#  Configuration for the SQL module, when using Postgresql and GNU Gatekeeper.##  The VoIP database schema is available at:#sql {	driver = "rlm_sql_postgresql"	server = "localhost"	login = "gkradius"	password = "gkradius"		radius_db = "voipdb"			acct_table1 = "voipcall"	acct_table2 = "voipcall"			authcheck_table = "voipradattr"	authreply_table = "voipradattr"		deletestalesessions = yes	sqltrace = yes	sqltracefile = ${logdir}/sqltrace.sql	# increase this value if you want more than 10 simultaneous	# requests to be served by the module	num_sql_socks = 10	sql_user_name = "%{Stripped-User-Name:-%{User-Name:-none}}"	authorize_check_query = "SELECT id, '%{SQL-User-Name}', attrname, attrvalue, attrop FROM \		radius_get_check_attrs('%{SQL-User-Name}', NULLIF('%{Framed-IP-Address}', '')::INET, \			CASE \				WHEN '%{Called-Station-Id}' = '' THEN TRUE \				ELSE FALSE \			END, \			CASE WHEN '%{Service-Type}' = 'Call-Check' THEN TRUE ELSE FALSE END, \			'%{Calling-Station-Id}', NULLIF('%{Called-Station-Id}',''), \			parse_avpair('%{Cisco-AVPair}', 'h323-ivr-out', 'terminal-alias') \			)"	authorize_reply_query = "SELECT id, '%{SQL-User-Name}', attrname, attrvalue, attrop FROM \		radius_get_reply_attrs('%{SQL-User-Name}', NULLIF('%{Framed-IP-Address}', '')::INET, \			CASE \				WHEN '%{Called-Station-Id}' = '' THEN TRUE \				ELSE FALSE \			END, \			CASE WHEN '%{Service-Type}' = 'Call-Check' THEN TRUE ELSE FALSE END, \			'%{Calling-Station-Id}', NULLIF('%{Called-Station-Id}',''), \			parse_avpair('%{Cisco-AVPair}', 'h323-ivr-out', 'terminal-alias') \			)"	#######################################################################	#  Accounting Queries	#######################################################################	# accounting_onoff_query	- query for Accounting On/Off packets 	# accounting_update_query	- query for Accounting update packets 	# 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)	#######################################################################		accounting_start_query = "INSERT INTO ${acct_table1} \		(id, h323id, acctsessionid, h323confid, gkip, gkid, \		 callingstationip, callingstationid, calledstationip, calledstationid, \		 setuptime, \		 acctstarttime, acctstartdelay, acctupdatetime \		 ) \		VALUES \		(DEFAULT, '%{SQL-User-Name}', '%{Acct-Session-Id}', '%{h323-conf-id}', \		 '%{NAS-IP-Address}', '%{NAS-Identifier}', \		 '%{Framed-IP-Address:-127.0.0.1}', '%{Calling-Station-Id}', \		 '%{h323-remote-address:-127.0.0.1}', '%{Called-Station-Id}', \		 NULLIF('%{h323-setup-time}', '')::TIMESTAMP(0) WITH TIME ZONE, \		 (now() - '%{Acct-Delay-Time:-0}'::INTERVAL), '%{Acct-Delay-Time:-0}', \		 (now() - '%{Acct-Delay-Time:-0}'::INTERVAL) \		 )"	accounting_start_query_alt = "SELECT throwex()"		accounting_update_query = "UPDATE ${acct_table1} \		SET duration = '%{Acct-Session-Time:-duration}', \			connecttime = NULLIF('%{h323-connect-time}','')::TIMESTAMP(0) WITH TIME ZONE, \			acctupdatetime = (now() - '%{Acct-Delay-Time:-0}'::INTERVAL) \		WHERE acctsessionid = '%{Acct-Session-Id}' \			AND gkip = '%{NAS-IP-Address}'::INET AND acctstoptime IS NULL"		accounting_stop_query = "UPDATE ${acct_table1} \		SET acctstoptime = (now() - '%{Acct-Delay-Time:-0}'::INTERVAL), \			duration = '%{Acct-Session-Time:-duration}', \			terminatecause = '%{h323-disconnect-cause:-10}', \			acctstopdelay = '%{Acct-Delay-Time:-0}', \			setuptime = NULLIF('%{h323-setup-time}', '')::TIMESTAMP(0) WITH TIME ZONE, \			connecttime = NULLIF('%{h323-connect-time}', '')::TIMESTAMP(0) WITH TIME ZONE, \			disconnecttime = NULLIF('%{h323-disconnect-time}', '')::TIMESTAMP(0) WITH TIME ZONE \		WHERE acctsessionid = '%{Acct-Session-Id}' \			AND gkip = '%{NAS-IP-Address}'::INET AND acctstoptime IS NULL"	accounting_stop_query_alt = "INSERT INTO ${acct_table1} \		(id, h323id, acctsessionid, h323confid, gkip, gkid, \		 callingstationip, callingstationid, calledstationip, calledstationid, \		 setuptime, connecttime, disconnecttime, terminatecause, duration, \		 acctstarttime, acctstartdelay, acctupdatetime, acctstoptime, acctstopdelay \		) \		VALUES \		(DEFAULT,'%{SQL-User-Name}', '%{Acct-Session-Id}', '%{h323-conf-id}', \		 '%{NAS-IP-Address}', '%{NAS-Identifier}', \		 '%{Framed-IP-Address:-127.0.0.1}', '%{Calling-Station-Id}', \		 '%{h323-remote-address:-127.0.0.1}', '%{Called-Station-Id}', \		 NULLIF('%{h323-setup-time}','')::TIMESTAMP(0) WITH TIME ZONE, \		 NULLIF('%{h323-connect-time}','')::TIMESTAMP(0) WITH TIME ZONE, \		 NULLIF('%{h323-disconnect-time}','')::TIMESTAMP(0) WITH TIME ZONE, \		 '%{h323-disconnect-cause:-10}', '%{Acct-Session-Time:-0}', \		 (now() - '%{Acct-Delay-Time:-0}'::INTERVAL - '%{Acct-Session-Time:-0}'::INTERVAL),0, \		 (now() - '%{Acct-Delay-Time:-0}'::INTERVAL), \		 (now() - '%{Acct-Delay-Time:-0}'::INTERVAL), '%{Acct-Delay-Time:-0}' \		)"}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -