[asterisk-commits] eliel: branch eliel/data_api_providers_gsoc2010 r270263 - /team/eliel/data_ap...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 14 15:16:30 CDT 2010


Author: eliel
Date: Mon Jun 14 15:16:27 2010
New Revision: 270263

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=270263
Log:
Remove not needed level and add a transactional and isolation node.


Modified:
    team/eliel/data_api_providers_gsoc2010/res/res_odbc.c

Modified: team/eliel/data_api_providers_gsoc2010/res/res_odbc.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/res/res_odbc.c?view=diff&rev=270263&r1=270262&r2=270263
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/res/res_odbc.c (original)
+++ team/eliel/data_api_providers_gsoc2010/res/res_odbc.c Mon Jun 14 15:16:27 2010
@@ -1612,6 +1612,7 @@
 	struct odbc_class *class;
 	struct odbc_obj *current; 
 	struct ast_data *data_odbc_class, *data_odbc_connections, *data_odbc_connection;
+	struct ast_data *enum_node;
 	int count;
 
 	aoi = ao2_iterator_init(class_container, 0);
@@ -1635,7 +1636,15 @@
 			continue;
 		}
 
-		ast_data_add_bool(data_odbc_class, "pooled", class->haspool);
+		ast_data_add_bool(data_odbc_class, "shared", !class->haspool);
+		/* isolation */
+		enum_node = ast_data_add_node(data_odbc_class, "isolation");
+		if (!enum_node) {
+			ao2_ref(class, -1);
+			continue;
+		}
+		ast_data_add_int(enum_node, "value", class->isolation);
+		ast_data_add_str(enum_node, "text", isolation2text(class->isolation));
 
 		count = 0;
 		aoi2 = ao2_iterator_init(class->obj_container, 0);
@@ -1649,6 +1658,7 @@
 			ast_mutex_lock(&current->lock);
 			ast_data_add_str(data_odbc_connection, "status", current->used ? "in use" :
 					current->up && ast_odbc_sanity_check(current) ? "connected" : "disconnected");
+			ast_data_add_bool(data_odbc_connection, "transactional", current->tx);
 			ast_mutex_unlock(&current->lock);
 
 			if (class->haspool) {
@@ -1676,7 +1686,7 @@
 };
 
 static const struct ast_data_entry odbc_providers[] = {
-	AST_DATA_ENTRY("/asterisk/res/odbc/list", &odbc_provider),
+	AST_DATA_ENTRY("/asterisk/res/odbc", &odbc_provider),
 };
 
 static int reload(void)




More information about the asterisk-commits mailing list