Asterisk with CDR Adaptive ODBC: Difference between revisions
From KlavoWiki
Jump to navigationJump to search
Created page with "= Prerequisite = <pre> yum -y install mysql-connector-odbc unixODBC-devel libtool-ltdl-devel </pre> By default by installing ODBC it will automatically set up known driver co..." |
|||
Line 33: | Line 33: | ||
For MySQL and CentOS: /var/lib/mysql/mysql.sock<br> | For MySQL and CentOS: /var/lib/mysql/mysql.sock<br> | ||
For MySQL and Debian: /var/run/mysqld/mysqld.sock | For MySQL and Debian: /var/run/mysqld/mysqld.sock | ||
== VerifyConnectivity == | |||
<pre> | |||
echo "select 1" | isql -v MySQL-asterisk | |||
</pre> | |||
= Attach res_odbc to DSN = | = Attach res_odbc to DSN = |
Revision as of 23:27, 13 October 2015
Prerequisite
yum -y install mysql-connector-odbc unixODBC-devel libtool-ltdl-devel
By default by installing ODBC it will automatically set up known driver connections to MySQL and PostgreSQL
odbcinst -q -d
The details of the driver conneciton can be found in:
cat /etc/odbcinst.ini
Create ODBC DSN Connection
vi /etc/odbc.ini
Add the following contents
[MySQL-asterisk] Description = Asterisk CDR Driver = MySQL Database = asterisk User = root Server = localhost Socket = /var/lib/mysql/mysql.sock
For MySQL and CentOS: /var/lib/mysql/mysql.sock
For MySQL and Debian: /var/run/mysqld/mysqld.sock
VerifyConnectivity
echo "select 1" | isql -v MySQL-asterisk
Attach res_odbc to DSN
vi /etc/asterisk/res_odbc.conf
Add/Modify the following to the file.
[asterisk] enabled => yes dsn => MySQL-asterisk username => root password => pre-connect => yes
Attach cdr_adaptive_odbc to res_odbc
vi /etc/asterisk/cdr_adaptive_odbc.conf
Add the following
[cdr_adaptive_connection] connection=asterisk table=cdr
If you are using an older CDR table or applications that uses the calldate column rather than the newer start column then you will need to create an alias.
vi /etc/asterisk/cdr_adaptive_odbc.conf
In the cdr_adaptive_connection context add the following line.
alias start => calldate