<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
First of all test your odbc-connection via console:<br>
<tt>isql telco-ops dba c3podb@2012 -v</tt><br>
You should see a "Connected!"-Message. Do you?<br>
<br>
Second: yes I also had problems setting up odbc. The main
"problem/error" for me was, that documentation is sometimes
confusing. Here is my config. Please notice the [section] - namings:<br>
<br>
<tt>/etc/odbcinst.ini</tt><tt><br>
</tt><font color="#ff0000"><tt>[MySQL]</tt></font><tt><br>
</tt><tt>Description = MySQL ODBCMyODBC Driver</tt><tt><br>
</tt><tt>Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so</tt><tt><br>
</tt><tt>FileUsage = 1</tt><tt><br>
</tt><tt><br>
</tt><tt>/etc/odbc.ini</tt><tt><br>
</tt><font color="#3333ff"><tt>[MySQL-asterisk]</tt></font><tt><br>
</tt><tt>Description = MySQL ODBC Driver</tt><tt><br>
</tt><font color="#ff0000"><tt>Driver = MySQL</tt></font><tt><br>
</tt><tt>Socket = /var/run/mysqld/mysqld.sock</tt><tt><br>
</tt><tt>Server = localhost</tt><tt><br>
</tt><tt>User = my_username</tt><tt><br>
</tt><tt>Password = my_password</tt><tt><br>
</tt><tt>Database = my_database</tt><tt><br>
</tt><tt>Option = 3</tt><tt><br>
</tt><tt>Port =</tt><tt><br>
</tt><tt>Charset = utf8</tt><tt><br>
</tt><tt><br>
</tt><tt>/etc/asterisk/res_odbc.conf</tt><tt><br>
</tt><font color="#33cc00"><tt>[mysql]</tt></font><tt><br>
</tt><tt>enabled => yes</tt><tt><br>
</tt><font color="#3333ff"><tt>dsn => MySQL-asterisk</tt></font><tt><br>
</tt><tt>username => my_username</tt><tt><br>
</tt><tt>password => my_password</tt><tt><br>
</tt><tt>pre-connect => yes</tt><tt><br>
</tt><tt><br>
</tt><tt>/etc/asterisk/cdr_odbc.conf</tt><tt><br>
</tt><tt>[global]</tt><tt><br>
</tt><font color="#33cc00"><tt>dsn=mysql</tt></font><tt><br>
</tt><tt>loguniqueid=yes</tt><tt><br>
</tt><tt>dispositionstring=yes</tt><tt><br>
</tt><tt>table=cdr</tt><tt><br>
</tt><tt><br>
</tt><tt>/etc/asterisk/cel_odbc.conf</tt><tt><br>
</tt><tt>[first]</tt><tt><br>
</tt><font color="#33cc00"><tt>connection=mysql</tt></font><tt><br>
</tt><tt>table=cel</tt><code><br>
</code><br>
Additionally you will need some configurations for you
realtime-config. This config above is only for cdr- and cel-logging
via odbc.<br>
<br>
-Thorsten-<br>
<br>
<div class="moz-cite-prefix">Am 10.12.2012 12:23, schrieb
Chandrakant Solanki:<br>
</div>
<blockquote
cite="mid:CAKnB+B3WKLnCFkpWoJ=iwMvxsGktoDMMZkSqtN4frsSdrCWR=g@mail.gmail.com"
type="cite"><span style="font-family:verdana,sans-serif">/etc/odbc.ini<br>
<br>
[telco-ops]</span><br style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Description =
Asterisk realtime and other FUNC_ODBC access</span><br
style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Driver =
MySQL</span><br style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Server =
172.18.100.18</span><br style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Socket =
/var/lib/mysql/data3306/mysql.sock</span><br
style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">User = dba</span><br
style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Password =
c3podb@2012</span><br style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Database =
mytelcoexample</span><br style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Port =
3306</span><br style="font-family:verdana,sans-serif">
<span style="font-family:verdana,sans-serif">Option = 3</span><br
style="font-family:verdana,sans-serif">
<br style="font-family:verdana,sans-serif">
<div style="font-family:verdana,sans-serif" class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Dec 10, 2012 at 4:34 PM,
Thorsten Göllner <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:tg@ovm-group.com"
target="_blank">tg@ovm-group.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Am 10.12.2012 06:37,
schrieb Chandrakant Solanki:
<div>
<div class="h5"><br>
<blockquote type="cite">Hi All,<br>
<br>
OS : CentOS 5 64bit OS & Machine<br>
Asterisk: 1.8.13.0<br>
ODBC Packages:<br>
unixODBC-2.2.11-7.1<br>
mysql-connector-odbc-3.51.12-2.2<br>
unixODBC-devel-2.2.11-7.1<br>
<br>
res_odbc.conf<br>
<br>
[telco-ops]<br>
enabled => yes<br>
dsn => telco-ops<br>
username => dba<br>
password => c3podb@2012<br>
pre-connect => yes<br>
sanitysql => select 1<br>
idlecheck => 15<br>
;isolation => repeatable_read<br>
pooling => yes<br>
limit => 3600<br>
connect_timeout => 10<br>
negative_connection_cache => 30<br>
<br>
Above is my installation package and configuration
file (res_odbc.conf), when I try to execute "odbc
show all" it always gives below output.<br>
<br>
<br>
*CLI> odbc show all<br>
<br>
ODBC DSN Settings<br>
-----------------<br>
<br>
Name: telco-ops<br>
DSN: telco-ops<br>
Last connection attempt: 1970-01-01 00:00:00<br>
Pooled: Yes<br>
Limit: 3600<br>
Connections in use: 1<br>
- Connection 1: connected<br>
<br>
When Insert/Update/Select query will be executed, it
can't update last connection attempt field. In
result, ODBC stuck after few minutes, and in this
case I also need to restart asterisk, because I
can't type any command, it can't give any command's
output.<br>
<br>
Also updated asterisk with 10.9.0, but same result.<br>
<br>
</blockquote>
<br>
</div>
</div>
Please show us /etc/odbc.ini too.<br>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>