System information
On CentOS:
$ sudo yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel
If you’re using a 64-bit installation, remember to add .x86_64 to the end
of your development packages to make sure the i386 packages are not
also installed, as stability problems can result if Asterisk links against
the wrong libraries.
On Ubuntu:
$ sudo apt-get install unixODBC unixODBC-dev
See Chapter 3 for the matrix of packages you should have installed.
You’ll also need to install the unixODBC development package, because Asterisk uses
it to build the ODBC modules we will be using throughout this chapter.
The unixODBC drivers shipped with distributions are often a few ver-
sions behind the officially released versions on the http://www.unixodbc
.org website. If you have stability issues while using unixODBC, you
may need to install from source. Just be sure to remove the uni-
xODBC drivers via your package manager first, and then update the
paths in your /etc/odbcinst.ini file.
By default, CentOS will install the drivers for connecting to PostgreSQL databases via
ODBC. To install the drivers for MySQL, execute the following command:
$ sudo yum install mysql-connector-odbc
To install the PostgreSQL ODBC connector on Ubuntu:
$ sudo apt-get install odbc-postgresql
Or to install the MySQL ODBC connector on Ubuntu:
$ sudo apt-get install libmyodbc
Configuring ODBC for PostgreSQL
Configuration for the PostgreSQL ODBC driver is done in the /etc/odbcinst.ini file.
On CentOS the default file already contains some data, including that for PostgreSQL,
so just verify that the data exists. The file will look like the following:
[PostgreSQL]
Description = ODBC for PostgreSQL
Installing and Configuring ODBC | 347