res_odbc.conf.sample 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ;;; odbc setup file
  2. ; ENV is a global set of environmental variables that will get set.
  3. ; Note that all environmental variables can be seen by all connections,
  4. ; so you can't have different values for different connections.
  5. [ENV]
  6. ;INFORMIXSERVER => my_special_database
  7. ;INFORMIXDIR => /opt/informix
  8. ;ORACLE_HOME => /home/oracle
  9. ; All other sections are arbitrary names for database connections.
  10. ;
  11. ; The context name is what will be used in other configuration files, such
  12. ; as extconfig.conf and func_odbc.conf, to reference this connection.
  13. [asterisk]
  14. ;
  15. ; Permit disabling sections without needing to comment them out.
  16. ; If not specified, it is assumed the section is enabled.
  17. enabled => no
  18. ;
  19. ; This value should match an entry in /etc/odbc.ini
  20. ; (or /usr/local/etc/odbc.ini, on FreeBSD and similar systems).
  21. dsn => asterisk
  22. ;
  23. ; Username for connecting to the database. The user defaults to the context name if unspecified.
  24. ;username => myuser
  25. ;
  26. ; Password for authenticating the user to the database. The default
  27. ; password is blank.
  28. ;password => mypass
  29. ;
  30. ; Build a connection at startup?
  31. pre-connect => yes
  32. ;
  33. ; What should we execute to ensure that our connection is still alive? The
  34. ; statement should return a non-zero value in the first field of its first
  35. ; record. The default is "select 1".
  36. ;sanitysql => select 1
  37. ;
  38. ; The maximum number of connections to have open at any given time.
  39. ; This defaults to 1 and it is highly recommended to only set this higher
  40. ; if using a version of UnixODBC greater than 2.3.1.
  41. ;max_connections => 20
  42. ;
  43. ; When the channel is destroyed, should any uncommitted open transactions
  44. ; automatically be committed?
  45. ;forcecommit => no
  46. ;
  47. ; How should we perceive data in other transactions within the database?
  48. ; Possible values are read_uncommitted, read_committed, repeatable_read,
  49. ; and serializable. The default is read_committed.
  50. ;isolation => repeatable_read
  51. ;
  52. ; Is the backslash a native escape character? The default is yes, but for
  53. ; MS SQL Server, the answer is no.
  54. ;backslash_is_escape => yes
  55. ;
  56. ; How long (in seconds) should we attempt to connect before considering the
  57. ; connection dead? The default is 10 seconds, but you may wish to reduce it,
  58. ; to increase responsiveness.
  59. ;connect_timeout => 10
  60. ;
  61. ; When a connection fails, how long (in seconds) should we cache that
  62. ; information before we attempt another connection? This increases
  63. ; responsiveness, when a database resource is not working.
  64. ;negative_connection_cache => 300
  65. [mysql2]
  66. enabled => no
  67. dsn => MySQL-asterisk
  68. username => myuser
  69. password => mypass
  70. pre-connect => yes
  71. ; Certain servers, such as MS SQL Server and Sybase use the TDS protocol, which
  72. ; limits the number of active queries per connection to 1.
  73. [sqlserver]
  74. enabled => no
  75. dsn => mickeysoft
  76. max_connections => 5
  77. username => oscar
  78. password => thegrouch
  79. pre-connect => yes
  80. sanitysql => select count(*) from systables
  81. ; forcecommit => no ; Default to committing uncommitted transactions?
  82. ; Note: this is NOT the autocommit flag; this
  83. ; determines the end result of transactions which
  84. ; are not explicitly committed or rolled back. By
  85. ; default, such transactions are rolled back if the
  86. ; call ends without an explicit commit.
  87. ; isolation => read_committed ; Isolation level; supported levels are:
  88. ; read_uncommitted, read_committed, repeatable_read,
  89. ; serializable. Note that not all databases support
  90. ; all isolation levels (e.g. Postgres only supports
  91. ; repeatable_read and serializable). See database
  92. ; documentation for further information.
  93. ;
  94. ; Many databases have a default of '\' to escape special characters. MS SQL
  95. ; Server does not.
  96. backslash_is_escape => no
  97. ;
  98. ; If you are having problems with concurrency, please read this note from the
  99. ; mailing lists, regarding UnixODBC:
  100. ;
  101. ; http://lists.digium.com/pipermail/asterisk-dev/2009-February/036539.html
  102. ;
  103. ; In summary, try setting "Threading=2" in the relevant section within your
  104. ; odbcinst.ini.
  105. ;