4 * SQL accounting module for GNU Gatekeeper
6 * Copyright (c) 2004, Michal Zygmuntowicz
8 * This work is published under the GNU Public License (GPL)
9 * see file COPYING for details.
10 * We also explicitely grant the right to link this code
11 * with the OpenH323 library.
14 * Revision 1.7 2006/04/14 13:56:19 willamowius
15 * call failover code merged
17 * Revision 1.1.1.1 2005/11/21 20:19:58 willamowius
20 * Revision 1.4 2005/11/15 19:52:56 jan
21 * Michal v1 (works, but on in routed, not proxy mode)
23 * Revision 1.6 2005/03/08 14:31:13 zvision
24 * Support for Connect event added
26 * Revision 1.5 2005/01/12 17:55:07 willamowius
27 * fix gkip accounting parameter
29 * Revision 1.4 2005/01/05 15:42:41 willamowius
30 * new accounting event 'connect', parameter substitution unified in parent class
32 * Revision 1.3 2004/11/10 18:30:41 zvision
33 * Ability to customize timestamp strings
35 * Revision 1.2 2004/07/09 22:11:36 zvision
36 * SQLAcct module ported from 2.0 branch
38 * Revision 1.1.2.1 2004/04/23 16:01:16 zvision
39 * New direct SQL accounting module (SQLAcct)
43 #define SQLACCT_H "@(#) $Id: sqlacct.h,v 1.7 2006/04/14 13:56:19 willamowius Exp $"
47 /** This accounting module stores call information directly to an SQL database.
48 It uses generic SQL interface, so different SQL backends are supported.
49 Queries to store accounting information are parametrized using named
52 class GkSQLConnection;
53 class SQLAcct : public GkAcctLogger
57 /// events recognized by this module
58 SQLAcctEvents = AcctStart | AcctUpdate | AcctStop | AcctConnect
61 /// Create a logger that sends accounting to an SQL database
63 /// name from Gatekeeper::Acct section
64 const char* moduleName,
65 /// name for a config section with logger settings
66 /// pass NULL to use the moduleName as the section name
67 const char* cfgSecName = NULL
70 /// Destroy the accounting logger
73 /** Log accounting event.
76 Status of this logging operation (see #Status enum#)
79 AcctEvent evt, /// accounting event to log
80 const callptr& call /// additional data for the event
84 /* No copy constructor allowed */
85 SQLAcct(const SQLAcct&);
86 /* No operator= allowed */
87 SQLAcct& operator=(const SQLAcct&);
90 /// connection to the SQL database
91 GkSQLConnection* m_sqlConn;
92 /// parametrized query string for the call start event
94 /// parametrized alternative query string for the call start event
95 PString m_startQueryAlt;
96 /// parametrized query string for the call update event
97 PString m_updateQuery;
98 /// parametrized query string for the call stop event
100 /// parametrized alternative query string for the call stop event
101 PString m_stopQueryAlt;
102 /// timestamp formatting string
103 PString m_timestampFormat;
106 #endif /* SQLACCT_H */