Bladeren bron

db_text change "openser" and minor edits

Olle E. Johansson 12 jaren geleden
bovenliggende
commit
a0c0b57d0b
2 gewijzigde bestanden met toevoegingen van 76 en 66 verwijderingen
  1. 47 44
      modules/db_text/README
  2. 29 22
      modules/db_text/doc/db_text_admin.xml

+ 47 - 44
modules/db_text/README

@@ -16,7 +16,7 @@ Daniel-Constantin Mierla
 
 
    <[email protected]>
    <[email protected]>
 
 
-   Copyright © 2003, 2004 FhG FOKUS
+   Copyright © 2003, 2004 FhG FOKUS
      __________________________________________________________________
      __________________________________________________________________
 
 
    Table of Contents
    Table of Contents
@@ -44,7 +44,7 @@ Daniel-Constantin Mierla
 
 
         5. Installation and Running
         5. Installation and Running
 
 
-              5.1. Using dbtext with basic Kamailio configuration
+              5.1. Using db_text with a basic Kamailio configuration
 
 
    2. Developer Guide
    2. Developer Guide
 
 
@@ -85,7 +85,7 @@ Chapter 1. Admin Guide
 
 
    5. Installation and Running
    5. Installation and Running
 
 
-        5.1. Using dbtext with basic Kamailio configuration
+        5.1. Using db_text with a basic Kamailio configuration
 
 
 1. Overview
 1. Overview
 
 
@@ -99,41 +99,43 @@ Chapter 1. Admin Guide
 
 
    The module is meant for use in demos or small devices that do not
    The module is meant for use in demos or small devices that do not
    support other DB modules. It keeps everything in memory and if you deal
    support other DB modules. It keeps everything in memory and if you deal
-   with large amount of data you may run quickly out of memory. Also, it
-   has not implemented all standard database facilities (like order by),
-   it includes minimal functionality to work properly (who knows ?!?) with
+   with large amount of data you may run out of memory quickly. Also, it
+   does not implement all standard database facilities (like order by), it
+   includes minimal functionality to work properly (who knows ?!?) with
    Kamailio.
    Kamailio.
 
 
    NOTE: the timestamp is printed in an integer value from time_t
    NOTE: the timestamp is printed in an integer value from time_t
    structure. If you use it in a system that cannot do this conversion, it
    structure. If you use it in a system that cannot do this conversion, it
    will fail (support for such situation is in to-do list).
    will fail (support for such situation is in to-do list).
 
 
-   NOTE: even when is in non-caching mode, the module does not write back
-   to hard drive after changes. In this mode, the module checks if the
-   corresponding file on disk has changed, and reloads it. The write on
-   disk happens at openser shut down.
+   NOTE: even when db_text is in non-caching mode, the module does not
+   write back to hard drive after changes. In this mode, the module checks
+   if the corresponding file on disk has changed, and reloads it. The
+   write to disk happens at Kamailio shut down.
 
 
 1.1. Design of dbtext engine
 1.1. Design of dbtext engine
 
 
    The dbtext database system architecture:
    The dbtext database system architecture:
-     * a database is represented by a directory in the local file system.
+     * A database is represented by a directory in the local file system.
        NOTE: when you use dbtext in Kamailio, the database URL for modules
        NOTE: when you use dbtext in Kamailio, the database URL for modules
        must be the path to the directory where the table-files are
        must be the path to the directory where the table-files are
-       located, prefixed by “text://�, e.g., “text:///var/dbtext/ser�. If
-       there is no “/� after “text://� then “CFG_DIR/� is inserted at the
+       located, prefixed by "text://", e.g., "text:///var/dbtext/ser". If
+       there is no "/" after "text://" then "CFG_DIR/" is inserted at the
        beginning of the database path. So, either you provide an absolute
        beginning of the database path. So, either you provide an absolute
-       path to database directory or a relative one to “CFG_DIR�
+       path to database directory or a relative one to "CFG_DIR"
        directory.
        directory.
-     * a table is represented by a text file inside database directory.
+       Do not forget that all databases in Kamailio needs the "version"
+       table.
+     * A table is represented by a text file inside database directory.
 
 
 1.2. Internal format of a dbtext table
 1.2. Internal format of a dbtext table
 
 
-   First line is the definition of the columns. Each column must be
-   declared as follows:
+   The first line is the definition of the columns. Each column must be
+   declared in the following format:
      * the name of column must not include white spaces.
      * the name of column must not include white spaces.
      * the format of a column definition is: name(type,attr).
      * the format of a column definition is: name(type,attr).
      * between two column definitions must be a white space, e.g.,
      * between two column definitions must be a white space, e.g.,
-       “first_name(str) last_name(str)�.
+       "first_name(str) last_name(str)".
      * the type of a column can be:
      * the type of a column can be:
           + int - integer numbers.
           + int - integer numbers.
           + double - real numbers with two decimals.
           + double - real numbers with two decimals.
@@ -145,11 +147,11 @@ Chapter 1. Admin Guide
           + null - accept null values in column fields.
           + null - accept null values in column fields.
           + if no attribute is set, the fields of the column cannot have
           + if no attribute is set, the fields of the column cannot have
             null value.
             null value.
-     * each other line is a row with data. The line ends with “\n�.
-     * the fields are separated by “:�.
+     * each other line is a row with data. The line ends with "\n".
+     * the fields are separated by ":".
      * no value between two ':' (or between ':' and start/end of a row)
      * no value between two ':' (or between ':' and start/end of a row)
-       means “null� value.
-     * next characters must be escaped in strings: “\n�, “\r�, “\t�, “:�.
+       means "null" value.
+     * next characters must be escaped in strings: "\n", "\r", "\t", ":".
      * 0 -- the zero value must be escaped too.
      * 0 -- the zero value must be escaped too.
 
 
    Example 1.1. Sample of a dbtext table
    Example 1.1. Sample of a dbtext table
@@ -173,7 +175,7 @@ suser:supasswd:xxx:alpha.org:xxx
 
 
 1.3. Existing limitations
 1.3. Existing limitations
 
 
-   This database interface don't support the data insertion with default
+   This database interface does not support data insertion with default
    values. All such values specified in the database template are ignored.
    values. All such values specified in the database template are ignored.
    So its advisable to specify all data for a column at insertion
    So its advisable to specify all data for a column at insertion
    operations.
    operations.
@@ -185,12 +187,12 @@ suser:supasswd:xxx:alpha.org:xxx
 
 
 2.1. Kamailio modules
 2.1. Kamailio modules
 
 
-   The next modules must be loaded before this module:
+   These modules must be loaded before this module:
      * none.
      * none.
 
 
 2.2. External libraries or applications
 2.2. External libraries or applications
 
 
-   The next libraries or applications must be installed before running
+   These libraries or applications must be installed before running
    Kamailio with this module:
    Kamailio with this module:
      * none.
      * none.
 
 
@@ -205,9 +207,9 @@ suser:supasswd:xxx:alpha.org:xxx
    Set caching mode (0) or non-caching mode (1). In caching mode, data is
    Set caching mode (0) or non-caching mode (1). In caching mode, data is
    loaded at startup. In non-caching mode, the module check every time a
    loaded at startup. In non-caching mode, the module check every time a
    table is requested whether the corresponding file on disk has changed,
    table is requested whether the corresponding file on disk has changed,
-   and if yes, will re-load table from file.
+   and if yes, will re-load the table from file.
 
 
-   Default value is “0�.
+   Default value is "0".
 
 
    Example 1.4. Set db_mode parameter
    Example 1.4. Set db_mode parameter
 ...
 ...
@@ -220,7 +222,7 @@ modparam("db_text", "db_mode", 1)
 
 
 4.1.  db_text.dump
 4.1.  db_text.dump
 
 
-   Write back to hard drive modified tables.
+   Write back to hard drive all modified tables.
 
 
    Name: db_text.dump
    Name: db_text.dump
 
 
@@ -231,16 +233,16 @@ modparam("db_text", "db_mode", 1)
 
 
 5. Installation and Running
 5. Installation and Running
 
 
-   5.1. Using dbtext with basic Kamailio configuration
+   5.1. Using db_text with a basic Kamailio configuration
 
 
    Compile the module and load it instead of mysql or other DB modules.
    Compile the module and load it instead of mysql or other DB modules.
 
 
    REMINDER: when you use text in Kamailio, the database URL for modules
    REMINDER: when you use text in Kamailio, the database URL for modules
    must be the path to the directory where the table-files are located,
    must be the path to the directory where the table-files are located,
-   prefixed by “text://�, e.g., “text:///var/dbtext/ser�. If there is no
-   “/� after “text://� then “CFG_DIR/� is inserted at the beginning of the
+   prefixed by "text://", e.g., "text:///var/dbtext/ser". If there is no
+   "/" after "text://" then "CFG_DIR/" is inserted at the beginning of the
    database path. So, either you provide an absolute path to database
    database path. So, either you provide an absolute path to database
-   directory or a relative one to “CFG_DIR� directory.
+   directory or a relative one to "CFG_DIR" directory.
 
 
    Example 1.5. Load the dbtext module
    Example 1.5. Load the dbtext module
 ...
 ...
@@ -249,12 +251,13 @@ loadmodule "/path/to/kamailio/modules_k/db_text.so"
 modparam("module_name", "db_url", "text:///path/to/dbtext/database")
 modparam("module_name", "db_url", "text:///path/to/dbtext/database")
 ...
 ...
 
 
-5.1. Using dbtext with basic Kamailio configuration
+5.1. Using db_text with a basic Kamailio configuration
 
 
-   Here are the definitions for most important table as well as a basic
-   configuration file to use dbtext with Kamailio. The table structures
-   may change in time and you will have to adjust next examples. These are
-   know to work with upcoming Kamailio v0.9.x
+   Here are definitions for the most important tables as well as a basic
+   configuration file to use db_text with Kamailio. The table structures
+   may change in time and you will have to adjust these examples. Check
+   the source code directory "utils/kamctl/dbtxt/kamailio" for current
+   definitions.
 
 
    You have to populate the table 'subscriber' by hand with user profiles
    You have to populate the table 'subscriber' by hand with user profiles
    in order to have authentication. To use with the given configuration
    in order to have authentication. To use with the given configuration
@@ -262,17 +265,17 @@ modparam("module_name", "db_url", "text:///path/to/dbtext/database")
 
 
    Example 1.6. Definition of 'subscriber' table (one line)
    Example 1.6. Definition of 'subscriber' table (one line)
 ...
 ...
-username(str) domain(str) password(str) first_name(str) last_name(str) phone(st
-r) email_address(str) datetime_created(int) datetime_modified(int) confirmation
-(str) flag(str) sendnotification(str) greeting(str) ha1(str) ha1b(str) perms(st
-r) allow_find(str) timezone(str,null) rpid(str,null)
+username(str) domain(str) password(str) first_name(str) last_name(str) phone(str
+) email_address(str) datetime_created(int) datetime_modified(int) confirmation(s
+tr) flag(str) sendnotification(str) greeting(str) ha1(str) ha1b(str) perms(str)
+allow_find(str) timezone(str,null) rpid(str,null)
 ...
 ...
 
 
    Example 1.7. Definition of 'location' and 'aliases' tables (one line)
    Example 1.7. Definition of 'location' and 'aliases' tables (one line)
 ...
 ...
-username(str) domain(str,null) contact(str,null) received(str) expires(int,null
-) q(double,null) callid(str,null) cseq(int,null) last_modified(str) flags(int)
-user_agent(str) socket(str)
+username(str) domain(str,null) contact(str,null) received(str) expires(int,null)
+ q(double,null) callid(str,null) cseq(int,null) last_modified(str) flags(int) us
+er_agent(str) socket(str)
 ...
 ...
 
 
    Example 1.8. Definition of 'version' table and sample records
    Example 1.8. Definition of 'version' table and sample records

+ 29 - 22
modules/db_text/doc/db_text_admin.xml

@@ -22,8 +22,8 @@
 	<para>
 	<para>
 		The module is meant for use in demos or small devices that do not
 		The module is meant for use in demos or small devices that do not
 		support other DB modules. It keeps everything in memory and if you deal
 		support other DB modules. It keeps everything in memory and if you deal
-		with large amount of data you may run quickly out of memory. Also, it
-		has not implemented all standard database facilities (like order by),
+		with large amount of data you may run out of memory quickly. Also, it
+		does not implement all standard database facilities (like order by),
 		it includes minimal functionality to work properly (who knows ?!?)
 		it includes minimal functionality to work properly (who knows ?!?)
 		with &kamailio;.
 		with &kamailio;.
 	</para>
 	</para>
@@ -33,10 +33,10 @@
 		it will fail (support for such situation is in to-do list).
 		it will fail (support for such situation is in to-do list).
 	</para>
 	</para>
 	<para>
 	<para>
-		NOTE: even when is in non-caching mode, the module does not write
+		NOTE: even when db_text is in non-caching mode, the module does not write
 		back to hard drive after changes. In this mode, the module checks if
 		back to hard drive after changes. In this mode, the module checks if
 		the corresponding file on disk has changed, and reloads it. The write
 		the corresponding file on disk has changed, and reloads it. The write
-		on disk happens at openser shut down.
+		to disk happens at &kamailio; shut down.
 	</para>
 	</para>
 		<section>
 		<section>
 		<title>Design of dbtext engine</title>
 		<title>Design of dbtext engine</title>
@@ -45,10 +45,12 @@
 			<itemizedlist>
 			<itemizedlist>
 			<listitem>
 			<listitem>
 				<para>
 				<para>
-				a database is represented by a directory in the local file
+				A database is represented by a directory in the local file
 				system.
 				system.
+				</para>
+				<para>
 				NOTE: when you use <emphasis>dbtext</emphasis> in &kamailio;,
 				NOTE: when you use <emphasis>dbtext</emphasis> in &kamailio;,
-				the	database URL for modules must be the path to the directory
+				the database URL for modules must be the path to the directory
 				where the table-files are located, prefixed by 
 				where the table-files are located, prefixed by 
 				<quote>text://</quote>, e.g., 
 				<quote>text://</quote>, e.g., 
 				<quote>text:///var/dbtext/ser</quote>. If there is no
 				<quote>text:///var/dbtext/ser</quote>. If there is no
@@ -58,10 +60,14 @@
 				database directory or a relative one to <quote>CFG_DIR</quote>
 				database directory or a relative one to <quote>CFG_DIR</quote>
 				directory.
 				directory.
 				</para>
 				</para>
+				<para>
+				Do not forget that all databases in &kamailio; needs the <quote>version</quote>
+				table.
+				</para>
 			</listitem>
 			</listitem>
 			<listitem>
 			<listitem>
 				<para>
 				<para>
-				a table is represented by a text file inside database directory.
+				A table is represented by a text file inside database directory.
 				</para>
 				</para>
 			</listitem>
 			</listitem>
 			</itemizedlist>
 			</itemizedlist>
@@ -70,8 +76,8 @@
 		<section>
 		<section>
 		<title>Internal format of a dbtext table</title>
 		<title>Internal format of a dbtext table</title>
 		<para>
 		<para>
-		First line is the definition of the columns. Each column must be
-		declared as follows:
+		The first line is the definition of the columns. Each column must be
+		declared in the following format:
 			<itemizedlist>
 			<itemizedlist>
 			<listitem>
 			<listitem>
 				<para>
 				<para>
@@ -200,10 +206,10 @@ suser:supasswd:xxx:alpha.org:xxx
 		</section>
 		</section>
 		<section>
 		<section>
 		<title>Existing limitations</title>
 		<title>Existing limitations</title>
-		<para>This database interface don't support the data insertion with
-				default values. All such values specified in the database template
-				are ignored. So its advisable to specify all data for a column at
-				insertion operations.
+		<para>This database interface does not support data insertion with
+			default values. All such values specified in the database template
+			are ignored. So its advisable to specify all data for a column at
+			insertion operations.
 		</para>
 		</para>
 		</section>
 		</section>
 	</section>
 	</section>
@@ -212,7 +218,7 @@ suser:supasswd:xxx:alpha.org:xxx
 		<section>
 		<section>
 			<title>&kamailio; modules</title>
 			<title>&kamailio; modules</title>
 		<para>
 		<para>
-			The next modules must be loaded before this module:
+			These modules must be loaded before this module:
 			<itemizedlist>
 			<itemizedlist>
 			<listitem>
 			<listitem>
 				<para>
 				<para>
@@ -225,7 +231,7 @@ suser:supasswd:xxx:alpha.org:xxx
 		<section>
 		<section>
 			<title>External libraries or applications</title>
 			<title>External libraries or applications</title>
 		<para>
 		<para>
-			The next libraries or applications must be installed before running
+			These libraries or applications must be installed before running
 			&kamailio; with this module:
 			&kamailio; with this module:
 			<itemizedlist>
 			<itemizedlist>
 			<listitem>
 			<listitem>
@@ -248,7 +254,7 @@ suser:supasswd:xxx:alpha.org:xxx
 		Set caching mode (0) or non-caching mode (1). In caching mode, data
 		Set caching mode (0) or non-caching mode (1). In caching mode, data
 		is loaded at startup. In non-caching mode, the module check every time
 		is loaded at startup. In non-caching mode, the module check every time
 		a table is requested whether the corresponding file on disk has
 		a table is requested whether the corresponding file on disk has
-		changed, and if yes, will re-load table from file.
+		changed, and if yes, will re-load the table from file.
 		</para>
 		</para>
 		<para>
 		<para>
 		<emphasis>
 		<emphasis>
@@ -271,7 +277,7 @@ modparam("db_text", "db_mode", 1)
 		<title>
 		<title>
 		<function moreinfo="none">db_text.dump</function>
 		<function moreinfo="none">db_text.dump</function>
 		</title>
 		</title>
-		<para>Write back to hard drive modified tables.</para>
+		<para>Write back to hard drive all modified tables.</para>
 		<para>Name: <emphasis>db_text.dump</emphasis></para>
 		<para>Name: <emphasis>db_text.dump</emphasis></para>
 		<para>Parameters: <emphasis>none</emphasis></para>
 		<para>Parameters: <emphasis>none</emphasis></para>
 		<para>RPC Command Format:</para>
 		<para>RPC Command Format:</para>
@@ -307,12 +313,13 @@ modparam("module_name", "db_url", "text:///path/to/dbtext/database")
 </programlisting>
 </programlisting>
 		</example>
 		</example>
 		<section>
 		<section>
-			<title>Using dbtext with basic &kamailio; configuration</title>
+			<title>Using db_text with a basic &kamailio; configuration</title>
 		<para>
 		<para>
-		Here are the definitions for most important table as well as a basic 
-		configuration file to use dbtext with &kamailio;. The table structures
-		may change in time and you will have to adjust next examples. These are 
-		know to work with upcoming &kamailio; v0.9.x
+		Here are definitions for the most important tables as well as a basic 
+		configuration file to use db_text with &kamailio;. The table structures
+		may change in time and you will have to adjust these examples. Check the
+		source code directory <quote>utils/kamctl/dbtxt/kamailio</quote> for
+		current definitions.
 		</para>
 		</para>
 		<para>
 		<para>
 		You have to populate the table 'subscriber' by hand with user profiles 
 		You have to populate the table 'subscriber' by hand with user profiles