[Asterisk-Users] cdr mysql problem

dipak0105 dipak0105 at indiatimes.com
Tue Feb 3 05:47:23 MST 2004


Hi 

You have to follow this steps and obviously you got success because we have followed this steps and got success.

Configure the cdr_mysql.conf file in the location /etc/asterisk. The configuration is as follows:

[global]
hostname=localhost		;This is the host name of MySql            
dbname=asteriskcdrdb	;This is the database name of MySql
password=password		;This is the password of user
user=asteriskcdruser		;This is the user in MySql
port=3306			;This is the port number running the MySql
sock=/var/lib/mysql/mysql.sock	;This is the socket of MySql and the location

Then follow the steps in the MySql server

1. Go to Start Application>>System>>Service Configuration. Check the mysqld box. Click the save button
   Then click the start button.

2. Open a kolsole.

3. Type: "mysql -u root" to enter into mysql.

4. Type: "SET PASSWORD FOR root = PASSWORD("password");" for setting the root password.

5. Type: "GRANT ALL PRIVILEGES ON *.* TO asteriskcdruser at localhost IDENTIFIED BY "password" WITH GRANT OPTION;"

6. Type: "\q;" to Quit mysql.

7. Type: In konsole "mysql -u asteriskcdruser -p" and use the password "password",
   to reenter mysql as "asteriskcdruser" user.

8. Type: "CREATE DATABASE asteriskcdrdb;"

9. Type:

  "CREATE TABLE cdr (
  calldate datetime NOT NULL default '0000-00-00 00:00:00',
  clid varchar(45) NOT NULL default '',
  src varchar(45) NOT NULL default '',
  dst varchar(45) NOT NULL default '',
  dcontext varchar(45) NOT NULL default '',
  channel varchar(45) NOT NULL default '',
  dstchannel varchar(45) NOT NULL default '',
  lastapp varchar(45) NOT NULL default '',
  lastdata varchar(45) NOT NULL default '',
  duration int(11) NOT NULL default '0',
  billsec int(11) NOT NULL default '0',
  disposition varchar(45) NOT NULL default '',
  amaflags int(11) NOT NULL default '0',
  accountcode varchar(45) NOT NULL default '',
  uniqueid varchar(45) NOT NULL default ''
  );"

  for create a table "cdr".

10. To reload the configuration, type reload from the Asterisk command prompt.

These are the steps of Configuration of MySql with Asterisk server. Contact me if you need any further clarifications.

Dipak Kumar Paul.
Sigmabit Technology India.


asterisk-users at lists.digium.com wrote:

Hi, here it is... 

[root at ceres asterisk]# cat cdr_mysql.conf 
; 
; Note - if the database server is hosted on the same machine as the 
; asterisk server, you can achieve a local Unix socket connection by 
; setting hostname=localhost 
; 
; port and sock are both optional parameters.  If hostname is specified 
; and is not "localhost", then cdr_mysql will attempt to connect to the 
; port specified or use the default port.  If hostname is not specified 
; or if hostname is "localhost", then cdr_mysql will attempt to connect 
; to the socket file specified by sock or otherwise use the default
socket 
; file.
;
[global]
hostname=localhost
dbname=asteriskcdrdb
password=******
user=asteriskcdruser
;port=3306
;sock=/tmp/mysql.sock
sock=/var/lib/mysql/mysql.sock


srwxrwxrwx    1 mysql    mysql           0 Feb  2 19:37
/var/lib/mysql/mysql.sock


Tomica

-----Original Message-----
From: asterisk-users-admin at lists.digium.com
[mailto:asterisk-users-admin at lists.digium.com] On Behalf Of Tilghman
Lesher
Sent: Tuesday, February 03, 2004 12:32 AM
To: asterisk-users at lists.digium.com
Subject: Re: [Asterisk-Users] cdr mysql problem

On Monday 02 February 2004 15:27, Tomica Crnek wrote:
> Yes, I have checked the logs. There is nothing there. I think asterisk

> doesn't try to connect.

Please paste the contents of /etc/asterisk/cdr_mysql.conf.  Also, paste
the output of:

ls -l /tmp/mysql.sock /var/lib/mysql/mysql.sock ; locate mysql.sock

-Tilghman

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com

 Buy The Best In BOOKS at http://www.bestsellers.indiatimes.com

Bid for for Air Tickets @ Re.1 on Air Sahara Flights. Just log on to http://airsahara.indiatimes.com and Bid Now!




More information about the asterisk-users mailing list