[asterisk-users] CDR/MySQL basic config

Forrest Beck jonforrest.beck at gmail.com
Mon Aug 6 20:59:27 CDT 2007


Adrian,

What host/ip did you specify when you created the user?

#> mysql --user=root --password

#mysql> use mysql;

#mysql> select Host from user where User = 'asteriskcdruser'
(this line is case sensitive)

Does it return 127.0.0.1 or localhost.  Make cdr_mysql reflect that.

You should also check out cdr_odbc, asterisk can connect through an
ODBC connection which in turn is a connection to the MySQL database.
There seems to be more suport for the ODBC driver.

Hope this helps some....



On 8/6/07, Adrian Marsh <Adrian.Marsh at ubiquisys.com> wrote:
> Hi,
>
> I'm trying to add mysql CDR onto a vanilla Asterisk 1.2 install.  The
> add-ons pack has been installed for a while, so now I'm trying to add
> the Mysql config.
>
> I've created a mysql database, added the grants for a user acces, and
> can run a mysql -u asteriskcdruser -p and can connect to the database.
>
> I've been using this as a guide:
> http://www.757.org/~joat/wiki/index.php/Asterisk#Viewing_CDR_Data_with_A
> sterisk:_CDR_Analyzer
>
> I've created cdr_mysql.conf:
>
> [global]
> hostname=localhost
> dbname=asteriskcdrdb
> table=cdr
> password=password
> user=asteriskcdruser
> port=3306
> sock=/tmp/mysql.sock
> userfield=1
>
> But when I start asterisk (1.4 on my test machine), I get:
>
>   == Parsing '/etc/asterisk/cdr_mysql.conf': Found
> [Aug  6 21:01:14] ERROR[32512]: cdr_addon_mysql.c:436 my_load_module:
> Failed to connect to mysql database asteriskcdrdb on localhost.
> cdr_addon_mysql.so => (MySQL CDR Backend)
> [Aug  6 21:01:14] ERROR[32512]: res_config_mysql.c:627 mysql_reconnect:
> MySQL RealTime: Failed to connect database server  on  (err 2002). Check
> debug for more info.
> [Aug  6 21:01:14] WARNING[32512]: res_config_mysql.c:474 load_module:
> MySQL RealTime: Couldn't establish connection. Check debug.
> [Aug  6 21:01:14] NOTICE[32512]: config.c:1171
> ast_config_engine_register: Registered Config Engine mysql
> MySQL RealTime driver loaded.
> res_config_mysql.so => (MySQL RealTime Configuration Driver)
>
>
> I'm also looking as to what CDR viewers there are available, and which
> people think are best.  I want to view/report on the calls made within
> A*k.
>
> Thanks,
>
> Adrian
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>


-- 
***
Forrest Beck
IAXTEL: 17002871718
jonforrest.beck at gmail.com
http://www.shift8.biz



More information about the asterisk-users mailing list