aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configs/res_odbc.conf.sample12
-rw-r--r--res/res_odbc.c3
2 files changed, 13 insertions, 2 deletions
diff --git a/configs/res_odbc.conf.sample b/configs/res_odbc.conf.sample
index 59d5c68c3..2642676bf 100644
--- a/configs/res_odbc.conf.sample
+++ b/configs/res_odbc.conf.sample
@@ -24,7 +24,17 @@ username => myuser
password => mypass
pre-connect => yes
-
+; 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.
+[sqlserver]
+enabled => no
+dsn => mickeysoft
+pooling => yes
+limit => 5
+username => oscar
+password => thegrouch
+pre-connect => yes
diff --git a/res/res_odbc.c b/res/res_odbc.c
index 33836aa8d..e8f81ba4d 100644
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -235,7 +235,8 @@ static int load_odbc_config(void)
limit = 0;
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 (!strcasecmp(v->name, "limit")) {
sscanf(v->value, "%d", &limit);
if (ast_true(v->value) && !limit) {