Module: sip-router
Branch: janakj/flatstore
Commit: 9a39980c160d0a992db1562e830f67f64ea70d68
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9a39980…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Mar 10 11:17:28 2008 +0000
- content of faq removed (mistakenly added by me after Henning did the cleanup for modules' docs; rev 3839)
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3901 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_flatstore/km_README | 42 +--------------------------------------
1 files changed, 2 insertions(+), 40 deletions(-)
diff --git a/modules/db_flatstore/km_README b/modules/db_flatstore/km_README
index b211702..4caf37b 100644
--- a/modules/db_flatstore/km_README
+++ b/modules/db_flatstore/km_README
@@ -10,8 +10,8 @@ Jan Janak
Copyright � 2004, 2005 FhG FOKUS
Revision History
- Revision $Revision$ $Date: 2008-03-07 21:52:29 +0200
- (Fri, 07 Mar 2008) $
+ Revision $Revision$ $Date: 2008-03-08 01:03:56 +0200
+ (Sat, 08 Mar 2008) $
__________________________________________________________
Table of Contents
@@ -37,7 +37,6 @@ Jan Janak
1.5.1. flat_rotate
2. Developer's Guide
- 3. Frequently Asked Questions
List of Examples
@@ -167,40 +166,3 @@ modparam("db_flatstore", "flush", 0)
Chapter 2. Developer's Guide
The module implements the DB API.
-
-Chapter 3. Frequently Asked Questions
-
- Revision History
- Revision $Revision$ $Date: 2005-06-13 19:47:24 +0300 (Mon,
- 13 Jun 2005) $
-
- 3.1.
-
- Where can I find more about OpenSER?
-
- Take a look at http://openser.org/.
-
- 3.2.
-
- Where can I post a question about this module?
-
- First at all check if your question was already answered on one
- of our mailing lists:
- * User Mailing List -
- http://openser.org/cgi-bin/mailman/listinfo/users
- * Developer Mailing List -
- http://openser.org/cgi-bin/mailman/listinfo/devel
-
- E-mails regarding any stable OpenSER release should be sent to
- <users(a)openser.org> and e-mails regarding development versions
- should be sent to <devel(a)openser.org>.
-
- If you want to keep the mail private, send it to
- <team(a)openser.org>.
-
- 3.3.
-
- How can I report a bug?
-
- Please follow the guidelines provided at:
- http://sourceforge.net/tracker/?group_id=139143.
Module: sip-router
Branch: janakj/flatstore
Commit: 04f0bfe2b359afaad6f227e41ad1e919debff73e
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=04f0bfe…
Author: Bogdan-Andrei Iancu <bogdan(a)voice-system.ro>
Committer: Bogdan-Andrei Iancu <bogdan(a)voice-system.ro>
Date: Fri Apr 18 09:04:44 2008 +0000
- fixed bug in keeping the dir path for the flatstore files - as the path is a substring of the DB URL, we need to explicitly allocate a str structure for it; otherwise we will randomly write in memory :D
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4040 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_flatstore/km_flatstore.c | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/modules/db_flatstore/km_flatstore.c b/modules/db_flatstore/km_flatstore.c
index 714ac3b..89cff26 100644
--- a/modules/db_flatstore/km_flatstore.c
+++ b/modules/db_flatstore/km_flatstore.c
@@ -57,6 +57,7 @@ static int parse_flat_url(const str* url, str* path)
db_con_t* flat_db_init(const str* url)
{
db_con_t* res;
+ str* path;
if (!url || !url->s) {
LM_ERR("invalid parameter value\n");
@@ -68,17 +69,22 @@ db_con_t* flat_db_init(const str* url)
* parameter in the table variable, flat_use_table will then pick that
* value and open the file
*/
- res = pkg_malloc(sizeof(db_con_t) + sizeof(struct flat_con*));
+ /* as the table (path) is a substring of the received str, we need to
+ * allocate a separate str struct for it -bogdan
+ */
+ res = pkg_malloc(sizeof(db_con_t)+sizeof(struct flat_con*)+sizeof(str));
if (!res) {
LM_ERR("no pkg memory left\n");
return 0;
}
- memset(res, 0, sizeof(db_con_t) + sizeof(struct flat_con*));
+ memset(res, 0, sizeof(db_con_t) + sizeof(struct flat_con*) + sizeof(str));
+ path = (str*)(((char*)res) + sizeof(db_con_t) + sizeof(struct flat_con*));
- if (parse_flat_url(url, (str*)res->table) < 0) {
+ if (parse_flat_url(url, path) < 0) {
pkg_free(res);
return 0;
}
+ res->table = path;
return res;
}
@@ -99,16 +105,16 @@ int flat_use_table(db_con_t* h, const str* t)
if (CON_TABLE(h)->s != t->s) {
if (CON_TAIL(h)) {
- /* Decrement the reference count
- * of the connection but do not remove
- * it from the connection pool
- */
+ /* Decrement the reference count
+ * of the connection but do not remove
+ * it from the connection pool
+ */
con = (struct flat_con*)CON_TAIL(h);
con->ref--;
-
}
- CON_TAIL(h) = (unsigned long)flat_get_connection((char*)CON_TABLE(h)->s, (char*)t->s);
+ CON_TAIL(h) = (unsigned long)
+ flat_get_connection((char*)CON_TABLE(h)->s, (char*)t->s);
if (!CON_TAIL(h)) {
return -1;
}
Module: sip-router
Branch: janakj/flatstore
Commit: ca8493c30735c844820c0af2808223a19d6b9e22
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ca8493c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Mar 19 19:31:30 2008 +0000
- updated old entity names
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3939 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_flatstore/km_doc/db_flatstore.xml | 2 +-
modules/db_flatstore/km_doc/db_flatstore_admin.xml | 28 ++++++++++----------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/modules/db_flatstore/km_doc/db_flatstore.xml b/modules/db_flatstore/km_doc/db_flatstore.xml
index dafd5d5..a766d63 100644
--- a/modules/db_flatstore/km_doc/db_flatstore.xml
+++ b/modules/db_flatstore/km_doc/db_flatstore.xml
@@ -16,7 +16,7 @@
<book>
<bookinfo>
<title>Flatstore Module</title>
- <productname class="trade">&sername;</productname>
+ <productname class="trade">&opensername;</productname>
<authorgroup>
<author>
<firstname>Jan</firstname>
diff --git a/modules/db_flatstore/km_doc/db_flatstore_admin.xml b/modules/db_flatstore/km_doc/db_flatstore_admin.xml
index 60d872e..8c78440 100644
--- a/modules/db_flatstore/km_doc/db_flatstore_admin.xml
+++ b/modules/db_flatstore/km_doc/db_flatstore_admin.xml
@@ -7,7 +7,7 @@
<section>
<title>Overview</title>
<para>
- Flatstore is one of so-called &ser; database modules. It does not
+ Flatstore is one of so-called &openser; database modules. It does not
export any functions executable from the configuration scripts, but
it exports a subset of functions from the database API and thus
other module can use it instead of, for example, mysql module.
@@ -38,7 +38,7 @@ modparam("acc", "db_url", "flatstore:/var/log/acc")
<para>
This configuration options tells acc module that it should use the
flatstore module and the flatstore module should create all files
- in /var/log/acc directory. The directory must exist and &ser;
+ in /var/log/acc directory. The directory must exist and &openser;
processes must have permissions to create files in that directory.
</para>
<para>
@@ -48,12 +48,12 @@ modparam("acc", "db_url", "flatstore:/var/log/acc")
<table_name>_<process_name>.log
</programlisting>
<para>
- For example, entries writen by &ser; process 8 into acc table would
+ For example, entries writen by &openser; process 8 into acc table would
be written in file acc_8.log. For each table there will be several
- files, one file for every &ser; process that wrote some data into
+ files, one file for every &openser; process that wrote some data into
that table. The main reason why there are several files for each
table is that it is much faster to have one file per process,
- because it does not require any locking and thus &ser; processes will
+ because it does not require any locking and thus &openser; processes will
not block each other. To get the complete data for a table you can
simply concatenate the contents of files with the same table name
but different process id.
@@ -61,9 +61,9 @@ modparam("acc", "db_url", "flatstore:/var/log/acc")
<section id="rotating">
<title>Rotating Log Files</title>
<para>
- There is a new &ser; MI (management interface) command called
+ There is a new &openser; MI (management interface) command called
flat_rotate.
- When &ser; receives the command then it will close and reopen all
+ When &openser; receives the command then it will close and reopen all
files used by flatstore module. The rotation itself has to be
done by another application (such as logrotate). Follow these
steps to rotate files generated by flatstore module:
@@ -79,21 +79,21 @@ mv acc_2.log acc_2.log.20050605
mv acc_4.log acc_3.log.20050605
...
</screen>
- Note that at this point &ser; will still be writing all
+ Note that at this point &openser; will still be writing all
data into the renamed files.
</para>
</listitem>
<listitem>
<para>
- Send &ser; the MI command to close and reopen the
+ Send &openser; the MI command to close and reopen the
renamed files. For example, using FIFO:
<screen>
openserctl fifo flat_rotate
</screen>
- This will force &ser; to close the renamed files and open
+ This will force &openser; to close the renamed files and open
new ones with original names, such as
<filename>acc_1.log</filename>. New files will be open
- at the point when &ser; has some data to write. It is
+ at the point when &openser; has some data to write. It is
normal that the files will be not created immediately
if there is no traffic on the proxy server.
</para>
@@ -110,13 +110,13 @@ openserctl fifo flat_rotate
<section>
<title>Dependencies</title>
<section>
- <title>&ser; Modules</title>
+ <title>&openser; Modules</title>
<para>
The following modules must be loaded before this module:
<itemizedlist>
<listitem>
<para>
- <emphasis>No dependencies on other &ser; modules</emphasis>.
+ <emphasis>No dependencies on other &openser; modules</emphasis>.
</para>
</listitem>
</itemizedlist>
@@ -126,7 +126,7 @@ openserctl fifo flat_rotate
<title>External Libraries or Applications</title>
<para>
The following libraries or applications must be installed before running
- &ser; with this module loaded:
+ &openser; with this module loaded:
<itemizedlist>
<listitem>
<para>
Module: sip-router
Branch: janakj/flatstore
Commit: 3977e013fd2a88550f5acbe4e778b6893dd33a0a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3977e01…
Author: Klaus Darilion <klaus.darilion(a)pernau.at>
Committer: Klaus Darilion <klaus.darilion(a)pernau.at>
Date: Tue Aug 5 15:29:23 2008 +0000
- renaming scripts part 1
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4571 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_flatstore/km_README | 2 +-
modules/db_flatstore/km_doc/db_flatstore_admin.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/db_flatstore/km_README b/modules/db_flatstore/km_README
index 80197d0..6e0bb43 100644
--- a/modules/db_flatstore/km_README
+++ b/modules/db_flatstore/km_README
@@ -110,7 +110,7 @@ mv acc_4.log acc_3.log.20050605
data into the renamed files.
* Send Kamailio the MI command to close and reopen the
renamed files. For example, using FIFO:
-openserctl fifo flat_rotate
+kamctl fifo flat_rotate
This will force Kamailio to close the renamed files and
open new ones with original names, such as acc_1.log. New
diff --git a/modules/db_flatstore/km_doc/db_flatstore_admin.xml b/modules/db_flatstore/km_doc/db_flatstore_admin.xml
index 347aa22..e96530d 100644
--- a/modules/db_flatstore/km_doc/db_flatstore_admin.xml
+++ b/modules/db_flatstore/km_doc/db_flatstore_admin.xml
@@ -88,7 +88,7 @@ mv acc_4.log acc_3.log.20050605
Send &openser; the MI command to close and reopen the
renamed files. For example, using FIFO:
<screen>
-openserctl fifo flat_rotate
+kamctl fifo flat_rotate
</screen>
This will force &openser; to close the renamed files and open
new ones with original names, such as
Module: sip-router
Branch: janakj/flatstore
Commit: 6f1e6556e449d1f06db549bd11ee235647d63707
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6f1e655…
Author: Klaus Darilion <klaus.darilion(a)pernau.at>
Committer: Klaus Darilion <klaus.darilion(a)pernau.at>
Date: Wed Aug 6 10:39:08 2008 +0000
- rebuilt default READMEs
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4595 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_flatstore/km_README | 78 ++++++++++++++++++++--------------------
1 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/modules/db_flatstore/km_README b/modules/db_flatstore/km_README
index 6e0bb43..ba460ed 100644
--- a/modules/db_flatstore/km_README
+++ b/modules/db_flatstore/km_README
@@ -1,3 +1,4 @@
+
Flatstore Module
Jan Janak
@@ -10,9 +11,9 @@ Jan Janak
Copyright � 2004, 2005 FhG FOKUS
Revision History
- Revision $Revision$ $Date: 2008-03-19 20:31:30 +0100
- (Mi, 19 Mär 2008) $
- __________________________________________________________
+ Revision $Revision$ $Date: 2008-08-06 12:08:33 +0200
+ (Wed, 06 Aug 2008) $
+ _________________________________________________________
Table of Contents
@@ -34,7 +35,7 @@ Jan Janak
1.4. Exported Functions
1.5. Exported MI Functions
- 1.5.1. flat_rotate
+ 1.5.1. flat_rotate
2. Developer Guide
@@ -47,34 +48,34 @@ Chapter 1. Admin Guide
1.1. Overview
Flatstore is one of so-called Kamailio database modules. It
- does not export any functions executable from the configuration
- scripts, but it exports a subset of functions from the database
- API and thus other module can use it instead of, for example,
- mysql module.
+ does not export any functions executable from the
+ configuration scripts, but it exports a subset of functions
+ from the database API and thus other module can use it instead
+ of, for example, mysql module.
The module does not export all functions of the database API,
it supports only one function, insert. The module is limited
- but very fast. It is especially suitable for storing accounting
- information on sites with extremely high traffic. If MySQL is
- too slow or if you get a huge amount of accounting data then
- you can consider using this module. Note that the acc module is
- the only module that was tested with flastore.
+ but very fast. It is especially suitable for storing
+ accounting information on sites with extremely high traffic.
+ If MySQL is too slow or if you get a huge amount of accounting
+ data then you can consider using this module. Note that the
+ acc module is the only module that was tested with flastore.
The format of the files produced by this module is plain text.
- Each line consists of several fields, fields are separated by |
- character. New information is always appended at the end of the
- file, searching, deleting and updating of existing data is not
- supported by the module.
+ Each line consists of several fields, fields are separated by
+ | character. New information is always appended at the end of
+ the file, searching, deleting and updating of existing data is
+ not supported by the module.
The acc module can be configured to use flatstore module as
database backend using the db_url_parameter:
modparam("acc", "db_url", "flatstore:/var/log/acc")
This configuration options tells acc module that it should use
- the flatstore module and the flatstore module should create all
- files in /var/log/acc directory. The directory must exist and
- Kamailio processes must have permissions to create files in
- that directory.
+ the flatstore module and the flatstore module should create
+ all files in /var/log/acc directory. The directory must exist
+ and Kamailio processes must have permissions to create files
+ in that directory.
Name of files in that directory will follow the following
pattern:
@@ -82,14 +83,14 @@ modparam("acc", "db_url", "flatstore:/var/log/acc")
For example, entries writen by Kamailio process 8 into acc
table would be written in file acc_8.log. For each table there
- will be several files, one file for every Kamailio process that
- wrote some data into that table. The main reason why there are
- several files for each table is that it is much faster to have
- one file per process, because it does not require any locking
- and thus Kamailio processes will not block each other. To get
- the complete data for a table you can simply concatenate the
- contents of files with the same table name but different
- process id.
+ will be several files, one file for every Kamailio process
+ that wrote some data into that table. The main reason why
+ there are several files for each table is that it is much
+ faster to have one file per process, because it does not
+ require any locking and thus Kamailio processes will not block
+ each other. To get the complete data for a table you can
+ simply concatenate the contents of files with the same table
+ name but different process id.
1.1.1. Rotating Log Files
@@ -105,18 +106,17 @@ mv acc_1.log acc_1.log.20050605
mv acc_2.log acc_2.log.20050605
mv acc_4.log acc_3.log.20050605
...
-
- Note that at this point Kamailio will still be writing all
- data into the renamed files.
+ Note that at this point Kamailio
+ will still be writing all data into the renamed files.
* Send Kamailio the MI command to close and reopen the
renamed files. For example, using FIFO:
kamctl fifo flat_rotate
-
- This will force Kamailio to close the renamed files and
- open new ones with original names, such as acc_1.log. New
- files will be open at the point when Kamailio has some data
- to write. It is normal that the files will be not created
- immediately if there is no traffic on the proxy server.
+ This will force Kamailio to close
+ the renamed files and open new ones with original names,
+ such as acc_1.log. New files will be open at the point
+ when Kamailio has some data to write. It is normal that
+ the files will be not created immediately if there is no
+ traffic on the proxy server.
* Move the renamed files somewhere else and process them.
1.2. Dependencies
@@ -138,7 +138,7 @@ kamctl fifo flat_rotate
Enable or disable flushing after each write.
- Default value is 1.
+ Default value is 1.
Example 1.1. Set "flush" parameter
...
Module: sip-router
Branch: janakj/flatstore
Commit: f16670b0bc573f4114ef33d4600288783cd6635e
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f16670b…
Author: Klaus Darilion <klaus.darilion(a)pernau.at>
Committer: Klaus Darilion <klaus.darilion(a)pernau.at>
Date: Wed Aug 6 10:08:33 2008 +0000
- renaming: changed entities in documentation
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4594 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_flatstore/km_doc/db_flatstore.xml | 2 +-
modules/db_flatstore/km_doc/db_flatstore_admin.xml | 28 ++++++++++----------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/modules/db_flatstore/km_doc/db_flatstore.xml b/modules/db_flatstore/km_doc/db_flatstore.xml
index a766d63..9c30b02 100644
--- a/modules/db_flatstore/km_doc/db_flatstore.xml
+++ b/modules/db_flatstore/km_doc/db_flatstore.xml
@@ -16,7 +16,7 @@
<book>
<bookinfo>
<title>Flatstore Module</title>
- <productname class="trade">&opensername;</productname>
+ <productname class="trade">&kamailioname;</productname>
<authorgroup>
<author>
<firstname>Jan</firstname>
diff --git a/modules/db_flatstore/km_doc/db_flatstore_admin.xml b/modules/db_flatstore/km_doc/db_flatstore_admin.xml
index e96530d..08610af 100644
--- a/modules/db_flatstore/km_doc/db_flatstore_admin.xml
+++ b/modules/db_flatstore/km_doc/db_flatstore_admin.xml
@@ -7,7 +7,7 @@
<section>
<title>Overview</title>
<para>
- Flatstore is one of so-called &openser; database modules. It does not
+ Flatstore is one of so-called &kamailio; database modules. It does not
export any functions executable from the configuration scripts, but
it exports a subset of functions from the database API and thus
other module can use it instead of, for example, mysql module.
@@ -38,7 +38,7 @@ modparam("acc", "db_url", "flatstore:/var/log/acc")
<para>
This configuration options tells acc module that it should use the
flatstore module and the flatstore module should create all files
- in /var/log/acc directory. The directory must exist and &openser;
+ in /var/log/acc directory. The directory must exist and &kamailio;
processes must have permissions to create files in that directory.
</para>
<para>
@@ -48,12 +48,12 @@ modparam("acc", "db_url", "flatstore:/var/log/acc")
<table_name>_<process_name>.log
</programlisting>
<para>
- For example, entries writen by &openser; process 8 into acc table would
+ For example, entries writen by &kamailio; process 8 into acc table would
be written in file acc_8.log. For each table there will be several
- files, one file for every &openser; process that wrote some data into
+ files, one file for every &kamailio; process that wrote some data into
that table. The main reason why there are several files for each
table is that it is much faster to have one file per process,
- because it does not require any locking and thus &openser; processes will
+ because it does not require any locking and thus &kamailio; processes will
not block each other. To get the complete data for a table you can
simply concatenate the contents of files with the same table name
but different process id.
@@ -61,9 +61,9 @@ modparam("acc", "db_url", "flatstore:/var/log/acc")
<section id="rotating">
<title>Rotating Log Files</title>
<para>
- There is a new &openser; MI (management interface) command called
+ There is a new &kamailio; MI (management interface) command called
flat_rotate.
- When &openser; receives the command then it will close and reopen all
+ When &kamailio; receives the command then it will close and reopen all
files used by flatstore module. The rotation itself has to be
done by another application (such as logrotate). Follow these
steps to rotate files generated by flatstore module:
@@ -79,21 +79,21 @@ mv acc_2.log acc_2.log.20050605
mv acc_4.log acc_3.log.20050605
...
</screen>
- Note that at this point &openser; will still be writing all
+ Note that at this point &kamailio; will still be writing all
data into the renamed files.
</para>
</listitem>
<listitem>
<para>
- Send &openser; the MI command to close and reopen the
+ Send &kamailio; the MI command to close and reopen the
renamed files. For example, using FIFO:
<screen>
kamctl fifo flat_rotate
</screen>
- This will force &openser; to close the renamed files and open
+ This will force &kamailio; to close the renamed files and open
new ones with original names, such as
<filename>acc_1.log</filename>. New files will be open
- at the point when &openser; has some data to write. It is
+ at the point when &kamailio; has some data to write. It is
normal that the files will be not created immediately
if there is no traffic on the proxy server.
</para>
@@ -110,13 +110,13 @@ kamctl fifo flat_rotate
<section>
<title>Dependencies</title>
<section>
- <title>&openser; Modules</title>
+ <title>&kamailio; Modules</title>
<para>
The following modules must be loaded before this module:
<itemizedlist>
<listitem>
<para>
- <emphasis>No dependencies on other &openser; modules</emphasis>.
+ <emphasis>No dependencies on other &kamailio; modules</emphasis>.
</para>
</listitem>
</itemizedlist>
@@ -126,7 +126,7 @@ kamctl fifo flat_rotate
<title>External Libraries or Applications</title>
<para>
The following libraries or applications must be installed before running
- &openser; with this module loaded:
+ &kamailio; with this module loaded:
<itemizedlist>
<listitem>
<para>