[asterisk-commits] tilghman: trunk r101824 - in /trunk: configs/res_odbc.conf.sample res/res_odbc.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 1 12:08:44 CST 2008


Author: tilghman
Date: Fri Feb  1 12:08:44 2008
New Revision: 101824

URL: http://svn.digium.com/view/asterisk?view=rev&rev=101824
Log:
Clarify the pooling functionality by changing the config file keyword

Modified:
    trunk/configs/res_odbc.conf.sample
    trunk/res/res_odbc.c

Modified: trunk/configs/res_odbc.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/res_odbc.conf.sample?view=diff&rev=101824&r1=101823&r2=101824
==============================================================================
--- trunk/configs/res_odbc.conf.sample (original)
+++ trunk/configs/res_odbc.conf.sample Fri Feb  1 12:08:44 2008
@@ -4,8 +4,9 @@
 ; Note that all environmental variables can be seen by all connections,
 ; so you can't have different values for different connections.
 [ENV]
-INFORMIXSERVER => my_special_database
-INFORMIXDIR => /opt/informix
+;INFORMIXSERVER => my_special_database
+;INFORMIXDIR => /opt/informix
+;ORACLE_HOME => /home/oracle
 
 ; All other sections are arbitrary names for database connections.
 
@@ -15,6 +16,7 @@
 ;username => myuser
 ;password => mypass
 pre-connect => yes
+;
 ; What should we execute to ensure that our connection is still alive?  The
 ; statement should return a non-zero value in the first field of its first
 ; record.  The default is "select 1".
@@ -34,17 +36,18 @@
 ;idlecheck => 3600
 
 ; Certain servers, such as MS SQL Server and Sybase use the TDS protocol, which
-; limits the number of active queries per connection to 1.  By setting up pools
-; of connections, Asterisk can be made to work with these servers.
+; limits the number of active queries per connection to 1.  By telling res_odbc
+; not to share connections, Asterisk can be made to work with these servers.
 [sqlserver]
 enabled => no
 dsn => mickeysoft
-pooling => yes
+share_connections => no
 limit => 5
 username => oscar
 password => thegrouch
 pre-connect => yes
 sanitysql => select count(*) from systables
+;
 ; Many databases have a default of '\' to escape special characters.  MS SQL
 ; Server does not.
 backslash_is_escape => no

Modified: trunk/res/res_odbc.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_odbc.c?view=diff&rev=101824&r1=101823&r2=101824
==============================================================================
--- trunk/res/res_odbc.c (original)
+++ trunk/res/res_odbc.c Fri Feb  1 12:08:44 2008
@@ -262,6 +262,10 @@
 				if (!strcasecmp(v->name, "pooling")) {
 					if (ast_true(v->value))
 						pooling = 1;
+				} else if (!strncasecmp(v->name, "share", 5)) {
+					/* "shareconnections" is a little clearer in meaning than "pooling" */
+					if (ast_false(v->value))
+						pooling = 1;
 				} else if (!strcasecmp(v->name, "limit")) {
 					sscanf(v->value, "%d", &limit);
 					if (ast_true(v->value) && !limit) {
@@ -633,7 +637,12 @@
 				bse = 1;
 				for (v = ast_variable_browse(config, cat); v; v = v->next) {
 					if (!strcasecmp(v->name, "pooling")) {
-						pooling = 1;
+						if (ast_true(v->value))
+							pooling = 1;
+					} else if (!strncasecmp(v->name, "share", 5)) {
+						/* "shareconnections" is a little clearer in meaning than "pooling" */
+						if (ast_false(v->value))
+							pooling = 1;
 					} else if (!strcasecmp(v->name, "limit")) {
 						sscanf(v->value, "%d", &limit);
 						if (ast_true(v->value) && !limit) {




More information about the asterisk-commits mailing list