res_odbc.conf 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. ; On some databases, the connection times out and a reconnection will be
  39. ; necessary. This setting configures the amount of time a connection
  40. ; may sit idle (in seconds) before a reconnection will be attempted.
  41. ;idlecheck => 3600
  42. ;
  43. ; Should we use a single connection for all queries? Most databases will
  44. ; allow sharing the connection, though Sybase and MS SQL Server will not.
  45. ;share_connections => yes
  46. ;
  47. ; If we aren't sharing connections, what is the maximum number of connections
  48. ; that we should attempt?
  49. ;limit => 5
  50. ;
  51. ; When the channel is destroyed, should any uncommitted open transactions
  52. ; automatically be committed?
  53. ;forcecommit => no
  54. ;
  55. ; How should we perceive data in other transactions within the database?
  56. ; Possible values are read_uncommitted, read_committed, repeatable_read,
  57. ; and serializable. The default is read_committed.
  58. ;isolation => repeatable_read
  59. ;
  60. ; Is the backslash a native escape character? The default is yes, but for
  61. ; MS SQL Server, the answer is no.
  62. ;backslash_is_escape => yes
  63. ;
  64. ; How long (in seconds) should we attempt to connect before considering the
  65. ; connection dead? The default is 10 seconds, but you may wish to reduce it,
  66. ; to increase responsiveness.
  67. ;connect_timeout => 10
  68. ;
  69. ; When a connection fails, how long (in seconds) should we cache that
  70. ; information before we attempt another connection? This increases
  71. ; responsiveness, when a database resource is not working.
  72. ;negative_connection_cache => 300
  73. [mysql2]
  74. enabled => no
  75. dsn => MySQL-asterisk
  76. username => myuser
  77. password => mypass
  78. pre-connect => yes
  79. ; Certain servers, such as MS SQL Server and Sybase use the TDS protocol, which
  80. ; limits the number of active queries per connection to 1. By telling res_odbc
  81. ; not to share connections, Asterisk can be made to work with these servers.
  82. [sqlserver]
  83. enabled => no
  84. dsn => mickeysoft
  85. share_connections => no
  86. limit => 5
  87. username => oscar
  88. password => thegrouch
  89. pre-connect => yes
  90. sanitysql => select count(*) from systables
  91. ; forcecommit => no ; Default to committing uncommitted transactions?
  92. ; Note: this is NOT the autocommit flag; this
  93. ; determines the end result of transactions which
  94. ; are not explicitly committed or rolled back. By
  95. ; default, such transactions are rolled back if the
  96. ; call ends without an explicit commit.
  97. ; isolation => read_committed ; Isolation level; supported levels are:
  98. ; read_uncommitted, read_committed, repeatable_read,
  99. ; serializable. Note that not all databases support
  100. ; all isolation levels (e.g. Postgres only supports
  101. ; repeatable_read and serializable). See database
  102. ; documentation for further information.
  103. ;
  104. ; Many databases have a default of '\' to escape special characters. MS SQL
  105. ; Server does not.
  106. backslash_is_escape => no
  107. ;
  108. ; If you are having problems with concurrency, please read this note from the
  109. ; mailing lists, regarding UnixODBC:
  110. ;
  111. ; http://lists.digium.com/pipermail/asterisk-dev/2009-February/036539.html
  112. ;
  113. ; In summary, try setting "Threading=2" in the relevant section within your
  114. ; odbcinst.ini.
  115. ;