aboutsummaryrefslogtreecommitdiffstats
path: root/configs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-23 16:19:21 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-23 16:19:21 +0000
commit6bb04df2e6f7377453ef49c4263bf1ab27a542bb (patch)
tree538275561397978c5e939125a8d73d7633159867 /configs
parent30dfe48aa733d962aacea312e9ee308e30b1c749 (diff)
Merge the realtime failover branch
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278957 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configs')
-rw-r--r--configs/extconfig.conf.sample16
-rw-r--r--configs/res_odbc.conf.sample69
2 files changed, 75 insertions, 10 deletions
diff --git a/configs/extconfig.conf.sample b/configs/extconfig.conf.sample
index 32ec6ad63..bde5d1268 100644
--- a/configs/extconfig.conf.sample
+++ b/configs/extconfig.conf.sample
@@ -9,7 +9,7 @@
;
; Static configuration files:
;
-; file.conf => driver,database[,table]
+; file.conf => driver,database[,table[,priority]]
;
; maps a particular configuration file to the given
; database driver, database and table (or uses the
@@ -40,14 +40,26 @@
; database and table (or uses the name of
; the family if the table is not specified
;
-;example => odbc,asterisk,alttable
+;example => odbc,asterisk,alttable,1
+;example => mysql,asterisk,alttable,2
;example2 => ldap,"dc=oxymium,dc=net",example2
;
+; Additionally, priorities are now supported for use as failover methods
+; for retrieving realtime data. If one connection fails to retrieve any
+; information, the next sequential priority will be tried next. This
+; especially works well with ODBC connections, since res_odbc now caches
+; when connection failures occur and prevents immediately retrying those
+; connections until after a specified timeout. Note: priorities must
+; start at 1 and be sequential (i.e. if you have only priorities 1, 2,
+; and 4, then 4 will be ignored, because there is no 3).
+;
; "odbc" is shown in the examples below, but is not the only valid realtime
; engine. There is:
; odbc ... res_config_odbc
; sqlite ... res_config_sqlite
; pgsql ... res_config_pgsql
+; curl ... res_config_curl
+; ldap ... res_config_ldap
;
;iaxusers => odbc,asterisk
;iaxpeers => odbc,asterisk
diff --git a/configs/res_odbc.conf.sample b/configs/res_odbc.conf.sample
index 8af0b9917..2980bad68 100644
--- a/configs/res_odbc.conf.sample
+++ b/configs/res_odbc.conf.sample
@@ -10,18 +10,69 @@
; All other sections are arbitrary names for database connections.
+;
+; The context name is what will be used in other configuration files, such
+; as extconfig.conf and func_odbc.conf, to reference this connection.
[asterisk]
+;
+; Permit disabling sections without needing to comment them out.
+; If not specified, it is assumed the section is enabled.
enabled => no
+;
+; This value should match an entry in /etc/odbc.ini
+; (or /usr/local/etc/odbc.ini, on FreeBSD and similar systems).
dsn => asterisk
+;
+; Username for connecting to the database. The default user is "root".
;username => myuser
+;
+; Password for authenticating the user to the database. The default
+; password is blank.
;password => mypass
+;
+; Build a connection at startup?
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".
;sanitysql => select 1
-
+;
+; On some databases, the connection times out and a reconnection will be
+; necessary. This setting configures the amount of time a connection
+; may sit idle (in seconds) before a reconnection will be attempted.
+;idlecheck => 3600
+;
+; Should we use a single connection for all queries? Most databases will
+; allow sharing the connection, though Sybase and MS SQL Server will not.
+;share_connections => yes
+;
+; If we aren't sharing connections, what is the maximum number of connections
+; that we should attempt?
+;limit => 5
+;
+; When the channel is destroyed, should any uncommitted open transactions
+; automatically be committed?
+;forcecommit => no
+;
+; How should we perceive data in other transactions within the database?
+; Possible values are read_uncommitted, read_committed, repeatable_read,
+; and serializable. The default is read_committed.
+;isolation => repeatable_read
+;
+; Is the backslash a native escape character? The default is yes, but for
+; MS SQL Server, the answer is no.
+;backslash_is_escape => yes
+;
+; How long (in seconds) should we attempt to connect before considering the
+; connection dead? The default is 10 seconds, but you may wish to reduce it,
+; to increase responsiveness.
+;connect_timeout => 10
+;
+; When a connection fails, how long (in seconds) should we cache that
+; information before we attempt another connection? This increases
+; responsiveness, when a database resource is not working.
+;negative_connection_cache => 300
[mysql2]
enabled => no
@@ -29,11 +80,6 @@ dsn => MySQL-asterisk
username => myuser
password => mypass
pre-connect => yes
-;
-; On some databases, the connection times out and a reconnection will be
-; necessary. This setting configures the amount of time a connection
-; may sit idle (in seconds) before a reconnection will be attempted.
-;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 telling res_odbc
@@ -64,5 +110,12 @@ sanitysql => select count(*) from systables
; Server does not.
backslash_is_escape => no
-
-
+;
+; If you are having problems with concurrency, please read this note from the
+; mailing lists, regarding UnixODBC:
+;
+; http://lists.digium.com/pipermail/asterisk-dev/2009-February/036539.html
+;
+; In summary, try setting "Threading=2" in the relevant section within your
+; odbcinst.ini.
+;