DB-Based Store for Kannel

This is a new version from my previous patch to add support for a DB based store.

Fundamental differences with the previous version:

1. The DB table is now created automatically at startup (if it didn’t exist).

2. Cleaned up code aiming at supporting other DB engines apart from MySQL.

3. Added documentation.

Please download the patches here:

kannel-store-db

kannel-store-db-docs

Again, this is far from stable. It needs further testing and confirmation before rolling up into production.

Regards,

Alex

Comments (6)

Alex PatersonApril 26th, 2010 at 5:23 AM

Hi Alex,

I have compiled and installed the code with no errors. The SMS record seems to insert into the “store” table but is then automatically deleted straight afterwards. Any ideas? In the debug I can see the following:

2010-04-26 10:12:59 [21939] [13] DEBUG: sql: INSERT INTO store (uuid, message) VALUES (‘a6e20ca1-2eed-49a7-981d-6d5d71d6863d’, ‘AAAAAgAAAAUxMzAxMwAAAAw1ODgwMjQxMTMwMTP/////AAAAFE5vIHNlcnZpY2Ugc3BlY2lmaWVk
2010-04-26 10:12:59 [21939] [6] DEBUG: sql: DELETE FROM store WHERE uuid = ‘a6e20ca1-2eed-49a7-981d-6d5d71d6863d’

BRgds
Alex P

alexApril 26th, 2010 at 9:28 AM

Yes, that’s to be expected: The store’s purpose is to provide persistence in case of a server crash, so messages can be recovered after restarting the service. Messages are held on the store while they’re being processed and deleted afterwards, otherwise they’d be all resent after every service restart.

Regards,

Alex

waelAugust 24th, 2010 at 5:16 AM

Hi Alex,
I have kannel 1.4.3 Installed on CentOS 5.5 and work well but when want to install your patch kannel-store-db.patch with command “patch -p0 kannel-store-db.patch” no thing do
shell not do any thing what is error????

macfallen siameSeptember 28th, 2010 at 5:26 AM

Alex what should i do to deposit messages sent by mobile users straight into mysql database.I have successfully compiled and started kannel with mysql support

alexNovember 18th, 2010 at 7:03 AM

You can do that by writing a small web application that receives the requests from smsbox and write it to the database, or you could use SqlBox, without having the extra http layer.

anilMarch 27th, 2011 at 6:49 AM

Dear Alex,
When i run make command i get the following error.
Please suggest. I am using kannel 1.4.3 on ubuntu.

libgw.a(bb_store.o): In function `store_init’:
/root/Desktop/all/gateway-1.4.3/gw/bb_store.c:95: undefined reference to `store_mysql_init’
collect2: ld returned 1 exit status
make: *** [gw/bearerbox] Error 1