<div dir="ltr">Thanks John,<div><br></div><div>At first got an error using MySQL-asterisk, but then I removed /etc/ ini files and used the DSN in /<span style="font-size:12.8000001907349px">usr/local/etc/odbc.ini, that did the trick for isql. I must have created the files /etc/ while following a guide online. Nice!</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">After some meddling with the Asterisk conf files to have the correct values I got the cdrs working, thanks dude!</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">cheers,</span></div><div><span style="font-size:12.8000001907349px">Olli</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-03 18:04 GMT+02:00 John Kiniston <span dir="ltr"><<a href="mailto:johnkiniston@gmail.com" target="_blank">johnkiniston@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I notice you have MySQL-asterisk as your definition in your odbc.ini but you are trying to connect to simply 'MySQL' with your 'isql' command.<br><br></div>Does isql work with 'MySQL-asterisk' as the DSN instead of simply 'MySQL' ?<br><br></div>I have machines that use /etc/odbc.ini and machines that use /usr/local/etc/odbc.ini depending on if I used a package to instal ODBC or if I compiled ODBC myself.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Feb 3, 2015 at 1:35 AM, Olli Heiskanen <span dir="ltr"><<a href="mailto:ohjelmistoarkkitehti@gmail.com" target="_blank">ohjelmistoarkkitehti@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><br></div><div>Hello,</div><div><br></div><div>I'm stuck with getting cdr records stored in MySql database. I have a working realtime environment and have verified that the db connection works fine when used via res_config_mysql.conf. I'd appreciate Your help on how to get the odbc connector working as I think there's something wrong with its configuration.</div><div><br></div><div>The problem presented itself as an error when making a call that was supposed to be stored in mysql cdr: Unable to retrieve database handle. CDR failed.</div><div>This kept popping up every time I was trying to have a call be stored in my mysql cdr table, and I traced the problem to the odbc connector, where my knowhow is about to end. </div><div><br></div><div>One problem may be that odbcinst -j outputs wrong ini files, I believe I need these to be under /etc/ instead of /usr/local/etc/, but I'm unsure about how to change those permanently.</div><div><br></div><div># odbcinst -j</div><div>unixODBC 2.3.2</div><div>DRIVERS............: /usr/local/etc/odbcinst.ini</div><div>SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini</div><div>FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources</div><div>USER DATA SOURCES..: /root/.odbc.ini</div><div>SQLULEN Size.......: 4</div><div>SQLLEN Size........: 4</div><div>SQLSETPOSIROW Size.: 2</div><div><br></div><div>Odbcinst does see the connection, it reads it from /usr/local/etc/odbcinst.ini.</div><div># odbcinst -q -d</div><div>[MySQL]</div><div><br></div><div>I tried copying my connection information onto those files listed above and I'm not getting any errors in Asterisk logs when restarting Asterisk. However:</div><div># echo "select 1" | isql -v MySQL</div><div>[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified</div><div>[ISQL]ERROR: Could not SQLConnect</div><div><br></div><div><br></div><div>Here's the contents of odbc.ini:</div><div><br></div><div>[MySQL-asterisk]</div><div>Description = MySQL Asterisk database</div><div>Trace = Off</div><div>TraceFile = stderr</div><div>Driver = MySQL</div><div>SERVER = serverip</div><div>USER = myuser</div><div>PASSWORD = mypass</div><div>PORT = 3306</div><div>DATABASE = asterisk</div><div><br></div><div>And odbcinst.ini:</div><div>[MySQL]</div><div>Description = ODBC for MySQL</div><div>Driver = /usr/lib/libmyodbc5.so</div><div>Setup = /usr/lib/libodbcmyS.so</div><div>Driver64 = /usr/lib64/libmyodbc5.so</div><div>Setup64 = /usr/lib64/libodbcmyS.so</div><div>FileUsage = 1</div><div><br></div><div>And here I hit a wall, how can I fix the configuration? </div><div><br></div><div><br></div><div>MySQL-asterisk is referred to in res_odbc.conf, whose label is referred to in cdr_odbc.conf. When the odbc connector starts working, is this the correct way to configure the cdr db connection in Asterisk?</div><div><br></div><div>Thanks,</div><div>Olli</div></div>
<br></div></div><span class="HOEnZb"><font color="#888888">--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</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" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div>A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.<br>---Heinlein</div>
</font></span></div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</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" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br></div>