[asterisk-commits] twilson: branch twilson/sqlite_astdb r323514 - in /team/twilson/sqlite_astdb:...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 15 00:22:58 CDT 2011


Author: twilson
Date: Wed Jun 15 00:22:52 2011
New Revision: 323514

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=323514
Log:
Make the db conversion a standalone utility

Added:
    team/twilson/sqlite_astdb/utils/astdb2sqlite3.c   (with props)
    team/twilson/sqlite_astdb/utils/db1-ast/
      - copied from r323368, team/twilson/sqlite_astdb/main/db1-ast/
Removed:
    team/twilson/sqlite_astdb/main/db1-ast/
Modified:
    team/twilson/sqlite_astdb/main/Makefile
    team/twilson/sqlite_astdb/main/db.c
    team/twilson/sqlite_astdb/utils/   (props changed)
    team/twilson/sqlite_astdb/utils/Makefile
    team/twilson/sqlite_astdb/utils/db1-ast/mpool/mpool.c
    team/twilson/sqlite_astdb/utils/utils.xml

Modified: team/twilson/sqlite_astdb/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/twilson/sqlite_astdb/main/Makefile?view=diff&rev=323514&r1=323513&r2=323514
==============================================================================
--- team/twilson/sqlite_astdb/main/Makefile (original)
+++ team/twilson/sqlite_astdb/main/Makefile Wed Jun 15 00:22:52 2011
@@ -111,9 +111,6 @@
 editline/libedit.a: CHECK_SUBDIR
 	cd editline && test -f config.h || CFLAGS="$(PTHREAD_CFLAGS) $(subst $(ASTTOPDIR),../../,$(_ASTCFLAGS:-Werror=) $(ASTCFLAGS))" LDFLAGS="$(_ASTLDFLAGS) $(ASTLDFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-ncurses=$(NCURSES_DIR) --with-curses=$(CURSES_DIR) --with-termcap=$(TERMCAP_DIR) --with-tinfo=$(TINFO_DIR)
 	$(MAKE) -C editline libedit.a
-
-db1-ast/libdb1.a: CHECK_SUBDIR
-	_ASTCFLAGS="$(_ASTCFLAGS) -Wno-strict-aliasing" ASTCFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
 
 ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
 ast_expr2.c ast_expr2.h: ast_expr2.y
@@ -180,13 +177,13 @@
 
 $(OBJS): _ASTCFLAGS+=-DAST_MODULE=\"core\"
 
-$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
+$(MAIN_TGT): $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS)
 	@$(CC) -c -o buildinfo.o $(_ASTCFLAGS) buildinfo.c $(ASTCFLAGS)
-	$(ECHO_PREFIX) echo "   [LD] $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) -> $@"
+	$(ECHO_PREFIX) echo "   [LD] $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS) -> $@"
 ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
-	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
-else
-	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
+	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
+else
+	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
 endif
 
 ifeq ($(GNU_LD),1)
@@ -197,9 +194,7 @@
 
 clean::
 	rm -f asterisk
-	rm -f db1-ast/.*.d
 	rm -f asterisk.exports
 	@if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
-	@$(MAKE) -C db1-ast clean
 	@$(MAKE) -C stdtime clean
 	rm -f libresample/src/*.o

Modified: team/twilson/sqlite_astdb/main/db.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/sqlite_astdb/main/db.c?view=diff&rev=323514&r1=323513&r2=323514
==============================================================================
--- team/twilson/sqlite_astdb/main/db.c (original)
+++ team/twilson/sqlite_astdb/main/db.c Wed Jun 15 00:22:52 2011
@@ -49,7 +49,6 @@
 #include "asterisk/cli.h"
 #include "asterisk/utils.h"
 #include "asterisk/manager.h"
-#include "db1-ast/include/db.h"
 
 /*** DOCUMENTATION
 	<manager name="DBGet" language="en_US">
@@ -150,59 +149,16 @@
 	|| init_stmt(&put_stmt, put_stmt_sql, sizeof(put_stmt_sql));
 }
 
-static int db_put_raw(const char *key, size_t keylen, const char *value, size_t valuelen)
-{
-	int res = 0;
-
-	ast_mutex_lock(&dblock);
-	if (sqlite3_bind_text(put_stmt, 1, key, keylen, SQLITE_STATIC) != SQLITE_OK) {
-		ast_log(LOG_WARNING, "Couldn't bind key to stmt: %s\n", sqlite3_errmsg(astdb));
-		res = -1;
-	} else if (sqlite3_bind_text(put_stmt, 2, value, valuelen, SQLITE_STATIC) != SQLITE_OK) {
-		ast_log(LOG_WARNING, "Couldn't bind value to stmt: %s\n", sqlite3_errmsg(astdb));
-		res = -1;
-	} else if (sqlite3_step(put_stmt) != SQLITE_DONE) {
-		ast_log(LOG_WARNING, "Couldn't execute statment: %s\n", sqlite3_errmsg(astdb));
-		res = -1;
-	}
-	sqlite3_reset(put_stmt);
-	db_sync();
-	ast_mutex_unlock(&dblock);
+static int convert_bdb_to_sqlite3(void)
+{
+	char *cmd;
+	int res;
+
+	ast_asprintf(&cmd, "astdb2sqlite3 %s\n", ast_config_AST_DB);
+	res = ast_safe_system(cmd);
+	ast_free(cmd);
 
 	return res;
-}
-
-static int convert_bdb_to_sqlite3(const char *sql3_dbname)
-{
-	DB *bdb;
-	DBT key = { 0, }, value = { 0, }, last_key = { 0, };
-	int res, last = 0;
-	char last_key_s[MAX_DB_FIELD];
-
-	if (!(bdb = dbopen(ast_config_AST_DB, O_RDONLY, AST_FILE_MODE, DB_BTREE, NULL))) {
-		ast_log(LOG_WARNING, "Unable to open Asterisk database '%s': %s\n", ast_config_AST_DB, strerror(errno));
-		return -1;
-	}
-
-	if (bdb->seq(bdb, &last_key, &value, R_LAST)) {
-		/* Empty database */
-		return 0;
-	}
-
-	memcpy(last_key_s, last_key.data, MIN(last_key.size - 1, sizeof(last_key_s)));
-	last_key_s[last_key.size - 1] = '\0';
-	for (res = bdb->seq(bdb, &key, &value, R_FIRST);
-			!res; res = bdb->seq(bdb, &key, &value, R_NEXT)) {
-		last = !strcmp(key.data, last_key_s);
-		db_put_raw((const char *) key.data, key.size, (const char *) value.data, value.size);
-		if (last) {
-			break;
-		}
-	}
-
-	bdb->close(bdb);
-
-	return 0;
 }
 
 static int db_create_astdb(void)
@@ -229,14 +185,21 @@
 {
 	char *dbname;
 	struct stat dont_care;
-	int convert;
+
 	if (!(dbname = alloca(strlen(ast_config_AST_DB) + sizeof(".sqlite3")))) {
 		return -1;
 	}
 	strcpy(dbname, ast_config_AST_DB);
 	strcat(dbname, ".sqlite3");
 
-	convert = stat(dbname, &dont_care) && !stat(ast_config_AST_DB, &dont_care);
+	if (stat(dbname, &dont_care) && !stat(ast_config_AST_DB, &dont_care)) {
+		if (convert_bdb_to_sqlite3()) {
+			ast_log(LOG_WARNING, "Database conversion failed!\n");
+		} else {
+			ast_log(LOG_NOTICE, "Database conversion succeeded!\n");
+		}
+	}
+
 
 	ast_mutex_lock(&dblock);
 	if (sqlite3_open_v2(dbname, &astdb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX, NULL) != SQLITE_OK) {
@@ -247,17 +210,6 @@
 	}
 	ast_mutex_unlock(&dblock);
 
-	if (convert) {
-		/* We didn't have an sqlite3 version of the database, but we had a BDB version */
-		ast_log(LOG_WARNING, "Converting old astdb to sqlite3!\n");
-		if (db_create_astdb() || init_statements()) {
-			return -1;
-		}
-		if (!convert_bdb_to_sqlite3(dbname)) {
-			ast_log(LOG_WARNING, "Database conversion succeeded!\n");
-		}
-	}
-
 	return 0;
 }
 
@@ -312,6 +264,7 @@
 {
 	char fullkey[MAX_DB_FIELD];
 	size_t fullkey_len;
+	int res = 0;
 
 	if (strlen(family) + strlen(key) + 2 > sizeof(fullkey) - 1) {
 		ast_log(LOG_WARNING, "Family and key length must be less than %zu bytes\n", sizeof(fullkey) - 3);
@@ -320,7 +273,23 @@
 
 	fullkey_len = snprintf(fullkey, sizeof(fullkey), "/%s/%s", family, key);
 
-	return db_put_raw(fullkey, fullkey_len, value, strlen(value) + 1);
+	ast_mutex_lock(&dblock);
+	if (sqlite3_bind_text(put_stmt, 1, key, fullkey_len, SQLITE_STATIC) != SQLITE_OK) {
+		ast_log(LOG_WARNING, "Couldn't bind key to stmt: %s\n", sqlite3_errmsg(astdb));
+		res = -1;
+	} else if (sqlite3_bind_text(put_stmt, 2, value, -1, SQLITE_STATIC) != SQLITE_OK) {
+		ast_log(LOG_WARNING, "Couldn't bind value to stmt: %s\n", sqlite3_errmsg(astdb));
+		res = -1;
+	} else if (sqlite3_step(put_stmt) != SQLITE_DONE) {
+		ast_log(LOG_WARNING, "Couldn't execute statment: %s\n", sqlite3_errmsg(astdb));
+		res = -1;
+	}
+
+	sqlite3_reset(put_stmt);
+	db_sync();
+	ast_mutex_unlock(&dblock);
+
+	return res;
 }
 
 int ast_db_get(const char *family, const char *key, char *value, int valuelen)

Propchange: team/twilson/sqlite_astdb/utils/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jun 15 00:22:52 2011
@@ -5,6 +5,7 @@
 aelbison.c
 aelparse
 aelparse.c
+astdb2sqlite3
 ast_expr2.c
 ast_expr2f.c
 astman

Modified: team/twilson/sqlite_astdb/utils/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/twilson/sqlite_astdb/utils/Makefile?view=diff&rev=323514&r1=323513&r2=323514
==============================================================================
--- team/twilson/sqlite_astdb/utils/Makefile (original)
+++ team/twilson/sqlite_astdb/utils/Makefile Wed Jun 15 00:22:52 2011
@@ -89,6 +89,8 @@
 	rm -f md5.c strcompat.c ast_expr2.c ast_expr2.h ast_expr2f.c pbx_ael.c pval.c hashtab.c lock.c
 	rm -f aelparse.c aelbison.c conf2ael
 	rm -f utils.c strings.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest refcounter
+	rm -f db1-ast/.*.d
+	@$(MAKE) -C db1-ast clean
 
 md5.c: $(ASTTOPDIR)/main/md5.c
 	$(ECHO_PREFIX) echo "   [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
@@ -206,6 +208,14 @@
 muted: LIBS+=$(AUDIO_LIBS)
 muted: _ASTCFLAGS:=$(filter-out -Werror,$(_ASTCFLAGS))
 
+CHECK_SUBDIR:	# do nothing, just make sure that we recurse in the subdir/
+db1-ast/libdb1.a: CHECK_SUBDIR
+	_ASTCFLAGS="$(_ASTCFLAGS) -Wno-strict-aliasing" ASTCFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
+
+astdb2sqlite3: LIBS+=$(SQLITE3_LIB)
+astdb2sqlite3: _ASTCFLAGS+=$(SQLITE3_INCLUDE)
+astdb2sqlite3: db1-ast/libdb1.a 
+
 ifneq ($(wildcard .*.d),)
    include .*.d
 endif

Added: team/twilson/sqlite_astdb/utils/astdb2sqlite3.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/sqlite_astdb/utils/astdb2sqlite3.c?view=auto&rev=323514
==============================================================================
--- team/twilson/sqlite_astdb/utils/astdb2sqlite3.c (added)
+++ team/twilson/sqlite_astdb/utils/astdb2sqlite3.c Wed Jun 15 00:22:52 2011
@@ -1,0 +1,228 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 1999 - 2005, Digium, Inc.
+ *
+ * Mark Spencer <markster at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief Berekeley DB to SQLite3 converter
+ *
+ * \author Terry Wilson <twilson at digium.com>
+ */
+
+#include "asterisk.h"
+
+//ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sqlite3.h>
+
+#include "db1-ast/include/db.h"
+
+#define MAX_DB_FIELD 256
+#define MIN(a,b) \
+({ typeof (a) _a = (a); \
+	typeof (b) _b = (b); \
+	a < _b ? _a : _b; })
+
+static sqlite3 *astdb;
+
+#define DEFINE_SQL_STATEMENT(stmt,sql) static sqlite3_stmt *stmt; \
+	const char stmt##_sql[] = sql;
+
+DEFINE_SQL_STATEMENT(put_stmt, "INSERT OR REPLACE INTO astdb (key, value) VALUES (?, ?)")
+DEFINE_SQL_STATEMENT(create_astdb_stmt, "CREATE TABLE IF NOT EXISTS astdb(key VARCHAR(256), value VARCHAR(256), PRIMARY KEY(key))")
+
+static int db_execute_transaction_sql(const char *sql)
+{
+	char *errmsg = NULL;
+	int res =0;
+
+	sqlite3_exec(astdb, sql, NULL, NULL, &errmsg);
+	if (errmsg) {
+		fprintf(stderr, "Error executing SQL: %s\n", errmsg);
+		sqlite3_free(errmsg);
+		res = -1;
+	}
+
+	return res;
+}
+
+static int ast_db_begin_transaction(void)
+{
+	return db_execute_transaction_sql("BEGIN TRANSACTION");
+}
+
+static int ast_db_commit_transaction(void)
+{
+	return db_execute_transaction_sql("COMMIT");
+}
+
+static int ast_db_rollback_transaction(void)
+{
+	return db_execute_transaction_sql("ROLLBACK");
+}
+
+static int db_put_raw(const char *key, size_t keylen, const char *value, size_t valuelen)
+{
+	int res = 0;
+
+	if (sqlite3_bind_text(put_stmt, 1, key, keylen, SQLITE_STATIC) != SQLITE_OK) {
+		fprintf(stderr, "Couldn't bind key to stmt: %s\n", sqlite3_errmsg(astdb));
+		res = -1;
+	} else if (sqlite3_bind_text(put_stmt, 2, value, valuelen, SQLITE_STATIC) != SQLITE_OK) {
+		fprintf(stderr, "Couldn't bind value to stmt: %s\n", sqlite3_errmsg(astdb));
+		res = -1;
+	} else if (sqlite3_step(put_stmt) != SQLITE_DONE) {
+		fprintf(stderr, "Couldn't execute statment: %s\n", sqlite3_errmsg(astdb));
+		res = -1;
+	}
+	sqlite3_reset(put_stmt);
+
+	return res;
+}
+
+static int convert_bdb_to_sqlite3(const char *bdb_dbname)
+{
+	DB *bdb;
+	DBT key = { 0, }, value = { 0, }, last_key = { 0, };
+	int res, last = 0;
+	char last_key_s[MAX_DB_FIELD];
+
+	if (!(bdb = dbopen(bdb_dbname, O_RDONLY, AST_FILE_MODE, DB_BTREE, NULL))) {
+		fprintf(stderr, "Unable to open Asterisk database '%s'\n", bdb_dbname);
+		return -1;
+	}
+
+	if (bdb->seq(bdb, &last_key, &value, R_LAST)) {
+		/* Empty database */
+		return 0;
+	}
+
+	memcpy(last_key_s, last_key.data, MIN(last_key.size - 1, sizeof(last_key_s)));
+	last_key_s[last_key.size - 1] = '\0';
+	for (res = bdb->seq(bdb, &key, &value, R_FIRST);
+			!res; res = bdb->seq(bdb, &key, &value, R_NEXT)) {
+		last = !strcmp(key.data, last_key_s);
+		db_put_raw((const char *) key.data, key.size, (const char *) value.data, value.size);
+		if (last) {
+			break;
+		}
+	}
+
+	bdb->close(bdb);
+
+	return 0;
+}
+
+static int init_stmt(sqlite3_stmt **stmt, const char *sql, size_t len)
+{
+	if (sqlite3_prepare_v2(astdb, sql, len, stmt, NULL) != SQLITE_OK) {
+		fprintf(stderr, "Couldn't prepare statement '%s': %s\n", sql, sqlite3_errmsg(astdb));
+		return -1;
+	}
+
+	return 0;
+}
+
+static int db_create_astdb(void)
+{
+	if (init_stmt(&create_astdb_stmt, create_astdb_stmt_sql, sizeof(create_astdb_stmt_sql))) {
+		return -1;
+	}
+
+	ast_db_begin_transaction();
+	if (sqlite3_step(create_astdb_stmt) != SQLITE_DONE) {
+		fprintf(stderr, "Couldn't create astdb table: %s\n", sqlite3_errmsg(astdb));
+		ast_db_rollback_transaction();
+		sqlite3_reset(create_astdb_stmt);
+		return -1;
+	}
+
+	ast_db_commit_transaction();
+	sqlite3_reset(create_astdb_stmt);
+
+	return 0;
+}
+
+static int init_statements(void)
+{
+	/* Don't initialize create_astdb_statment here as the astdb table needs to exist
+	 * brefore these statments can be initialized */
+	return init_stmt(&put_stmt, put_stmt_sql, sizeof(put_stmt_sql));
+}
+
+static int db_open(const char *dbname)
+{
+	if (sqlite3_open_v2(dbname, &astdb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX, NULL) != SQLITE_OK) {
+		fprintf(stderr, "Unable to open Asterisk database '%s': %s\n", dbname, sqlite3_errmsg(astdb));
+		sqlite3_close(astdb);
+		return -1;
+	}
+
+	return 0;
+}
+
+static int sql_db_init(const char *dbname)
+{
+	if (db_open(dbname) || db_create_astdb() || init_statements()) {
+		return -1;
+	}
+
+	return 0;
+}
+
+int main(int argc, char *argv[])
+{
+	char *dbname;
+	struct stat dont_care;
+
+	if (argc != 2) {
+		fprintf(stderr, "%s takes the path of astdb as its only argument\n", basename(argv[0]));
+		exit(-1);
+	}
+
+	if (stat(argv[1], &dont_care)) {
+		fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno));
+		exit(-1);
+	}
+
+	if (!(dbname = alloca(strlen(argv[1]) + sizeof(".sqlite3")))) {
+		exit(-1);
+	}
+
+	strcpy(dbname, argv[1]);
+	strcat(dbname, ".sqlite3");
+
+	if (!stat(dbname, &dont_care)) {
+		fprintf(stderr, "%s already exists!\n", dbname);
+		exit(-1);
+	}
+
+	if (sql_db_init(dbname)) {
+		exit(-1);
+	}
+
+	if (convert_bdb_to_sqlite3(argv[1])) {
+		fprintf(stderr, "Database conversion failed!\n");
+		exit(-1);
+	}
+
+	return 0;
+}

Propchange: team/twilson/sqlite_astdb/utils/astdb2sqlite3.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/twilson/sqlite_astdb/utils/astdb2sqlite3.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/twilson/sqlite_astdb/utils/astdb2sqlite3.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/twilson/sqlite_astdb/utils/db1-ast/mpool/mpool.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/sqlite_astdb/utils/db1-ast/mpool/mpool.c?view=diff&rev=323514&r1=323368&r2=323514
==============================================================================
--- team/twilson/sqlite_astdb/utils/db1-ast/mpool/mpool.c (original)
+++ team/twilson/sqlite_astdb/utils/db1-ast/mpool/mpool.c Wed Jun 15 00:22:52 2011
@@ -31,8 +31,6 @@
  * SUCH DAMAGE.
  */
 
-#include "asterisk.h"
-
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)mpool.c	8.5 (Berkeley) 7/26/94";
 #endif /* LIBC_SCCS and not lint */
@@ -48,8 +46,6 @@
 #include <unistd.h>
 
 #include "../include/db.h"
-
-#include "asterisk/utils.h"
 
 #define	__MPOOLINTERFACE_PRIVATE
 #include <mpool.h>
@@ -384,7 +380,7 @@
 			return (bp);
 		}
 
-new:	if ((bp = (BKT *) ast_calloc(1, sizeof(BKT) + mp->pagesize)) == NULL)
+new:	if ((bp = (BKT *) calloc(1, sizeof(BKT) + mp->pagesize)) == NULL)
 		return (NULL);
 #ifdef STATISTICS
 	++mp->pagealloc;

Modified: team/twilson/sqlite_astdb/utils/utils.xml
URL: http://svnview.digium.com/svn/asterisk/team/twilson/sqlite_astdb/utils/utils.xml?view=diff&rev=323514&r1=323513&r2=323514
==============================================================================
--- team/twilson/sqlite_astdb/utils/utils.xml (original)
+++ team/twilson/sqlite_astdb/utils/utils.xml Wed Jun 15 00:22:52 2011
@@ -3,6 +3,9 @@
 	<defaultenabled>no</defaultenabled>
   </member>
   <member name="astcanary">
+	<defaultenabled>yes</defaultenabled>
+  </member>
+  <member name="astdb2sqlite3">
 	<defaultenabled>yes</defaultenabled>
   </member>
   <member name="astman">




More information about the asterisk-commits mailing list