Hi
I've got an Asterisk 11.8.1 installed on a debian server, I want to save cdr records in a Mysql Table, I called the Mysql database "asteriskcdr" and the mysql table "cdr". I already installed Mysql.
I search on google and I found that I'v got to setup the following asterisk files: /etc/odbc.ini --- /etc/asterisk/res_odbc.conf and /etc/asterisk/cdr_adaptive_odbc.conf
Here the information for each file:
/etc/odbc.ini:
[asteriskcdr]
Description = MySQL ODBC CDR
Driver = MySQL
Database = asteriskcdr
Server = localhost
User = root
Password = password
Port = 3306
Option = 3
/etc/asterisk/res_odbc.conf :
[asteriskcdr]
enabled => yes
dsn => asteriskcdr
username => root
password => password
pre-connect => yes
/etc/asterisk/cdr_adaptive_odbc.conf :
[asteriskcdr]
connection=asteriskcdr
table=cdr
alias start => calldate
The following commands show:
*CLI> module show like cdr_adaptive_odbc.so
Module Description Use Count
cdr_adaptive_odbc.so Adaptive ODBC CDR backend 0
1 modules loaded
root@debian:~# isql asteriskcdr root asteriskcdr
[ISQL]ERROR: Could not SQLConnect
*CLI> module reload res_odbc.so
-- Reloading module 'res_odbc.so' (ODBC resource)
== Parsing '/etc/asterisk/res_odbc.conf': Found
[Mar 28 13:15:32] NOTICE[7721]: res_odbc.c:1527 odbc_obj_connect: Connecting asteriskcdr
[Mar 28 13:15:32] WARNING[7721]: res_odbc.c:1552 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified
[Mar 28 13:15:32] WARNING[7721]: res_odbc.c:1367 _ast_odbc_request_obj2: Failed to connect to asteriskcdr
[Mar 28 13:15:32] NOTICE[7721]: res_odbc.c:919 load_odbc_config: Registered ODBC class 'asteriskcdr' dsn->[asteriskcdr]
*CLI> module reload cdr_adaptive_odbc.so
-- Reloading module 'cdr_adaptive_odbc.so' (Adaptive ODBC CDR backend)
== Parsing '/etc/asterisk/cdr_adaptive_odbc.conf': Found
[Mar 28 13:20:00] NOTICE[7726]: res_odbc.c:1527 odbc_obj_connect: Connecting asteriskcdr
[Mar 28 13:20:00] WARNING[7726]: res_odbc.c:1552 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified
[Mar 28 13:20:00] WARNING[7726]: res_odbc.c:1367 _ast_odbc_request_obj2: Failed to connect to asteriskcdr
[Mar 28 13:20:00] WARNING[7726]: cdr_adaptive_odbc.c:126 load_config: No such connection 'asteriskcdr' in the 'asteriskcdr' section of cdr_adaptive_odbc.conf. Check res_odbc.conf.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| asterisk |
| asteriskcdr |
| mysql |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)
mysql> use asteriskcdr;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+-----------------------+
| Tables_in_asteriskcdr |
+-----------------------+
| cdr |
+-----------------------+
1 row in set (0.00 sec)
The cdr table is empty calls from asterisk are being recorded in the cdr table.
Please, any ideas to see what happening?
I've got an Asterisk 11.8.1 installed on a debian server, I want to save cdr records in a Mysql Table, I called the Mysql database "asteriskcdr" and the mysql table "cdr". I already installed Mysql.
I search on google and I found that I'v got to setup the following asterisk files: /etc/odbc.ini --- /etc/asterisk/res_odbc.conf and /etc/asterisk/cdr_adaptive_odbc.conf
Here the information for each file:
/etc/odbc.ini:
[asteriskcdr]
Description = MySQL ODBC CDR
Driver = MySQL
Database = asteriskcdr
Server = localhost
User = root
Password = password
Port = 3306
Option = 3
/etc/asterisk/res_odbc.conf :
[asteriskcdr]
enabled => yes
dsn => asteriskcdr
username => root
password => password
pre-connect => yes
/etc/asterisk/cdr_adaptive_odbc.conf :
[asteriskcdr]
connection=asteriskcdr
table=cdr
alias start => calldate
The following commands show:
*CLI> module show like cdr_adaptive_odbc.so
Module Description Use Count
cdr_adaptive_odbc.so Adaptive ODBC CDR backend 0
1 modules loaded
root@debian:~# isql asteriskcdr root asteriskcdr
[ISQL]ERROR: Could not SQLConnect
*CLI> module reload res_odbc.so
-- Reloading module 'res_odbc.so' (ODBC resource)
== Parsing '/etc/asterisk/res_odbc.conf': Found
[Mar 28 13:15:32] NOTICE[7721]: res_odbc.c:1527 odbc_obj_connect: Connecting asteriskcdr
[Mar 28 13:15:32] WARNING[7721]: res_odbc.c:1552 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified
[Mar 28 13:15:32] WARNING[7721]: res_odbc.c:1367 _ast_odbc_request_obj2: Failed to connect to asteriskcdr
[Mar 28 13:15:32] NOTICE[7721]: res_odbc.c:919 load_odbc_config: Registered ODBC class 'asteriskcdr' dsn->[asteriskcdr]
*CLI> module reload cdr_adaptive_odbc.so
-- Reloading module 'cdr_adaptive_odbc.so' (Adaptive ODBC CDR backend)
== Parsing '/etc/asterisk/cdr_adaptive_odbc.conf': Found
[Mar 28 13:20:00] NOTICE[7726]: res_odbc.c:1527 odbc_obj_connect: Connecting asteriskcdr
[Mar 28 13:20:00] WARNING[7726]: res_odbc.c:1552 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified
[Mar 28 13:20:00] WARNING[7726]: res_odbc.c:1367 _ast_odbc_request_obj2: Failed to connect to asteriskcdr
[Mar 28 13:20:00] WARNING[7726]: cdr_adaptive_odbc.c:126 load_config: No such connection 'asteriskcdr' in the 'asteriskcdr' section of cdr_adaptive_odbc.conf. Check res_odbc.conf.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| asterisk |
| asteriskcdr |
| mysql |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)
mysql> use asteriskcdr;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+-----------------------+
| Tables_in_asteriskcdr |
+-----------------------+
| cdr |
+-----------------------+
1 row in set (0.00 sec)
The cdr table is empty calls from asterisk are being recorded in the cdr table.
Please, any ideas to see what happening?