Kannel: Open Source WAP and SMS gateway  svn-r5335
sqlbox_sqlite.h
Go to the documentation of this file.
1 #include "gwlib/gwlib.h"
2 
3 #if defined(HAVE_SQLITE) || defined(HAVE_SDB)
4 
5 #define SQLBOX_SQLITE_CREATE_LOG_TABLE "CREATE TABLE %S ( \
6 sql_id INTEGER AUTOINCREMENT PRIMARY KEY, momt CHAR(3) NULL, sender VARCHAR(20) NULL, \
7 receiver VARCHAR(20) NULL, udhdata BLOB NULL, msgdata TEXT NULL, time BIGINT(20) NULL, \
8 smsc_id VARCHAR(255) NULL, service VARCHAR(255) NULL, account VARCHAR(255) NULL, \
9 id BIGINT(20) NULL, sms_type BIGINT(20) NULL, mclass BIGINT(20) NULL, mwi BIGINT(20) NULL, \
10 coding BIGINT(20) NULL, compress BIGINT(20) NULL, validity BIGINT(20) NULL, \
11 deferred BIGINT(20) NULL, dlr_mask BIGINT(20) NULL, dlr_url VARCHAR(255) NULL, \
12 pid BIGINT(20) NULL, alt_dcs BIGINT(20) NULL, rpi BIGINT(20) NULL, charset VARCHAR(255) NULL, \
13 boxc_id VARCHAR(255) NULL, binfo VARCHAR(255) NULL, meta_data TEXT NULL, foreign_id VARCHAR(255) NULL)"
14 
15 #define SQLBOX_SQLITE_CREATE_INSERT_TABLE "CREATE TABLE %S ( \
16 sql_id INTEGER AUTOINCREMENT PRIMARY KEY, momt CHAR(3) NULL, sender VARCHAR(20) NULL, \
17 receiver VARCHAR(20) NULL, udhdata BLOB NULL, msgdata TEXT NULL, time BIGINT(20) NULL, \
18 smsc_id VARCHAR(255) NULL, service VARCHAR(255) NULL, account VARCHAR(255) NULL, \
19 id BIGINT(20) NULL, sms_type BIGINT(20) NULL, mclass BIGINT(20) NULL, mwi BIGINT(20) NULL, \
20 coding BIGINT(20) NULL, compress BIGINT(20) NULL, validity BIGINT(20) NULL, \
21 deferred BIGINT(20) NULL, dlr_mask BIGINT(20) NULL, dlr_url VARCHAR(255) NULL, \
22 pid BIGINT(20) NULL, alt_dcs BIGINT(20) NULL, rpi BIGINT(20) NULL, charset VARCHAR(255) NULL, \
23 boxc_id VARCHAR(255) NULL, binfo VARCHAR(255) NULL, meta_data TEXT NULL, foreign_id VARCHAR(255) NULL)"
24 
25 #define SQLBOX_SQLITE_SELECT_QUERY "SELECT sql_id, momt, sender, receiver, udhdata, msgdata, \
26 time, smsc_id, service, account, id, sms_type, mclass, mwi, coding, compress, validity, \
27 deferred, dlr_mask, dlr_url, pid, alt_dcs, rpi, charset, boxc_id, binfo, meta_data FROM %S LIMIT 0,1"
28 
29 #define SQLBOX_SQLITE_INSERT_QUERY "INSERT INTO %S (sql_id, momt, sender, receiver, udhdata, msgdata, \
30 time, smsc_id, service, account, sms_type, mclass, mwi, coding, compress, validity, deferred, dlr_mask, \
31 dlr_url, pid, alt_dcs, rpi, charset, boxc_id, binfo, meta_data, foreign_id) VALUES (NULL, %S, %S, %S, %S, %S, %S, \
32 %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S, %S)"
33 
34 #define SQLBOX_SQLITE_DELETE_QUERY "DELETE FROM %S WHERE sql_id = %S"
35 
36 #endif /* HAVE_SQLITE || HAVE_SDB */
37 
38 #ifdef HAVE_SQLITE
39 #include "gw/msg.h"
40 #include "sqlbox_sql.h"
41 void sql_save_msg(Msg *msg, Octstr *momt );
42 Msg *sqlite_fetch_msg();
43 void sql_shutdown();
44 struct server_type *sqlbox_init_sqlite(Cfg *cfg);
45 extern Octstr *sqlbox_id;
46 #endif
static Cfg * cfg
Definition: opensmppbox.c:95
Definition: msg.h:79
Definition: cfg.c:164
Definition: octstr.c:118
Octstr * sqlbox_id
Definition: sqlbox.c:95
static XMLRPCDocument * msg
Definition: test_xmlrpc.c:86
void(* sql_save_msg)(Msg *, Octstr *)
Definition: sqlbox_sql.h:18
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.