<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 =&gt; yes</tt><tt><br>
    </tt><font color="#3333ff"><tt>dsn =&gt; MySQL-asterisk</tt></font><tt><br>
    </tt><tt>username =&gt; my_username</tt><tt><br>
    </tt><tt>password =&gt; my_password</tt><tt><br>
    </tt><tt>pre-connect =&gt; 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&nbsp;&nbsp;&nbsp;&nbsp; =
        Asterisk realtime and other FUNC_ODBC access</span><br
        style="font-family:verdana,sans-serif">
      <span style="font-family:verdana,sans-serif">Driver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
        MySQL</span><br style="font-family:verdana,sans-serif">
      <span style="font-family:verdana,sans-serif">Server&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
        172.18.100.18</span><br style="font-family:verdana,sans-serif">
      <span style="font-family:verdana,sans-serif">Socket&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
        /var/lib/mysql/data3306/mysql.sock</span><br
        style="font-family:verdana,sans-serif">
      <span style="font-family:verdana,sans-serif">User&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = dba</span><br
        style="font-family:verdana,sans-serif">
      <span style="font-family:verdana,sans-serif">Password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
        c3podb@2012</span><br style="font-family:verdana,sans-serif">
      <span style="font-family:verdana,sans-serif">Database&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
        mytelcoexample</span><br style="font-family:verdana,sans-serif">
      <span style="font-family:verdana,sans-serif">Port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
        3306</span><br style="font-family:verdana,sans-serif">
      <span style="font-family:verdana,sans-serif">Option&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 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&ouml;llner <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:tg@ovm-group.com"
              target="_blank">tg@ovm-group.com</a>&gt;</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 &amp; 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 =&gt; yes<br>
                    dsn =&gt; telco-ops<br>
                    username =&gt; dba<br>
                    password =&gt; c3podb@2012<br>
                    pre-connect =&gt; yes<br>
                    sanitysql =&gt; select 1<br>
                    idlecheck =&gt; 15<br>
                    ;isolation =&gt; repeatable_read<br>
                    pooling =&gt; yes<br>
                    limit =&gt; 3600<br>
                    connect_timeout =&gt; 10<br>
                    negative_connection_cache =&gt; 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&gt; odbc show all<br>
                    <br>
                    ODBC DSN Settings<br>
                    -----------------<br>
                    <br>
                    &nbsp; Name:&nbsp;&nbsp; telco-ops<br>
                    &nbsp; DSN:&nbsp;&nbsp;&nbsp; telco-ops<br>
                    &nbsp;&nbsp;&nbsp; Last connection attempt: 1970-01-01 00:00:00<br>
                    &nbsp; Pooled: Yes<br>
                    &nbsp; Limit:&nbsp; 3600<br>
                    &nbsp; Connections in use: 1<br>
                    &nbsp;&nbsp;&nbsp; - 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>