Changeset 528:1b3b9790e7cb in freeDiameter
- Timestamp:
- Sep 3, 2010, 4:46:16 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/app_acct.conf.sample
r527 r528 45 45 # 46 46 # Note that at the moment, GROUPED AVP are not supported. Also, only the top-level AVPs are 47 # search . This behavior can be changed quite easily if needed.47 # searched. This behavior can be changed quite easily if needed. 48 48 49 49 # The following list is informative only. … … 108 108 109 109 # This is the database table corresponding to this list: 110 # CREATE TABLE app_acct(110 # CREATE TABLE incoming ( 111 111 # "recorded_on" timestamp with time zone NOT NULL, 112 # "recorded_serv" bytea NOT NULL, 112 113 # "Origin-Host" bytea NOT NULL, 113 114 # "Origin-Realm" bytea NOT NULL, … … 195 196 # Optionaly, you can specify a name of a field that will receive the value 'now' when a new record is inserted. 196 197 # Default: no timestamp is inserted. 197 # Example: Timestamp_field = "inc_ts"; 198 199 200 201 202 198 # Example: Timestamp_field = "recorded_on"; 199 200 # Server_name_field: 201 # Optionaly, you can specify a field which will receive the Diameter Identity of the local server for each record saved. 202 # This is useful especially if you have several Accounting servers and want to check Load-Balancing behavior or so, 203 # after aggregating all the data. 204 # Default: no server name inserted. 205 # Example: Server_name_field = "recorded_serv"; 206 207 208 -
extensions/app_acct/acct_conf.l
r284 r528 114 114 } 115 115 116 (?i:"Server_name_field") { 117 return SRVNFIELD; 118 } 119 116 120 (?i:"field") { 117 121 return FIELD; -
extensions/app_acct/acct_conf.y
r403 r528 102 102 fd_log_debug(" Table name .... : '%s'\n", acct_config->tablename ?: "<null>"); 103 103 fd_log_debug(" Timestamp field : '%s'\n", acct_config->tsfield ?: "<null>"); 104 fd_log_debug(" Server name fld : '%s'\n", acct_config->srvnfield ?: "<null>"); 104 105 fd_log_debug(" AVPs that will be saved to the database:\n"); 105 106 for (li = acct_config->avps.next; li != &acct_config->avps; li = li->next) { … … 137 138 free(acct_config->tablename); 138 139 free(acct_config->tsfield); 140 free(acct_config->srvnfield); 139 141 140 142 /* Done */ … … 205 207 %token TABLE 206 208 %token TSFIELD 209 %token SRVNFIELD 207 210 208 211 /* Tokens and types */ … … 224 227 | conffile tableline 225 228 | conffile tsfieldline 229 | conffile srvnfieldline 226 230 | conffile errors 227 231 { … … 321 325 } 322 326 ; 327 328 srvnfieldline: SRVNFIELD '=' QSTRING ';' 329 { 330 if (acct_config->srvnfield) { 331 yyerror (&yylloc, conffile, "Duplicate entry"); 332 YYERROR; 333 } 334 acct_config->srvnfield = $3 335 } 336 ; -
extensions/app_acct/acct_db.c
r403 r528 142 142 } 143 143 144 if (acct_config->srvnfield) { 145 ADD_EXTEND("\""); 146 ADD_ESCAPE(acct_config->srvnfield); 147 ADD_EXTEND("\", "); 148 } 149 144 150 for (li = emptyrecords.all.next; li != &emptyrecords.all; li = li->next) { 145 151 struct acct_record_item * i = (struct acct_record_item *)(li->o); … … 158 164 if (acct_config->tsfield) { 159 165 ADD_EXTEND("$%d, ", ++idx); 166 } 167 if (acct_config->srvnfield) { 168 ADD_EXTEND("\""); 169 ADD_ESCAPE(fd_g_config->cnf_diamid); 170 ADD_EXTEND("\", "); 160 171 } 161 172 -
extensions/app_acct/app_acct.h
r285 r528 75 75 char *tablename; /* the name of the table we are working with */ 76 76 char *tsfield; /* the name of the timestamp field, or NULL if not required */ 77 char *srvnfield; /* the name of the server name field, or NULL if not required */ 77 78 }; 78 79
Note: See TracChangeset
for help on using the changeset viewer.