FreePBX | Register | Issues | Wiki | Portal | Support

[unixODBC][Driver Manager]Data source name not found, and no default driver specified


(E Lindemann) #1

Hello @all,

can anybody help me with that?

WARNING[22257] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified

WARNING[22257] cdr_adaptive_odbc.c: No such connection ‘asteriskcdrdb’ in the ‘adaptive_connection’ section of cdr_adaptive_odbc.conf. Check res_odbc.conf.

I checked all the files, but always after restarting asterisk this error will not go away. I tried a lot, nothing really helped me to solve this problem.

Other errors while starting asterisk are like:
ERROR[22574] res_sorcery_config.c: Could not create an object of type ‘auth’ with id ‘dcs-trunk-auth’ from configuration file ‘pjsip.conf’
ERROR[22574] res_pjsip/config_auth.c: No authentication username for auth ‘dcs-auth’
But, there, on this part i have no real config @all, therefore this errors are regular.

But how can i solve this
[unixODBC][Driver Manager]Data source …
problem?

I do have this files:
#######################################################
/etc/asterisk/freepbx.conf:

<?php // This file was generated at 2018-06-22T05:12:44+00:00 $amp_conf["AMPDBUSER"] = "freepbxuser"; $amp_conf["AMPDBPASS"] = "password"; $amp_conf["AMPDBHOST"] = "localhost"; $amp_conf["AMPDBNAME"] = "asterisk"; $amp_conf["AMPDBENGINE"] = "mysql"; $amp_conf["datasource"] = ""; require_once "/var/www/html/admin/bootstrap.php"; ?>

#######################################################
/etc/asterisk/odbc.ini

[MySQL-asteriskcdrdb]
Description=MySQL connection to asterisk database
driver=MySQL
server=localhost
database=asteriskcdrdb
username=freepbxuser
password=password
Port=3306
Socket=/var/lib/mysql/mysql.sock
option=3

#######################################################
/etc/odbcinst.ini

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1

#######################################################
/etc/asterisk/cdr_adaptive_odbc.conf

[adaptive_connection]
connection=asteriskcdrdb
loguniqueid=yes
table=cdr
alias start => calldate

#######################################################
/etc/asterisk/res_odbc.conf

[asteriskcdrdb]
enabled=>yes
dsn=>asteriskcdrdb
pre-connect=>yes
max_connections=>5
username=>freepbxuser
password=>password
database=>asteriskcdrdb

#include res_odbc_custom.conf
#include res_odbc_additional.conf

#######################################################
res_odbc_custom.conf
res_odbc_additional.conf
are blank.
#######################################################

Also i have an asterisk and a freepbxuser in the mysql-DB, you guess, the same password, password.
I am using for all conns/users the same password, it is a testing machine, not productive system, therefore there is no auth-data for connecting to a provider.

But before connecting to my provider, asterisk needs to connect to mysql(?)

*CLI> odbc show status
delivers
ODBC DSN Settings

#####################

*CLI> odbc show
ODBC DSN Settings

Name: asteriskcdrdb
DSN: asteriskcdrdb
Last connection attempt: 2018-10-10 22:03:38
Number of active connections: 0 (out of 5)

######################
Users in mysql:
±-----------------+
| User |
±-----------------+
| asterisk |
| freepbxuser |
| root |
| debian-sys-maint |
| phpmyadmin |
±-----------------+
5 rows in set (0.00 sec)

dbs are:
±-------------------+
| Database |
±-------------------+
| information_schema |
| asterisk |
| asteriskcdrdb |
| mysql |
| performance_schema |
| phpmyadmin |
±-------------------+
6 rows in set (0.00 sec)

Files in /etc/asterisk owns asterisk himself, also other needed dirs too.

Somehow, edting the files above, i lost the overview. Which user has to be connected with which db/dsn and which conf-file will assure with the right configuration the connection.
therefore ONE password.
Later i will change, reinstall with more secure ones. :wink:

Why i am getting this errors? :frowning: :wink:

Thx in advance for any appreciated help.
ELindemann

PS:
asterisk-certified-13.21-cert2
complied on debian
3.16.0-4-amd64 #1 SMP Debian 3.16.51-3 (2017-12-13) x86_64 GNU/Linux


(Boris Barabanov) #2

but your dsn is MySQL-asteriskcdrdb


(E Lindemann) #3

Hi boristheblade,

i do not have

MySQL-asteriskcdrdb

in mysql, on Debian/13.xx.cert, you saw my databases list above? Sure you saw. :-).
But you are right, Freepbx-Distri has this one as a connection.
Will try to get a dump of the distri, then re-importing this dump (or the hole asterisk databases in mysql on freepbx) in debian/asterisk.13.xx.cert

thx
ELindemann


(Tom Ray) #4

This is a prime example of why the Manual Install pages on the Wiki say “For Experts Only”. That just doesn’t mean “FreePBX Experts” it means people in general with experience in setting up Linux servers and being able to deal with situations like this.

You’re ODBC stuff is INCORRECT and it seems you do not understand how ODBC works. When you were told your DSN is wrong it’s because it is. You have [MySQL-asteriskcdrdb] in your odbc.ini which is what the DSN name is calling on so your DSN needs to match what is in your odbc.ini


(E Lindemann) #5

… you are right, i am not an expert on Asterisk, not an expert on odbc. But doing long time with linux. Until this time, although not an expert on odbc some mysql stuff (without odbc) worked for me. Because of some errors in the setup, i was looking here for help. Wrong?

I also do not want be an expert on odbc, nor want some great lessons in odbc. I am only looking for a helping hand/hint to solve the problem. Probably you gave me the right hint.

[MySQL-asteriskcdrdb]
had it as too:
[asteriskcdrdb]

was the same, not working.

I was publishing my flies as they were non-functional, hoping somebody will see the faulty entry. As you and boristheblade saw the unmatched lines. Nice.

Thx.
Elindemann


(Boris Barabanov) #6

Make correction in your res_odbc.conf
after that restart asterisk
/etc/asterisk/res_odbc.conf

[asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pre-connect=>yes
max_connections=>5
username=>freepbxuser
password=>password
database=>asteriskcdrdb

#include res_odbc_custom.conf
#include res_odbc_additional.conf