System information

Once you’ve configured the drivers, you need to modify the /etc/odbc.ini file to control
how to connect to the database:
[asterisk-connector]
Description = MS SQL connection to 'asterisk' database
Driver = FreeTDS
Database = asterisk
Server = 192.168.100.1
UserName = asterisk
Password = welcome
Trace = No
TDS_Version = 7.0
Port = 1433
In the next section, you will be able to validate your connection to the MS SQL server.
Validating the ODBC Connector
Now, verify that you can connect to your database using the isql application. echo the
select 1 statement and pipe it into isql, which will then connect using the asterisk-
connector section you added to /etc/odbc.ini. You should get the following output (or
at least something similar; we’re looking for a result of 1 rows fetched):
$ echo "select 1" | isql -v asterisk-connector
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> +------------+
| ?column? |
+------------+
| 1 |
+------------+
SQLRowCount returns 1
1 rows fetched
$ exit
With unixODBC installed, configured, and verified to work, you need to recompile
Asterisk so that the ODBC modules are created and installed. Change back to your
Asterisk source directory and run the ./configure script so it knows you have installed
unixODBC:
$ cd ~/src/asterisk-complete/asterisk/1.8
$ ./configure
$ make menuselect
$ make install
Installing and Configuring ODBC | 351