Module: sip-router
Branch: janakj/bdb
Commit: c8928bf3a707be39b59176ec64dcd7a3951c1f10
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c8928bf…
Author: Will Quan <wiquan(a)employees.org>
Committer: Will Quan <wiquan(a)employees.org>
Date: Wed Nov 7 17:32:35 2007 +0000
Add function bdb_time2str
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3049 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_berkeley/bdb_val.c | 43 +++…
[View More]+++++++++++++++++++++++++++++++++++++-
1 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/modules/db_berkeley/bdb_val.c b/modules/db_berkeley/bdb_val.c
index b030ec6..c1330c9 100644
--- a/modules/db_berkeley/bdb_val.c
+++ b/modules/db_berkeley/bdb_val.c
@@ -35,6 +35,47 @@
#include "bdb_val.h"
#include <string.h>
+/**
+ * A copy of db_ut::db_time2str EXCEPT does not wrap the date in single-quotes
+ *
+ * Convert a time_t value to string (w.o single-quote)
+ * \param _v source value
+ * \param _s target string
+ * \param _l available length and target length
+ * \return -1 on error, 0 on success
+ * \todo This functions add quotes to the time value. This
+ * should be done in the val2str function, as some databases
+ * like db_berkeley don't need or like this at all.
+ */
+inline int bdb_time2str(time_t _v, char* _s, int* _l)
+{
+ struct tm* t;
+ int l;
+
+ if ((!_s) || (!_l) || (*_l < 2)) {
+ LM_ERR("Invalid parameter value\n");
+ return -1;
+ }
+
+// *_s++ = '\'';
+
+ /* Convert time_t structure to format accepted by the database */
+ t = localtime(&_v);
+ l = strftime(_s, *_l -1, "%Y-%m-%d %H:%M:%S", t);
+
+ if (l == 0) {
+ LM_ERR("Error during time conversion\n");
+ /* the value of _s is now unspecified */
+ _s = NULL;
+ _l = 0;
+ return -1;
+ }
+ *_l = l;
+
+// *(_s + l) = '\'';
+// *_l = l + 2;
+ return 0;
+}
/**
* Does not copy strings
@@ -207,7 +248,7 @@ int bdb_val2str(db_val_t* _v, char* _s, int* _len)
break;
case DB_DATETIME:
- if (db_time2str(VAL_TIME(_v), _s, _len) < 0) {
+ if (bdb_time2str(VAL_TIME(_v), _s, _len) < 0) {
LM_ERR("Error while converting time_t to string\n");
return -6;
} else {
[View Less]
Module: sip-router
Branch: janakj/bdb
Commit: 16f4fa3431d64dcaec7e3cbc2a46531fecfc9eb5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=16f4fa3…
Author: Will Quan <wiquan(a)employees.org>
Committer: Will Quan <wiquan(a)employees.org>
Date: Wed Nov 28 20:34:07 2007 +0000
Moved definition of STANDARD_TABLES, EXTRA_TABLES, PRESENCE_TABLES to openserdbctl.base.
Add tables 'dispatcher' and 'dialog' to list of STANDARD_TABLES (Patch provided from Ovidiu Sas).…
[View More]
Modified bdb_lib::bdblib_create_table to return error if the table does not exist.
These are all fixes for Bug# 1836601: db_berkeley don't work
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3227 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_berkeley/bdb_lib.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/modules/db_berkeley/bdb_lib.c b/modules/db_berkeley/bdb_lib.c
index 54ee975..8b9f37f 100644
--- a/modules/db_berkeley/bdb_lib.c
+++ b/modules/db_berkeley/bdb_lib.c
@@ -543,6 +543,20 @@ void bdblib_log(int op, table_p _tp, char* _msg, int len)
}
/**
+ * The function is called to create a handle to a db table.
+ *
+ * On startup, we do not create any of the db handles.
+ * Instead it is done on first-use (lazy-initialized) to only create handles to
+ * files (db) that we require.
+ *
+ * There is one db file per openser table (eg. acc), and they should exist
+ * in your DB_PATH (refer to openserctlrc) directory.
+ *
+ * This function does _not_ create the underlying binary db tables.
+ * Creating the tables MUST be manually performed before
+ * openser startup by 'openserdbctl create'
+ *
+ * Function returns NULL on error, which will cause openser to exit.
*
*/
table_p bdblib_create_table(database_p _db, str *_s)
@@ -581,12 +595,12 @@ table_p bdblib_create_table(database_p _db, str *_s)
LM_DBG("CREATE TABLE = %s\n", tblname);
#endif
- flags = DB_CREATE | DB_THREAD;
+ flags = DB_THREAD;
if ((rc = bdb->open(bdb, NULL, tblname, NULL, DB_HASH, flags, 0664)) != 0)
{
_db->dbenv->err(_db->dbenv, rc, "DB->open: %s", tblname);
- LM_ERR("bdb open: %s.\n",db_strerror(rc));
+ LM_ERR("bdb open failed: %s.\n",db_strerror(rc));
pkg_free(tp);
return NULL;
}
[View Less]
Module: sip-router
Branch: janakj/oracle
Commit: 23f036db07bc32a7e2ca4ab96902c2f4335f63bf
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=23f036d…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Sun Feb 15 14:35:34 2009 +0100
Merge branch 'master' of ssh://git.sip-router.org/sip-router into oracle
* 'master' of ssh://git.sip-router.org/sip-router:
libsrdb1: futex warning fix
- port from kamailio trunk, r5607
- …
[View More]sync transformations add/lookup with kamailio
init_mi_core() exported via mi.h
mi include file
MI: core part
script parsing: while support
script engine: while() support
script engine: switch() and break execution
script engine: switch() fixup and optimizations
script parsing: C style switch() & case support
expr engine: minor additions
---
[View Less]
Module: sip-router
Branch: janakj/oracle
Commit: f25b29befa559e3fb58c64a54fa43a550e269a3c
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f25b29b…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Sun Feb 15 13:57:41 2009 +0100
Merge commit 'or/cvshead' into oracle
* commit 'or/cvshead':
Get rid of compilation warnings emitted by
- oracle module moved from experimental to the main tree
---
Module: sip-router
Branch: janakj/oracle
Commit: 9cdb3c3997c66e04a447bf6ba19d7d3ef7ff67e1
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9cdb3c3…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Fri Feb 16 15:35:16 2007 +0000
- oracle module moved from experimental to the main tree
- libs and includes configured to match locations provided
by oracle-xe-client package (the original paths are commented)
- removed …
[View More]redefinition of ERR and DBG
- fixed tracker location in common.h
---
[View Less]
This was me, there was a bug in the commit mail script which I hopefully
fixed.
I updated the master branch and added both versions of the database API. The
database library of SER 2.0 is in lib/srdb2, the database library of kamailio
is in lib/srdb1. There is the full history of the kamailio database library,
that's why there is so many commit messages in the previous email.
I had to do some changes in the database library taken from kamailio in order
to avoid conflicts between the two …
[View More]version, the changes are:
1) db_con_t has been renamed to db1_con_t
2) db_res_t has been renamed to db1_res_t
3) DB_INT, DB_STR,... macros have been renamed to DB1_INT, DB1_STR,...
4) The doxygen group db has been renamed to db1.
All the changes have been applied to the kamailio database library
synchronized yesterday, here is how you can get patches with the changes that
I did if you need them:
$ git-format-patch -o patches 18580
I also attached them to this email for your convenience, they should apply to
the current kamailio/db after stripping the path prefix off (patch option -p).
I will send a script to update other modules later tomorrow and also upload
the updated mysql driver which works with both versions of the database
library (i.e. that module should work with both ser and kamailio).
Jan.
On 12-02 23:25, sr-dev-owner(a)lists.sip-router.org wrote:
> As list administrator, your authorization is requested for the
> following mailing list posting:
>
> List: sr-dev(a)lists.sip-router.org
> From: new(a)sip-router.org
> Subject: text/plain; charset=UTF-8
> Reason: Post by non-member to a members-only list
>
> At your convenience, visit:
>
> http://lists.sip-router.org/cgi-bin/mailman/admindb/sr-dev
>
> to approve or deny the request.
> Date: Thu, 12 Feb 2009 23:25:34 +0100 (CET)
> From: New(a)sip-router.org, commits(a)sip-router.org, on(a)sip-router.org,
> branch(a)sip-router.org, master(a)sip-router.org
> Subject: text/plain; charset=UTF-8
> To: sr-dev(a)lists.sip-router.org
>
> From: sr-dev-request(a)lists.sip-router.org
> Subject: confirm af3499ce3479bf6be60ee69ed389474e0ddabf1c
>
> If you reply to this message, keeping the Subject: header intact,
> Mailman will discard the held message. Do this if the message is
> spam. If you reply to this message and include an Approved: header
> with the list password in it, the message will be approved for posting
> to the list. The Approved: header can also appear in the first line
> of the body of the reply.
[View Less]