[asterisk-commits] seanbright: branch group/asterisk-cpp r169201 - in /team/group/asterisk-cpp: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 18 13:19:39 CST 2009


Author: seanbright
Date: Sun Jan 18 13:19:39 2009
New Revision: 169201

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=169201
Log:
The rest of the cdr/ modules compile now too.

Modified:
    team/group/asterisk-cpp/Makefile
    team/group/asterisk-cpp/cdr/cdr_pgsql.c
    team/group/asterisk-cpp/cdr/cdr_radius.c
    team/group/asterisk-cpp/cdr/cdr_sqlite.c
    team/group/asterisk-cpp/cdr/cdr_sqlite3_custom.c

Modified: team/group/asterisk-cpp/Makefile
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/Makefile?view=diff&rev=169201&r1=169200&r2=169201
==============================================================================
--- team/group/asterisk-cpp/Makefile (original)
+++ team/group/asterisk-cpp/Makefile Sun Jan 18 13:19:39 2009
@@ -294,7 +294,7 @@
 ASTCFLAGS+=$(MALLOC_DEBUG)$(OPTIONS)
 
 #MOD_SUBDIRS:=channels pbx apps codecs formats cdr funcs tests main res $(LOCAL_MOD_SUBDIRS)
-MOD_SUBDIRS:=main
+MOD_SUBDIRS:=cdr main
 OTHER_SUBDIRS:=
 SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)

Modified: team/group/asterisk-cpp/cdr/cdr_pgsql.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/cdr/cdr_pgsql.c?view=diff&rev=169201&r1=169200&r2=169201
==============================================================================
--- team/group/asterisk-cpp/cdr/cdr_pgsql.c (original)
+++ team/group/asterisk-cpp/cdr/cdr_pgsql.c Sun Jan 18 13:19:39 2009
@@ -52,8 +52,8 @@
 
 #define DATE_FORMAT "'%Y-%m-%d %T'"
 
-static char *name = "pgsql";
-static char *config = "cdr_pgsql.conf";
+static const char *name = "pgsql";
+static const char *config = "cdr_pgsql.conf";
 static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbport = NULL, *table = NULL;
 static int connected = 0;
 static int maxsize = 512, maxsize2 = 512;
@@ -500,7 +500,7 @@
 			fnotnull = PQgetvalue(result, i, 3);
 			fdef = PQgetvalue(result, i, 4);
 			ast_verb(4, "Found column '%s' of type '%s'\n", fname, ftype);
-			cur = ast_calloc(1, sizeof(*cur) + strlen(fname) + strlen(ftype) + 2);
+			cur = (struct columns *) ast_calloc(1, sizeof(*cur) + strlen(fname) + strlen(ftype) + 2);
 			if (cur) {
 				sscanf(flen, "%d", &cur->len);
 				cur->name = (char *)cur + sizeof(*cur);
@@ -533,9 +533,9 @@
 	return ast_cdr_register(name, ast_module_info->description, pgsql_log);
 }
 
-static int load_module(void)
+static enum ast_module_load_result load_module(void)
 {
-	return config_module(0) ? AST_MODULE_LOAD_DECLINE : 0;
+	return config_module(0) ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;
 }
 
 static int reload(void)
@@ -544,7 +544,7 @@
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "PostgreSQL CDR Backend",
-		.load = load_module,
-		.unload = unload_module,
-		.reload = reload,
-	       );
+				load_module,
+				unload_module,
+				reload
+	);

Modified: team/group/asterisk-cpp/cdr/cdr_radius.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/cdr/cdr_radius.c?view=diff&rev=169201&r1=169200&r2=169201
==============================================================================
--- team/group/asterisk-cpp/cdr/cdr_radius.c (original)
+++ team/group/asterisk-cpp/cdr/cdr_radius.c Sun Jan 18 13:19:39 2009
@@ -77,9 +77,9 @@
 	RADIUS_FLAG_LOGUSERFIELD = (1 << 2)
 };
 
-static char *desc = "RADIUS CDR Backend";
-static char *name = "radius";
-static char *cdr_config = "cdr.conf";
+static const char *desc = "RADIUS CDR Backend";
+static const char *name = "radius";
+static const char *cdr_config = "cdr.conf";
 
 static char radiuscfg[PATH_MAX] = "/etc/radiusclient-ng/radiusclient.conf";
 
@@ -164,12 +164,12 @@
 		return -1;
 
 	/* Disposition */
-	tmp = ast_cdr_disp2str(cdr->disposition);
+	tmp = (char *) ast_cdr_disp2str(cdr->disposition);
 	if (!rc_avpair_add(rh, tosend, PW_AST_DISPOSITION, tmp, strlen(tmp), VENDOR_CODE))
 		return -1;
 
 	/* AMA Flags */
-	tmp = ast_cdr_flags2str(cdr->amaflags);
+	tmp = (char *) ast_cdr_flags2str(cdr->amaflags);
 	if (!rc_avpair_add(rh, tosend, PW_AST_AMA_FLAGS, tmp, strlen(tmp), VENDOR_CODE))
 		return -1;
 
@@ -221,7 +221,7 @@
 	return 0;
 }
 
-static int load_module(void)
+static enum ast_module_load_result load_module(void)
 {
 	struct ast_config *cfg;
 	struct ast_flags config_flags = { 0 };
@@ -239,7 +239,7 @@
 		return AST_MODULE_LOAD_DECLINE;
 
 	/* start logging */
-	rc_openlog("asterisk");
+	rc_openlog((char *) "asterisk");
 
 	/* read radiusclient-ng config file */
 	if (!(rh = rc_read_config(radiuscfg))) {
@@ -248,7 +248,7 @@
 	}
 
 	/* read radiusclient-ng dictionaries */
-	if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary"))) {
+	if (rc_read_dictionary(rh, rc_conf_str(rh, (char *) "dictionary"))) {
 		ast_log(LOG_NOTICE, "Cannot load radiusclient-ng dictionary file.\n");
 		return AST_MODULE_LOAD_DECLINE;
 	}

Modified: team/group/asterisk-cpp/cdr/cdr_sqlite.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/cdr/cdr_sqlite.c?view=diff&rev=169201&r1=169200&r2=169201
==============================================================================
--- team/group/asterisk-cpp/cdr/cdr_sqlite.c (original)
+++ team/group/asterisk-cpp/cdr/cdr_sqlite.c Sun Jan 18 13:19:39 2009
@@ -55,7 +55,7 @@
 /* When you change the DATE_FORMAT, be sure to change the CHAR(19) below to something else */
 #define DATE_FORMAT "%Y-%m-%d %T"
 
-static char *name = "sqlite";
+static const char *name = "sqlite";
 static sqlite* db = NULL;
 
 AST_MUTEX_DEFINE_STATIC(sqlite_lock);
@@ -169,7 +169,7 @@
 	return 0;
 }
 
-static int load_module(void)
+static enum ast_module_load_result load_module(void)
 {
 	char *zErr;
 	char fn[PATH_MAX];
@@ -184,7 +184,7 @@
 	if (!db) {
 		ast_log(LOG_ERROR, "cdr_sqlite: %s\n", zErr);
 		ast_free(zErr);
-		return -1;
+		return AST_MODULE_LOAD_FAILURE;
 	}
 
 	/* is the table there? */
@@ -203,14 +203,14 @@
 	res = ast_cdr_register(name, ast_module_info->description, sqlite_log);
 	if (res) {
 		ast_log(LOG_ERROR, "Unable to register SQLite CDR handling\n");
-		return -1;
-	}
-	return 0;
+		return AST_MODULE_LOAD_FAILURE;
+	}
+	return AST_MODULE_LOAD_SUCCESS;
 
 err:
 	if (db)
 		sqlite_close(db);
-	return -1;
+	return AST_MODULE_LOAD_FAILURE;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SQLite CDR Backend");

Modified: team/group/asterisk-cpp/cdr/cdr_sqlite3_custom.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/cdr/cdr_sqlite3_custom.c?view=diff&rev=169201&r1=169200&r2=169201
==============================================================================
--- team/group/asterisk-cpp/cdr/cdr_sqlite3_custom.c (original)
+++ team/group/asterisk-cpp/cdr/cdr_sqlite3_custom.c Sun Jan 18 13:19:39 2009
@@ -56,8 +56,8 @@
 
 static const char config_file[] = "cdr_sqlite3_custom.conf";
 
-static char *desc = "Customizable SQLite3 CDR Backend";
-static char *name = "cdr_sqlite3_custom";
+static const char *desc = "Customizable SQLite3 CDR Backend";
+static const char *name = "cdr_sqlite3_custom";
 static sqlite3 *db = NULL;
 
 static char table[80];
@@ -133,7 +133,7 @@
 	while ((val = strsep(&vals, ","))) {
 		/* Strip the single quotes off if they are there */
 		val = ast_strip_quoted(val, "'", "'");
-		value = ast_calloc(sizeof(char), sizeof(*value) + strlen(val) + 1);
+		value = (struct values *) ast_calloc(sizeof(char), sizeof(*value) + strlen(val) + 1);
 		if (!value) {
 			ast_log(LOG_ERROR, "Out of memory creating entry for value '%s'\n", val);
 			ast_free(save);
@@ -237,7 +237,7 @@
 	int res = 0;
 	char *error = NULL;
 	char *sql = NULL;
-	struct ast_channel dummy = { 0, };
+	struct ast_channel dummy;
 	int count = 0;
 
 	{ /* Make it obvious that only sql should be used outside of this block */
@@ -291,7 +291,7 @@
 	return 0;
 }
 
-static int load_module(void)
+static enum ast_module_load_result load_module(void)
 {
 	char *error;
 	char filename[PATH_MAX];
@@ -335,7 +335,7 @@
 		}
 	}
 
-	return 0;
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int reload(void)
@@ -344,7 +344,7 @@
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "SQLite3 Custom CDR Module",
-	.load = load_module,
-	.unload = unload_module,
-	.reload = reload,
-);
+				load_module,
+				unload_module,
+				reload
+	);




More information about the asterisk-commits mailing list