Index: gw/bb_store.c =================================================================== RCS file: /home/cvs/gateway/gw/bb_store.c,v retrieving revision 1.47 diff -a -u -r1.47 bb_store.c --- gw/bb_store.c 12 Jan 2009 16:46:57 -0000 1.47 +++ gw/bb_store.c 29 Jan 2009 21:45:58 -0000 @@ -79,7 +79,7 @@ int store_init(const Octstr *type, const Octstr *fname, long dump_freq, - void *pack_func, void *unpack_func) + void *pack_func, void *unpack_func, Cfg *cfg) { int ret; @@ -90,6 +90,10 @@ ret = store_file_init(fname, dump_freq); } else if (octstr_str_compare(type, "spool") == 0) { ret = store_spool_init(fname); +#ifdef HAVE_MYSQL + } else if (octstr_str_compare(type, "mysql") == 0) { + ret = store_mysql_init(cfg); +#endif } else { error(0, "Unknown 'store-type' defined."); ret = -1; Index: gw/bb_store.h =================================================================== RCS file: /home/cvs/gateway/gw/bb_store.h,v retrieving revision 1.4 diff -a -u -r1.4 bb_store.h --- gw/bb_store.h 12 Jan 2009 16:46:55 -0000 1.4 +++ gw/bb_store.h 29 Jan 2009 21:45:58 -0000 @@ -99,7 +99,7 @@ /* initialize system. Return -1 if fname is bad (too long). */ int store_init(const Octstr *type, const Octstr *fname, long dump_freq, - void *pack_func, void *unpack_func); + void *pack_func, void *unpack_func, Cfg *cfg); /* init shutdown (system dies when all acks have been processed) */ extern void (*store_shutdown)(void); @@ -112,7 +112,9 @@ */ int store_spool_init(const Octstr *fname); int store_file_init(const Octstr *fname, long dump_freq); - +#ifdef HAVE_MYSQL +int store_mysql_init(Cfg *cfg); +#endif #endif /*BB_STORE_H_*/ Index: gw/bearerbox.c =================================================================== RCS file: /home/cvs/gateway/gw/bearerbox.c,v retrieving revision 1.169 diff -a -u -r1.169 bearerbox.c --- gw/bearerbox.c 12 Jan 2009 16:46:56 -0000 1.169 +++ gw/bearerbox.c 29 Jan 2009 21:45:59 -0000 @@ -415,7 +415,7 @@ log = cfg_get(grp, octstr_imm("store-location")); val = cfg_get(grp, octstr_imm("store-type")); } - if (store_init(val, log, store_dump_freq, msg_pack, msg_unpack_wrapper) == -1) + if (store_init(val, log, store_dump_freq, msg_pack, msg_unpack_wrapper, cfg) == -1) panic(0, "Could not start with store init failed."); octstr_destroy(val); octstr_destroy(log); Index: gwlib/cfg.def =================================================================== RCS file: /home/cvs/gateway/gwlib/cfg.def,v retrieving revision 1.137 diff -a -u -r1.137 cfg.def --- gwlib/cfg.def 14 Jan 2009 11:11:47 -0000 1.137 +++ gwlib/cfg.def 29 Jan 2009 21:45:59 -0000 @@ -577,6 +577,13 @@ OCTSTR(field-boxc-id) ) +SINGLE_GROUP(store-db, + OCTSTR(id) + OCTSTR(table) + OCTSTR(field-uuid) + OCTSTR(field-message) +) + SINGLE_GROUP(radius-acct, OCTSTR(our-host) Index: test/test_store_dump.c =================================================================== RCS file: /home/cvs/gateway/test/test_store_dump.c,v retrieving revision 1.6 diff -a -u -r1.6 test_store_dump.c --- test/test_store_dump.c 12 Jan 2009 16:46:51 -0000 1.6 +++ test/test_store_dump.c 29 Jan 2009 21:45:59 -0000 @@ -95,7 +95,7 @@ type = octstr_create("file"); /* init store subsystem */ - store_init(type, octstr_imm(argv[cf_index]), -1, msg_pack, msg_unpack_wrapper); + store_init(type, octstr_imm(argv[cf_index]), -1, msg_pack, msg_unpack_wrapper, NULL); /* pass every entry in the store to callback print_msg() */ store_load(print_msg);