<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns0="urn:schemas-microsoft-com:office:smarttags">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Arial Narrow";
        panose-1:2 11 5 6 2 2 2 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Alessandro,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks for that.. I’m pretty sure
about the user. I used Webmin to confirm the user configs, but I ran your
commands anyway:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>mysql> use mysql ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Reading table information for completion
of table and column names<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You can turn off this feature to get a
quicker startup with -A<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Database changed<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>mysql> select Host from user where User
= 'asteriskcdruser' ;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>+-----------+<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>| Host |<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>+-----------+<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>| localhost |<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>+-----------+<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>1 row in set (0.00 sec)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>mysql> grant insert on asteriskcdrdb.*
to asteriskcdruser@localhost identified by 'asteriskcdruser';<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Query OK, 0 rows affected (0.00 sec)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>But I still get the failure:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>[Aug 7 15:14:10] ERROR[29103]:
cdr_addon_mysql.c:436 my_load_module: Failed to connect to mysql database
asteriskcdrdb on localhost.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>cdr_addon_mysql.so => (MySQL CDR
Backend)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>[Aug 7 15:14:10] ERROR[29103]:
res_config_mysql.c:627 mysql_reconnect: MySQL RealTime: Failed to connect
database server on (err 2002). Check debug for more info.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>[Aug 7 15:14:10] WARNING[29103]:
res_config_mysql.c:474 load_module: MySQL RealTime: Couldn't establish
connection. Check debug.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>[Aug 7 15:14:10] NOTICE[29103]:
config.c:1171 ast_config_engine_register: Registered Config Engine mysql<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>MySQL RealTime driver loaded.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>res_config_mysql.so => (MySQL RealTime
Configuration Driver)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>This box also das Cacti installed on it,
which makes use of the MySql server as well (and all is ok there).<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal><st1:PersonName w:st="on"><span class=style131><font size=2
color="#003366" face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:#003366'>Adrian Marsh</span></font></span></st1:PersonName><font
color=navy><span style='color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'> </span></font><span class=style131><font
size=2 color="#003366" face="Arial Narrow"><span style='font-size:10.0pt;
font-family:"Arial Narrow";color:#003366'> </span></font></span><span
class=style131><font size=2 color="#003366" face="Arial Narrow"><span
style='font-size:10.0pt;font-family:"Arial Narrow";color:#003366'><o:p></o:p></span></font></span></p>
</div>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Alessandro Russo<br>
<b><span style='font-weight:bold'>Sent:</span></b> 07 August 2007 14:13<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">Asterisk
Users Mailing List - Non-Commercial Discussion</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [asterisk-users]
CDR/MySQL basic config</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi, <br>
first step is correct <o:p></o:p></span></font></p>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hmm.. This is what I get:<br>
<br>
[root@ubiq-serv6 ~]# mysql -u root -p<br>
Enter password:<br>
Welcome to the MySQL monitor. Commands end with ; or \g.<br>
Your MySQL connection id is 187143 to server version: 4.1.20<br>
<br>
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. <o:p></o:p></span></font></p>
</blockquote>
<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;
margin-left:4.8pt;margin-right:0cm'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>You make an errore here : mysql> use asteriskcdrdb <o:p></o:p></span></font></p>
</blockquote>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>users' information are
stored in mysql db<br>
<br>
mysql> use mysql;<br>
Reading table information for completion of table and column names<br>
You can turn off this feature to get a quicker startup with -A<br>
<br>
Database changed <br>
mysql
<br>
<br>
mysql> select Host from user where User = 'asteriskcdruser' ;<br>
+-----------+<br>
| Host |<br>
+-----------+<br>
| localhost |<br>
+-----------+<br>
1 row in set (0.00 sec)<br>
<br>
mysql> <br>
<br>
Are you sure that user 'asteriskcdruser' has the privileges to insert record in
DB "asteriskcdrdb"?<br>
If not...allow 'asteriskcdruser' to insert record ^_^<br>
<br>
mysql> grant insert on asteriskcdrdb.* to asteriskcdruser@localhost
identified by 'asteriskcdruser';<br>
mysql> exit<br>
<br>
Reload asterisk and try <br>
<br>
<br>
<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>On 8/7/07, <st1:PersonName w:st="on"><b><span
style='font-weight:bold'>Adrian Marsh</span></b></st1:PersonName> < <a
href="mailto:Adrian.Marsh@ubiquisys.com">Adrian.Marsh@ubiquisys.com</a>>
wrote:</span></font></span><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
Hmm.. This is what I get:<br>
<br>
[root@ubiq-serv6 ~]# mysql -u root -p<br>
Enter password:<br>
Welcome to the MySQL monitor. Commands end with ; or \g.<br>
Your MySQL connection id is 187143 to server version: 4.1.20<br>
<br>
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.<br>
<br>
mysql> use asteriskcdrdb ;<br>
Reading table information for completion of table and column names<br>
You can turn off this feature to get a quicker startup with -A <br>
<br>
Database changed<br>
mysql> select Host from user where User = 'asteriskcdruser' ;<br>
ERROR 1146 (42S02): Table 'asteriskcdrdb.user' doesn't exist<br>
mysql><br>
<br>
<br>
<st1:PersonName w:st="on">Adrian Marsh</st1:PersonName><br>
-----Original Message----- <br>
From: <a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a><br>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a>
] On Behalf Of Forrest<br>
Beck<br>
Sent: 07 August 2007 02:59<br>
To: <st1:PersonName w:st="on">Asterisk Users Mailing List - Non-Commercial
Discussion</st1:PersonName><br>
Subject: Re: [asterisk-users] CDR/MySQL basic config<br>
<br>
<st1:City w:st="on"><st1:place w:st="on">Adrian</st1:place></st1:City>,<br>
<br>
What host/ip did you specify when you created the user? <br>
<br>
#> mysql --user=root --password<br>
<br>
#mysql> use mysql;<br>
<br>
#mysql> select Host from user where User = 'asteriskcdruser'<br>
(this line is case sensitive)<br>
<br>
Does it return <a href="http://127.0.0.1">127.0.0.1</a> or
localhost. Make cdr_mysql reflect that.<br>
<br>
You should also check out cdr_odbc, asterisk can connect through an<br>
ODBC connection which in turn is a connection to the MySQL database.<br>
There seems to be more suport for the ODBC driver. <br>
<br>
Hope this helps some....<br>
<br>
<br>
<br>
On 8/6/07, <st1:PersonName w:st="on">Adrian Marsh</st1:PersonName> <<a
href="mailto:Adrian.Marsh@ubiquisys.com">Adrian.Marsh@ubiquisys.com</a>>
wrote:<br>
> Hi,<br>
><br>
> I'm trying to add mysql CDR onto a vanilla Asterisk 1.2
install. The<br>
> add-ons pack has been installed for a while, so now I'm trying to add<br>
> the Mysql config.<br>
><br>
> I've created a mysql database, added the grants for a user acces, and<br>
> can run a mysql -u asteriskcdruser -p and can connect to the database. <br>
><br>
> I've been using this as a guide:<br>
><br>
<a
href="http://www.757.org/~joat/wiki/index.php/Asterisk#Viewing_CDR_Data_with_A">http://www.757.org/~joat/wiki/index.php/Asterisk#Viewing_CDR_Data_with_A</a>
<br>
> sterisk:_CDR_Analyzer<br>
><br>
> I've created cdr_mysql.conf:<br>
><br>
> [global]<br>
> hostname=localhost<br>
> dbname=asteriskcdrdb<br>
> table=cdr<br>
> password=password<br>
> user=asteriskcdruser <br>
> port=3306<br>
> sock=/tmp/mysql.sock<br>
> userfield=1<br>
><br>
> But when I start asterisk (1.4 on my test machine), I get:<br>
><br>
> == Parsing '/etc/asterisk/cdr_mysql.conf': Found<br>
> [Aug 6 21:01:14] ERROR[32512]: cdr_addon_mysql.c:436
my_load_module:<br>
> Failed to connect to mysql database asteriskcdrdb on localhost.<br>
> cdr_addon_mysql.so => (MySQL CDR Backend)<br>
> [Aug 6 21:01:14] ERROR[32512]: res_config_mysql.c:627 <br>
mysql_reconnect:<br>
> MySQL RealTime: Failed to connect database
server on (err 2002).<br>
Check<br>
> debug for more info.<br>
> [Aug 6 21:01:14] WARNING[32512]: res_config_mysql.c:474
load_module:<br>
> MySQL RealTime: Couldn't establish connection. Check debug. <br>
> [Aug 6 21:01:14] NOTICE[32512]: config.c:1171<br>
> ast_config_engine_register: Registered Config Engine mysql<br>
> MySQL RealTime driver loaded.<br>
> res_config_mysql.so => (MySQL RealTime Configuration Driver) <br>
><br>
><br>
> I'm also looking as to what CDR viewers there are available, and which<br>
> people think are best. I want to view/report on the calls made
within<br>
> A*k.<br>
><br>
> Thanks,<br>
> <br>
> <st1:City w:st="on"><st1:place w:st="on">Adrian</st1:place></st1:City><br>
><br>
> _______________________________________________<br>
> --Bandwidth and Colocation Provided by <a
href="http://www.api-digital.com--">http://www.api-digital.com--</a><br>
><br>
> asterisk-users mailing list <br>
> To UNSUBSCRIBE or update options visit:<br>
> <a
href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
><br>
<br>
<br>
--<br>
***<br>
Forrest Beck <br>
IAXTEL: 17002871718<br>
<a href="mailto:jonforrest.beck@gmail.com">jonforrest.beck@gmail.com</a><br>
<a href="http://www.shift8.biz">http://www.shift8.biz</a><br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--">http://www.api-digital.com--</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--">http://www.api-digital.com--
</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
<br>
Alessandro R. <o:p></o:p></span></font></p>
</div>
</body>
</html>