[asterisk-users] Asterisk 1.8.13.0 / problem with cdr logging (mysql, odbc)
Duncan Turnbull
duncan at e-simple.co.nz
Mon Jun 18 14:26:44 CDT 2012
I think you need the DSN in car_odbr.ini to refer to the one in res_odbc.conf as below
On 19/06/2012, at 3:52 AM, Thorsten Göllner wrote:
> Hi,
>
> I am trying now for over 4 hours setting up cdr-logging via odbc into a mysql database. But with no success. Do you have any hint for me?
>
> cat /etc/odbc.ini
> ------------------
> [MySQL-asterisk]
> Description = MySQL ODBC Driver
> Driver = MySQL
> Socket = /var/run/mysqld/mysqld.sock
> Server = localhost
> User = xxx
> Password = xxx
> Database = asterisk
> Option = 3
> Port =
>
> and
>
> /etc/odbcinst.ini
> --------------------
> [MySQL]
> Description = MySQL ODBC MyODBC Driver
> Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
> FileUsage = 1
>
> When testing this setup I can see, that this basic setup ist fine:
>
> ~$ isql MySQL-asterisk asterisk qpalym -v
> +---------------------------------------+
> | Connected! |
> | |
> | sql-statement |
> | help [tablename] |
> | quit |
> | |
> +---------------------------------------+
> SQL>
>
> So here are the config file for asterisk.
>
> /etc/asterisk/res_odbc.conf
> -----------------------------
> [mysql]
> enabled => yes
> dsn => MySQL-asterisk
> username => asterisk
> password => qpalym
> pre-connect => yes
>
> and
>
> /etc/asterisk/cdr_odbc.conf
> ----------------------------
> [global]
> dsn=MySQL-asterisk
dsn=mysql
> loguniqueid=yes
> dispositionstring=yes
> table=cdr
>
> But after a call hangup I get the following error:
> cdr_odbc.c: Unable to retrieve database handle. CDR failed.
>
> What is going wrong here, please?
>
> -Thorsten-
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list