Module: sip-router
Branch: janakj/flatstore
Commit: f1b2f98b1ba90aec0fd4902a6e461dc908072505
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f1b2f98…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Wed Jul 30 09:20:54 2008 +0000
- fix some FAQ entries, change missing entity, regenerate READMEs
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4524 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_flatstore/km_README | 50 ++++++++++++++++++++--------------------
1 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/modules/db_flatstore/km_README b/modules/db_flatstore/km_README
index b74a23b..80197d0 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-19 21:31:30 +0200
- (Wed, 19 Mar 2008) $
+ Revision $Revision$ $Date: 2008-03-19 20:31:30 +0100
+ (Mi, 19 Mär 2008) $
__________________________________________________________
Table of Contents
@@ -24,7 +24,7 @@ Jan Janak
1.2. Dependencies
- 1.2.1. OpenSER Modules
+ 1.2.1. Kamailio Modules
1.2.2. External Libraries or Applications
1.3. Exported Parameters
@@ -46,8 +46,8 @@ Chapter 1. Admin Guide
1.1. Overview
- Flatstore is one of so-called OpenSER database modules. It does
- not export any functions executable from the configuration
+ 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.
@@ -73,29 +73,29 @@ 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
- OpenSER processes must have permissions to create files in that
- directory.
+ Kamailio processes must have permissions to create files in
+ that directory.
Name of files in that directory will follow the following
pattern:
<table_name>_<process_name>.log
- 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 OpenSER process that wrote
- some data into that table. The main reason why there are
+ 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 OpenSER processes will not block each other. To get
+ 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
- There is a new OpenSER MI (management interface) command called
- flat_rotate. When OpenSER receives the command then it will
- close and reopen all files used by flatstore module. The
+ There is a new Kamailio MI (management interface) command
+ called flat_rotate. 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:
@@ -106,30 +106,30 @@ mv acc_2.log acc_2.log.20050605
mv acc_4.log acc_3.log.20050605
...
- 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.
- * Send OpenSER the MI command to close and reopen the renamed
- files. For example, using FIFO:
+ * Send Kamailio the MI command to close and reopen the
+ renamed files. For example, using FIFO:
openserctl fifo flat_rotate
- This will force OpenSER 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 OpenSER has some data to
- write. It is normal that the files will be not created
+ 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
-1.2.1. OpenSER Modules
+1.2.1. Kamailio Modules
The following modules must be loaded before this module:
- * No dependencies on other OpenSER modules.
+ * No dependencies on other Kamailio modules.
1.2.2. External Libraries or Applications
The following libraries or applications must be installed
- before running OpenSER with this module loaded:
+ before running Kamailio with this module loaded:
* None.
1.3. Exported Parameters
Module: sip-router
Branch: janakj/postgres
Commit: f0546a246d0098405b61a64ca0fbaf32bbb5373f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f0546a2…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Wed Feb 18 14:32:18 2009 +0100
Integrate functions and parameters from kamailio sources.
This patch adds db_bind_api function from kamailio sources to the list
of exported functions. Also we call the mod_init function from kamailio
sources at the and of the mod_init function in pg_mod.c. To make this
possible I added a new header file and removed static from the mod_init
function declaration.
---
modules/db_postgres/km_db_postgres.c | 9 ++-----
modules/db_postgres/km_db_postgres.h | 39 ++++++++++++++++++++++++++++++++++
modules/db_postgres/pg_mod.c | 4 ++-
3 files changed, 45 insertions(+), 7 deletions(-)
diff --git a/modules/db_postgres/km_db_postgres.c b/modules/db_postgres/km_db_postgres.c
index c3df575..ffe9230 100644
--- a/modules/db_postgres/km_db_postgres.c
+++ b/modules/db_postgres/km_db_postgres.c
@@ -38,14 +38,11 @@
#include "../../lib/srdb1/db_con.h"
#include "../../lib/srdb1/db.h"
#include "km_dbase.h"
+#include "km_db_postgres.h"
/*MODULE_VERSION*/
-int db_postgres_bind_api(db_func_t *dbb);
-
-static int mod_init(void);
-
/*
* PostgreSQL database module interface
*/
@@ -66,14 +63,14 @@ struct kam_module_exports kam_exports = {
0, /* exported MI functions */
0, /* exported pseudo-variables */
0, /* extra processes */
- mod_init, /* module initialization function */
+ km_postgres_mod_init, /* module initialization function */
0, /* response function*/
0, /* destroy function */
0 /* per-child init function */
};
-static int mod_init(void)
+int km_postgres_mod_init(void)
{
return 0;
}
diff --git a/modules/db_postgres/km_db_postgres.h b/modules/db_postgres/km_db_postgres.h
new file mode 100644
index 0000000..8959417
--- /dev/null
+++ b/modules/db_postgres/km_db_postgres.h
@@ -0,0 +1,39 @@
+/*
+ * $Id$
+ *
+ * Copyright (C) 2001-2003 FhG Fokus
+ * Copyright (C) 2008 1&1 Internet AG
+ *
+ * This file is part of Kamailio, a free SIP server.
+ *
+ * Kamailio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version
+ *
+ * Kamailio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*! \file
+ * \brief DB_POSTGRES :: Core
+ * \ingroup db_postgres
+ * Module: \ref db_postgres
+ */
+
+#ifndef _KM_DB_POSTGRES_H
+#define _KM_DB_POSTGRES_H
+
+#include "../../lib/srdb1/db.h"
+
+int db_postgres_bind_api(db_func_t *dbb);
+
+int km_postgres_mod_init(void);
+
+#endif /* _KM_DB_POSTGRES_H */
diff --git a/modules/db_postgres/pg_mod.c b/modules/db_postgres/pg_mod.c
index 1bc4ad4..3c1e2d9 100644
--- a/modules/db_postgres/pg_mod.c
+++ b/modules/db_postgres/pg_mod.c
@@ -42,6 +42,7 @@
#include "pg_cmd.h"
#include "pg_res.h"
#include "pg_fld.h"
+#include "km_db_postgres.h"
#include "../../sr_module.h"
@@ -77,6 +78,7 @@ static cmd_export_t cmds[] = {
{"db_next", (cmd_function)pg_cmd_next, 0, 0, 0},
{"db_setopt", (cmd_function)pg_setopt, 0, 0, 0},
{"db_getopt", (cmd_function)pg_getopt, 0, 0, 0},
+ {"db_bind_api", (cmd_function)db_postgres_bind_api, 0, 0, 0},
{0, 0, 0, 0, 0}
};
@@ -538,7 +540,7 @@ static int pg_mod_init(void)
}
return -1;
#endif /* PG_TEST */
- return 0;
+ return km_postgres_mod_init();
}
/** @} */
Module: sip-router
Branch: janakj/postgres
Commit: 70764fb02a5be0f7ccca4f6e66adbdf083fdaea8
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=70764fb…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Fri Jan 9 13:23:11 2009 +0000
- another error condition fix for a problem that gets introduced by a
recent change: don't try to free memory in the row_buf that don't
belong to us anymore
- reported by Bayan Towfiq, bayan at flowroute dot com
- remove row_buf[col] NULL assignment that was not executed anyway
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5438 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_postgres/km_res.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/modules/db_postgres/km_res.c b/modules/db_postgres/km_res.c
index 548e535..0cd80c5 100644
--- a/modules/db_postgres/km_res.c
+++ b/modules/db_postgres/km_res.c
@@ -256,19 +256,10 @@ int db_postgres_convert_rows(const db_con_t* _h, db_res_t* _r)
if(db_postgres_convert_row(_h, _r, &(RES_ROWS(_r)[row - RES_LAST_ROW(_r)]), row_buf)<0){
LM_ERR("failed to convert row #%d\n", row);
RES_ROW_N(_r) = row - RES_LAST_ROW(_r);
- for (col = 0; col < RES_COL_N(_r); col++) {
- LM_DBG("freeing row_buf[%d] at %p\n", col, row_buf[col]);
- pkg_free(row_buf[col]);
- }
LM_DBG("freeing row buffer at %p\n", row_buf);
pkg_free(row_buf);
db_free_rows(_r);
return -4;
- /*
- * The following housekeeping may not be technically required, but it
- * is a good practice to NULL pointer fields that are no longer valid.
- */
- row_buf[col] = (char *)NULL;
}
}
Module: sip-router
Branch: janakj/postgres
Commit: 269f7048510ed8f84ea0b568df53000d1421ddf8
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=269f704…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Tue Feb 17 14:48:05 2009 +0100
Merge branch 'master' of ssh://janakj@git.sip-router.org/sip-router into postgres
* 'master' of ssh://janakj@git.sip-router.org/sip-router: (194 commits)
Support for db driver names with "db_" prefix in libsrdb2.
Make sure mod_init from kamailio/db_mysql is called.
Export kamailio/db_mysql parameters through the module api.
Export db_bind_api through the module interface.
Eliminate conflicts with files imported from ser/mysql modules.
DB_* renamed to DB1_* in files originating from kamailio/db_mysql.
db_res renamed to db1_res in files originating from kamailio/db_mysql.
db_con renamed to db1_con in files originating from kamailio/db_mysql.
Integration of both modules, first step.
Module name changed to db_mysql.
Changes necessary to make the module compile in the sip-router tree.
- fixed auto_reconnect c&p error
- add one DBG log to each drivers error condition, that the mem is freed
- fix one DBG msg (still using module prefix), two small indention fixes
- partial revert of commit rev5359 for db_mysql module
- add group functionality to read content from specified sections
- unify common rows and row allocation functionality in the DB API core
- change behaviour of db_str2val, this now copy strings
- move db_mysql and db_unixodbc str2val implementation to the DB core,
- fix a few errors in doxygen documentation
...
---