Index: doc/userguide/userguide.xml
===================================================================
RCS file: /home/cvs/gateway/doc/userguide/userguide.xml,v
retrieving revision 1.344
diff -a -u -r1.344 userguide.xml
--- doc/userguide/userguide.xml	14 Jan 2009 11:11:46 -0000	1.344
+++ doc/userguide/userguide.xml	29 Jan 2009 21:45:58 -0000
@@ -1371,15 +1371,17 @@
         crash, but theoretically some messages can duplicate when
         system is taken down violently. 
         This variable defines a type of backend used for store
-        subsystem. Now two types are supported:
+        subsystem. Now three types are supported:
         a) file: writes store into one single file
         b) spool: writes store into spool directory (one file for each message)
+        c) mysql: writes store into a mysql table (one row per message)
      </entry></row>
 
     <row><entry><literal>store-location</literal></entry>
      <entry>filename</entry>
      <entry valign="bottom">
         Depends on <literal>store-type</literal> option used, it is ether file or spool directory.
+        Ignored on if store-type is mysql.
      </entry></row>
 
     <row><entry><literal>store-dump-freq</literal></entry>
@@ -4852,8 +4854,8 @@
 
 	</para>
 
-<sect3>
-<title>MySQL connection configuration</title>
+<sect3 id="mysqlconn">
+<title id="mysqlconn.title">MySQL connection configuration</title>
 
    <para>For several reasons external storage may be required to 
 	handle dynamical issues, i.e. DLRs, sms-service, sendsms-user, 
@@ -5200,7 +5202,100 @@
 
 </sect1>	  
 
+<sect1>
+<title>DB-Based Storage</title>
+	<para>Kannel uses a store subsystem to store messages on hard disk until they are successfully handled. This way,
+	no SMS messages are lost after a crash. The store subsystem can use a file, a spool directory or a database to store
+	messages.</para>
+	
+	<para>The file and spool-based subsystems are easily configured by providing the full path to the file or spool dir.
+	However, when using a DB-Based storage you need to configure a couple of things: a) A connection pool to a supported DB
+	(currently only MySQL) and b) A store configuration to tell kannel where to store the data.</para>
+	
+	<para>In order to use DB-based Storage, you need to specify <literal>store-type = &lt;db-type&gt;</literal>
+	(right, now, only 'mysql')</para>
+	
+	<sect2>
+		<title>DB Connection Configuration</title>
+		<para>We need to use a DB connection pool to a DB (currently only MySQL is supported for the store).</para>
+		<para>A sample 'mysql-connection' configuration:
+<programlisting>
+group = mysql-connection
+id = mypool
+host = localhost
+username = foo
+password = bar
+database = somedb
+max-connections = 1
+</programlisting>
+		</para>
+		<para>See <xref linkend="mysqlconn" endterm="mysqlconn.title"> for further details.</para>
+	</sect2>
+	
+	<sect2>
+		<title>DB Store configuration</title>
+		<para>This section defines the table and column names used to store the messages.</para>
+ <table frame="none">
+  <title>DLR Database Field Configuration Group Variables</title>
+  <tgroup cols="3">
+  <thead>
+   <row>
+     <entry>Variable</entry>
+     <entry>Value</entry>
+     <entry>Description</entry>
+   </row>
+  </thead>
+  <tbody>
+   <row><entry><literal>group</literal></entry>
+     <entry><literal>store-db</literal></entry>
+     <entry valign="bottom">
+       This is a mandatory variable
+     </entry></row>
+
+   <row><entry><literal>id (m)</literal></entry>
+     <entry><literal>string</literal></entry>
+     <entry valign="bottom">
+	     An id to identify which external connection should be used for
+ 		  DB storage. Any string is acceptable, but semicolon ';' may cause
+		  problems, so avoid it and any other special non-alphabet characters.
+     </entry></row>
+
+   <row><entry><literal>table (m)</literal></entry>
+     <entry>string</entry>
+     <entry valign="bottom">
+        The name of the table that is used to store the messages.
+     </entry></row>
 
+   <row><entry><literal>field-uuid (m)</literal></entry>
+     <entry>string</entry>
+     <entry valign="bottom">
+        The table field that is used to store the messages unique identifiers (uuid's). This field
+        should be the table's PRIMARY KEY to improve performance.
+     </entry></row>
+
+   <row><entry><literal>field-message (m)</literal></entry>
+     <entry>string</entry>
+     <entry valign="bottom">
+        The table field that is used to store the messages.
+     </entry></row>
+
+  </tbody>
+  </tgroup>
+ </table>
+		<para>A sample 'store-db' configuration
+<programlisting>
+group = store-db
+id = mypool
+table = store
+field-uuid = uuid
+field-message = message
+</programlisting>
+		</para>
+		<para>Beware that all variables in this group are mandatory, so you
+		have to specify all fields to enable bearerbox to know how to store
+		and retrieve the messages from the DB.</para>
+	</sect2>
+</sect1>
 
 <sect1>
 <title>SMSBox configuration</title>
