res_odbc.conf.sample 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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
  24. ; name if unspecified.
  25. ;username => myuser
  26. ;
  27. ; Password for authenticating the user to the database. The default
  28. ; password is blank.
  29. ;password => mypass
  30. ;
  31. ; Build a connection at startup?
  32. pre-connect => yes
  33. ;
  34. ; What should we execute to ensure that our connection is still alive? The
  35. ; statement should return a non-zero value in the first field of its first
  36. ; record. The default is "select 1".
  37. ;sanitysql => select 1
  38. ;
  39. ; On some databases, the connection times out and a reconnection will be
  40. ; necessary. This setting configures the amount of time a connection
  41. ; may sit idle (in seconds) before a reconnection will be attempted.
  42. ;idlecheck => 3600
  43. ;
  44. ; Should we use a single connection for all queries? Most databases will
  45. ; allow sharing the connection, though Sybase and MS SQL Server will not.
  46. ;share_connections => yes
  47. ;
  48. ; If we aren't sharing connections, what is the maximum number of connections
  49. ; that we should attempt?
  50. ;limit => 5
  51. ;
  52. ; When the channel is destroyed, should any uncommitted open transactions
  53. ; automatically be committed?
  54. ;forcecommit => no
  55. ;
  56. ; How should we perceive data in other transactions within the database?
  57. ; Possible values are read_uncommitted, read_committed, repeatable_read,
  58. ; and serializable. The default is read_committed.
  59. ;isolation => repeatable_read
  60. ;
  61. ; Is the backslash a native escape character? The default is yes, but for
  62. ; MS SQL Server, the answer is no.
  63. ;backslash_is_escape => yes
  64. ;
  65. ; When enabled (default behavior), empty column values are stored as empty strings
  66. ; during realtime updates. Disabling this option causes empty column values to be
  67. ; stored as NULLs for non-text columns.
  68. ; Disable it for PostgreSQL backend in order to avoid errors caused by updating
  69. ; integer columns with an empty string instead of NULL (sippeers, sipregs, ..).
  70. ; NOTE: This option will be removed in asterisk 13. At that point, it will always
  71. ; behave as if it was set to 'no'.
  72. ;allow_empty_string_in_nontext => yes
  73. ;
  74. ; How long (in seconds) should we attempt to connect before considering the
  75. ; connection dead? The default is 10 seconds, but you may wish to reduce it,
  76. ; to increase responsiveness.
  77. ;connect_timeout => 10
  78. ;
  79. ; When a connection fails, how long (in seconds) should we cache that
  80. ; information before we attempt another connection? This increases
  81. ; responsiveness, when a database resource is not working.
  82. ;negative_connection_cache => 300
  83. [mysql2]
  84. enabled => no
  85. dsn => MySQL-asterisk
  86. username => myuser
  87. password => mypass
  88. pre-connect => yes
  89. ; Certain servers, such as MS SQL Server and Sybase use the TDS protocol, which
  90. ; limits the number of active queries per connection to 1. By telling res_odbc
  91. ; not to share connections, Asterisk can be made to work with these servers.
  92. [sqlserver]
  93. enabled => no
  94. dsn => mickeysoft
  95. share_connections => no
  96. limit => 5
  97. username => oscar
  98. password => thegrouch
  99. pre-connect => yes
  100. sanitysql => select count(*) from systables
  101. ; forcecommit => no ; Default to committing uncommitted transactions?
  102. ; Note: this is NOT the autocommit flag; this
  103. ; determines the end result of transactions which
  104. ; are not explicitly committed or rolled back. By
  105. ; default, such transactions are rolled back if the
  106. ; call ends without an explicit commit.
  107. ; isolation => read_committed ; Isolation level; supported levels are:
  108. ; read_uncommitted, read_committed, repeatable_read,
  109. ; serializable. Note that not all databases support
  110. ; all isolation levels (e.g. Postgres only supports
  111. ; repeatable_read and serializable). See database
  112. ; documentation for further information.
  113. ;
  114. ; Many databases have a default of '\' to escape special characters. MS SQL
  115. ; Server does not.
  116. backslash_is_escape => no
  117. ;
  118. ; If you are having problems with concurrency, please read this note from the
  119. ; mailing lists, regarding UnixODBC:
  120. ;
  121. ; http://lists.digium.com/pipermail/asterisk-dev/2009-February/036539.html
  122. ;
  123. ; In summary, try setting "Threading=2" in the relevant section within your
  124. ; odbcinst.ini.
  125. ;