aboutsummaryrefslogtreecommitdiffstats
path: root/configs/func_odbc.conf.sample
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-28 20:13:00 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-28 20:13:00 +0000
commit8d086303b6b45b76b9d2af3f86d62868283cf71e (patch)
tree3ca90ba7ea94cb2257b6b48cb1862bc0be717475 /configs/func_odbc.conf.sample
parent068fb38804250e64ced0d4e36e2cb35f3b85c008 (diff)
Integrate functionality tested on svncommunity users back into trunk
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49030 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configs/func_odbc.conf.sample')
-rw-r--r--configs/func_odbc.conf.sample47
1 files changed, 38 insertions, 9 deletions
diff --git a/configs/func_odbc.conf.sample b/configs/func_odbc.conf.sample
index c9f9d5d7f..2405952f8 100644
--- a/configs/func_odbc.conf.sample
+++ b/configs/func_odbc.conf.sample
@@ -17,25 +17,54 @@
; If you have data which may potentially contain single ticks, you may wish
; to use the dialplan function SQL_ESC() to escape the data prior to its
; inclusion in the SQL statement.
+;
+;
+; The following variables are available in this configuration file:
+;
+; readhandle A comma-separated list of DSNs (from res_odbc.conf) to use when
+; executing the readsql statement. Each DSN is tried, in
+; succession, until the statement succeeds. You may specify up to
+; 5 DSNs per function class. If not specified, it will default to
+; the value of writehandle or dsn, if specified.
+; writehandle A comma-separated list of DSNs (from res_odbc.conf) to use when
+; executing the writesql statement. The same rules apply as to
+; readhandle. "dsn" is a synonym for "writehandle".
+; readsql The statement to execute when reading from the function class.
+; writesql The statement to execute when writing to the function class.
+; prefix Normally, all function classes are prefixed with "ODBC" to keep
+; them uniquely named. You may choose to change this prefix, which
+; may be useful to segregate a collection of certain function
+; classes from others.
+; escapecommas This option may be used to turn off the default behavior of
+; escaping commas which occur within a field. If commas are
+; escaped (the default behavior), then fields containing commas
+; will be treated as a single value when assigning to ARRAY() or
+; HASH(). If commas are not escaped, then values will be separated
+; at the comma within fields. Please note that turning this option
+; off is incompatible with the functionality of HASH().
; ODBC_SQL - Allow an SQL statement to be built entirely in the dialplan
[SQL]
dsn=mysql1
-read=${ARG1}
+readsql=${ARG1}
; ODBC_ANTIGF - A blacklist.
[ANTIGF]
-dsn=mysql1
-read=SELECT COUNT(*) FROM exgirlfriends WHERE callerid='${SQL_ESC(${ARG1})}'
+dsn=mysql1,mysql2 ; Use mysql1 as the primary handle, but fall back to mysql2
+ ; if mysql1 is down. Supports up to 5 comma-separated
+ ; DSNs. "dsn" may also be specified as "readhandle" and
+ ; "writehandle", if it is important to separate reads and
+ ; writes to different databases.
+readsql=SELECT COUNT(*) FROM exgirlfriends WHERE callerid='${SQL_ESC(${ARG1})}'
; ODBC_PRESENCE - Retrieve and update presence
[PRESENCE]
dsn=mysql1
-read=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'
-write=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}'
-;prefix=OFFICE ; Changes this function from ODBC_PRESENCE to OFFICE_PRESENCE
-;escapecommas=no ; Normally, commas within a field are escaped such that each
- ; field may be separated into individual variables with ARRAY.
- ; This option turns that behavior off [default=yes].
+readsql=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'
+writesql=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}'
+;prefix=OFFICE ; Changes this function from ODBC_PRESENCE to OFFICE_PRESENCE
+;escapecommas=no ; Normally, commas within a field are escaped such that each
+ ; field may be separated into individual variables with ARRAY.
+ ; This option turns that behavior off [default=yes].