Have you compiled in support for ODBC? Asterisk will automatically compile it if it can find the ODBC development files.
Type
ls /usr/lib/asterisk/modules/odbc
It should list three modules.
/usr/lib/asterisk/modules/cdr_odbc.so
/usr/lib/asterisk/modules/res_config_odbc.so
/usr/lib/asterisk/modules/res_odbc.so
If you don’t have these modules then you probably don’t have the development files for unixODBC installed. Install these through your package management system, then recompile.
If you do have these modules then you don’t have unixODBC configured correctly. Run the following commands.
odbcinst -q -d
odbcinst -q -s
This should print the drivers you have installed and configured, and the data sources you have installed. If you don’t have any drivers / datasources installed you’ll need to install and configure them. I’m guessing from the ODBC error that this is the case.
You’ll need to do three things to get setup.
1.) Use you package management software to install the MySQL ODBC driver or install it from source.
2.) Use ‘odbcinst’ to configure the MySQL ODBC driver.
3.) Use ‘odbcinst’ to configure a datasource that uses the MySQL ODBC driver.
After you do this you should be able to use isql to connect to your database. Do not proceed to configuring Asterisk until you can connect with isql. If you cannot connect with isql, then Asterisk cannot either.
Dan