[asterisk-commits] oej: branch oej/adb-codename-appleraisin r177533 - /team/oej/adb-codename-app...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Feb 19 15:15:28 CST 2009
Author: oej
Date: Thu Feb 19 15:15:27 2009
New Revision: 177533
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=177533
Log:
Various updates
Modified:
team/oej/adb-codename-appleraisin/main/db.c
Modified: team/oej/adb-codename-appleraisin/main/db.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/adb-codename-appleraisin/main/db.c?view=diff&rev=177533&r1=177532&r2=177533
==============================================================================
--- team/oej/adb-codename-appleraisin/main/db.c (original)
+++ team/oej/adb-codename-appleraisin/main/db.c Thu Feb 19 15:15:27 2009
@@ -58,11 +58,11 @@
#define dbopen __dbopen
#endif
static int db_rt; /*!< Flag for realtime system */
-static char *db_rt_rtfamily = "astdb"; /*!< Realtime name tag */
-static char *db_rt_value = "value"; /*!< Database field name for values */
-static char *db_rt_family = "family"; /*!< Database field name for family */
-static char *db_rt_key = "keyname"; /*!< Database field name for key */
-static char *db_rt_sysnamelabel = "systemname"; /*!< Database field name for system name */
+static const char *db_rt_rtfamily = "astdb"; /*!< Realtime name tag */
+static const char *db_rt_value = "value"; /*!< Database field name for values */
+static const char *db_rt_family = "family"; /*!< Database field name for family */
+static const char *db_rt_key = "keyname"; /*!< Database field name for key */
+static const char *db_rt_sysnamelabel = "systemname"; /*!< Database field name for system name */
static const char *db_rt_sysname; /*!< From asterisk.conf or "asterisk" */
@@ -105,7 +105,7 @@
const char *cat = NULL;
char buf[512];
- ast_log(LOG_DEBUG, ">>>>>> getall family: %s Key %s \n", family, key);
+ ast_log(LOG_DEBUG, ">>>>>> getall family: %s Key %s \n", S_OR(family,"-na-"), S_OR(key,"-na-"));
if (ast_strlen_zero(family)) {
/* Load all entries in the astdb */
@@ -777,13 +777,15 @@
int astdb_init(void)
{
- /* Check if we have realtime astdb enabled */
- db_rt = ast_check_realtime("astdb");
- if (!db_rt) {
- dbinit();
- } else {
- ast_log(LOG_DEBUG, "***** Kör ASTDB i realtime mode! ******************\n");
- }
+ /* When this routine is run, the realtime modules are not loaded so we can't initialize realtime yet. */
+ db_rt = 0;
+
+ /* If you have multiple systems using the same database, set the systemname in asterisk.conf */
+ db_rt_sysname = S_OR(ast_config_AST_SYSTEM_NAME, "asterisk");
+
+ /* initialize astdb or realtime */
+ dbinit();
+
ast_cli_register_multiple(cli_database, sizeof(cli_database) / sizeof(struct ast_cli_entry));
ast_manager_register("DBGet", EVENT_FLAG_SYSTEM, manager_dbget, "Get DB Entry");
ast_manager_register("DBPut", EVENT_FLAG_SYSTEM, manager_dbput, "Put DB Entry");
More information about the asterisk-commits
mailing list