[svn-commits] tilghman: branch 1.8 r284096 - in /branches/1.8: cel/ configs/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Aug 28 21:51:16 CDT 2010


Author: tilghman
Date: Sat Aug 28 21:51:14 2010
New Revision: 284096

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=284096
Log:
Rename CEL adaptive driver to plain driver, since there isn't another ODBC driver
(and the other CEL drivers have adaptive capabilities, anyway).

Added:
    branches/1.8/cel/cel_odbc.c   (contents, props changed)
      - copied, changed from r283769, branches/1.8/cel/cel_adaptive_odbc.c
    branches/1.8/configs/cel_odbc.conf.sample   (props changed)
      - copied unchanged from r283769, branches/1.8/configs/cel_adaptive_odbc.conf.sample
Removed:
    branches/1.8/cel/cel_adaptive_odbc.c
    branches/1.8/configs/cel_adaptive_odbc.conf.sample

Copied: branches/1.8/cel/cel_odbc.c (from r283769, branches/1.8/cel/cel_adaptive_odbc.c)
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/cel/cel_odbc.c?view=diff&rev=284096&p1=branches/1.8/cel/cel_adaptive_odbc.c&r1=283769&p2=branches/1.8/cel/cel_odbc.c&r2=284096
==============================================================================
--- branches/1.8/cel/cel_adaptive_odbc.c (original)
+++ branches/1.8/cel/cel_odbc.c Sat Aug 28 21:51:14 2010
@@ -4,7 +4,7 @@
  * Copyright (C) 2008 Digium
  *
  * Adapted from cdr_adaptive_odbc:
- * Tilghman Lesher <cdr_adaptive_odbc__v1 at the-tilghman.com>
+ * Tilghman Lesher <tlesher AT digium DOT com>
  * by Steve Murphy
  *
  * See http://www.asterisk.org for more information about
@@ -20,9 +20,9 @@
 
 /*! \file
  *
- * \brief Adaptive ODBC CEL backend
+ * \brief ODBC CEL backend
  *
- * \author Tilghman Lesher <cdr_adaptive_odbc__v1 at the-tilghman.com>
+ * \author Tilghman Lesher <tlesher AT digium DOT com>
  * \ingroup cel_drivers
  */
 
@@ -49,7 +49,7 @@
 #include "asterisk/cel.h"
 #include "asterisk/module.h"
 
-#define	CONFIG	"cel_adaptive_odbc.conf"
+#define	CONFIG	"cel_odbc.conf"
 static struct ast_event_sub *event_sub = NULL;
 
 /* Optimization to reduce number of memory allocations */
@@ -98,7 +98,7 @@
 
 	cfg = ast_config_load(CONFIG, config_flags);
 	if (!cfg || cfg == CONFIG_STATUS_FILEINVALID) {
-		ast_log(LOG_WARNING, "Unable to load " CONFIG ".  No adaptive ODBC CEL records!\n");
+		ast_log(LOG_WARNING, "Unable to load " CONFIG ".  No ODBC CEL records!\n");
 		return -1;
 	}
 
@@ -160,7 +160,7 @@
 		ast_copy_string(tableptr->connection, connection, lenconnection + 1);
 		ast_copy_string(tableptr->table, table, lentable + 1);
 
-		ast_verb(3, "Found adaptive CEL table %s@%s.\n", tableptr->table, tableptr->connection);
+		ast_verb(3, "Found CEL table %s@%s.\n", tableptr->table, tableptr->connection);
 
 		/* Check for filters first */
 		for (var = ast_variable_browse(cfg, catg); var; var = var->next) {
@@ -381,7 +381,7 @@
 
 		/* No need to check the connection now; we'll handle any failure in prepare_and_execute */
 		if (!(obj = ast_odbc_request_obj(tableptr->connection, 0))) {
-			ast_log(LOG_WARNING, "cel_adaptive_odbc: Unable to retrieve database handle for '%s:%s'.  CEL failed: %s\n", tableptr->connection, tableptr->table, ast_str_buffer(sql));
+			ast_log(LOG_WARNING, "Unable to retrieve database handle for '%s:%s'.  CEL failed: %s\n", tableptr->connection, tableptr->table, ast_str_buffer(sql));
 			continue;
 		}
 
@@ -571,7 +571,9 @@
 					}
 					break;
 				case SQL_INTEGER:
-					{
+					if (ast_strlen_zero(colptr)) {
+						continue;
+					} else {
 						int integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (int) record.event_type;
@@ -588,7 +590,9 @@
 					}
 					break;
 				case SQL_BIGINT:
-					{
+					if (ast_strlen_zero(colptr)) {
+						continue;
+					} else {
 						long long integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (long long) record.event_type;
@@ -605,7 +609,9 @@
 					}
 					break;
 				case SQL_SMALLINT:
-					{
+					if (ast_strlen_zero(colptr)) {
+						continue;
+					} else {
 						short integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (short) record.event_type;
@@ -622,7 +628,9 @@
 					}
 					break;
 				case SQL_TINYINT:
-					{
+					if (ast_strlen_zero(colptr)) {
+						continue;
+					} else {
 						char integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (char) record.event_type;
@@ -639,7 +647,9 @@
 					}
 					break;
 				case SQL_BIT:
-					{
+					if (ast_strlen_zero(colptr)) {
+						continue;
+					} else {
 						char integer = 0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							integer = (char) record.event_type;
@@ -659,7 +669,9 @@
 					break;
 				case SQL_NUMERIC:
 				case SQL_DECIMAL:
-					{
+					if (ast_strlen_zero(colptr)) {
+						continue;
+					} else {
 						double number = 0.0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							number = (double)record.event_type;
@@ -678,7 +690,9 @@
 				case SQL_FLOAT:
 				case SQL_REAL:
 				case SQL_DOUBLE:
-					{
+					if (ast_strlen_zero(colptr)) {
+						continue;
+					} else {
 						double number = 0.0;
 						if (strcasecmp(entry->name, "eventtype") == 0) {
 							number = (double) record.event_type;
@@ -716,7 +730,7 @@
 			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 		}
 		if (rows == 0) {
-			ast_log(LOG_WARNING, "cel_adaptive_odbc: Insert failed on '%s:%s'.  CEL failed: %s\n", tableptr->connection, tableptr->table, ast_str_buffer(sql));
+			ast_log(LOG_WARNING, "Insert failed on '%s:%s'.  CEL failed: %s\n", tableptr->connection, tableptr->table, ast_str_buffer(sql));
 		}
 early_release:
 		ast_odbc_release_obj(obj);
@@ -741,9 +755,9 @@
 		event_sub = ast_event_unsubscribe(event_sub);
 	}
 	if (AST_RWLIST_WRLOCK(&odbc_tables)) {
-		event_sub = ast_event_subscribe(AST_EVENT_CEL, odbc_log, "Adaptive ODBC CEL backend", NULL, AST_EVENT_IE_END);
+		event_sub = ast_event_subscribe(AST_EVENT_CEL, odbc_log, "ODBC CEL backend", NULL, AST_EVENT_IE_END);
 		if (!event_sub) {
-			ast_log(LOG_ERROR, "cel_adaptive_odbc: Unable to subscribe to CEL events\n");
+			ast_log(LOG_ERROR, "Unable to subscribe to CEL events\n");
 		}
 		ast_log(LOG_ERROR, "Unable to lock column list.  Unload failed.\n");
 		return -1;
@@ -762,9 +776,9 @@
 	}
 	load_config();
 	AST_RWLIST_UNLOCK(&odbc_tables);
-	event_sub = ast_event_subscribe(AST_EVENT_CEL, odbc_log, "Adaptive ODBC CEL backend", NULL, AST_EVENT_IE_END);
+	event_sub = ast_event_subscribe(AST_EVENT_CEL, odbc_log, "ODBC CEL backend", NULL, AST_EVENT_IE_END);
 	if (!event_sub) {
-		ast_log(LOG_ERROR, "cel_odbc: Unable to subscribe to CEL events\n");
+		ast_log(LOG_ERROR, "Unable to subscribe to CEL events\n");
 	}
 	return AST_MODULE_LOAD_SUCCESS;
 }
@@ -782,7 +796,7 @@
 	return AST_MODULE_LOAD_SUCCESS;
 }
 
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Adaptive ODBC CEL backend",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "ODBC CEL backend",
 	.load = load_module,
 	.unload = unload_module,
 	.reload = reload,

Propchange: branches/1.8/cel/cel_odbc.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/1.8/cel/cel_odbc.c
------------------------------------------------------------------------------
    svn:keywords = Author Id Date Revision

Propchange: branches/1.8/cel/cel_odbc.c
------------------------------------------------------------------------------
    svn:mergeinfo = /be/branches/C.3/cel/cel_adaptive_odbc.c:256426

Propchange: branches/1.8/cel/cel_odbc.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: branches/1.8/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/1.8/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
    svn:keywords = Author Id Date Revision

Propchange: branches/1.8/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
    svn:mergeinfo = /be/branches/C.3/configs/cel_adaptive_odbc.conf.sample:256426

Propchange: branches/1.8/configs/cel_odbc.conf.sample
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list