Hi everyone,
I’m using Asterisk 1.8 on OpenSuse 11.3 and I’m trying to use a MySQL database to configure Asterisk, but Asterisk doesn’t connect through odbc. MySql and ODBC do function, but Asterisk doesn’t have any res_odbc.so to load since I cann’t run odbc show in the CLI. I tried to copy res_odbc.so from my source folder to the asterisk module folder and it tells me:
[Apr 26 15:33:28] WARNING[25710]: loader.c:777 inspect_module: Module 'res_odbc.so' was not compiled with the same compile-time options as this version of Asterisk.
[Apr 26 15:33:28] WARNING[25710]: loader.c:778 inspect_module: Module 'res_odbc.so' will not be initialized as it may cause instability.
[Apr 26 15:33:28] WARNING[25710]: loader.c:861 load_resource: Module 'res_odbc.so' could not be loaded.
My configurations are as follows:
/etc/unixODBC/odbcinst.ini
[MySQL]
Driver = /usr/lib/unixODBC/libmyodbc3.so
Setup = /usr/lib/unixODBC/libodbcmyS.so
FileUsage = 1
Testing the drive
# odbcinst -q -d
[MySQL]
/etc/unixODBC/odbc.ini
[asterisk-connector]
Description = MySQL connection to 'asterisk' database
Driver = MySQL
Database = asterisk
Server = localhost
UserName = myusername
Password = mypassword
Port = 3306
Socket = /var/run/mysql/mysql.sock[/code]
Validating ODBC
[code] # echo "select 1" | isql -v asterisk-connector
[MYODBCUtilReadDataSource.c][243][ERROR] Unknown attribute (UserName).
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> +---------------------+
| 1 |
+---------------------+
| 1 |
+---------------------+
SQLRowCount returns 1
1 rows fetched
SQL> #
Then I did ./configure, make menuselect and make install. I made sure the necessary modules (cdr_odbc, cdr_adaptive_odbc,func_odbc, func_realtime, pbx_realtime, res_config_odbc, and res_odbc) were selected.
etc/asterisk/res_odbc.conf
[asterisk]
enabled => yes
dsn => asterisk-connector
username => myusername
password => mypassword
pre-connect => yes
pooling => no
limit => 1
Then I started Asterisk, but odbc show could not be run.
When I configure something in extconfig.conf, I always receive the warning that the mysql engine is not available.
Does any one have an idea, I’ve been working on this for almost a week now.
Thanks in advance