<div dir="ltr"><div class="gmail_default" style="font-size:small">Thank you! Now it works! I copy/pasted from examples in documentation at <a href="https://freeswitch.org/confluence/display/FREESWITCH/Lua+FreeSWITCH+dbh">https://freeswitch.org/confluence/display/FREESWITCH/Lua+FreeSWITCH+dbh</a></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You see, there freeswitch.dbh with small d. Bug in docs) need to correct.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-26 16:10 GMT+05:00 Marcel Haldemann <span dir="ltr">&lt;<a href="mailto:marcel.haldemann@convercom.ch" target="_blank">marcel.haldemann@convercom.ch</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="DE-CH" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Works for me in 1.4-1.7:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">local dbh = freeswitch.Dbh(&quot;odbc://dbname:user:password&quot;) -- connect to ODBC database<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">maybe the big D in Dbh ?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="DE" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">Von:</span></b><span lang="DE" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>Im Auftrag von </b>Artur Mega<br>
<b>Gesendet:</b> Dienstag, 26. Januar 2016 09:04<br>
<b>An:</b> FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
<b>Betreff:</b> [Freeswitch-users] Lua FreeSWITCH 1.6 dbh and PostgreSQL<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello everybody,<br>
How can i connect to postgres database from lua through freeswitch.dbh ? <u></u><u></u></p>
<div>
<p class="MsoNormal">I tried<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">local dbh = freeswitch.dbh(&quot;pgsql://hostaddr=127.0.0.1 dbname=some_db user=uname password=&#39;passwd&#39;&quot;) -- returns nil<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">local dbh = freeswitch.dbh(&quot;odbc://some_db:uname:passwd&quot;) -- returns nil too<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Also I set up ODBS with PostgreSQL driver. If I run this command in console:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">            isql some_db uname passwd<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">then I can successfully connect to my database. What am i doing wrong? Also I tried to link odbc*.ini files for freeswitch:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">            mkdir /usr/local/freeswitch/etc<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">            ln -s /etc/odbcinst.ini /usr/local/freeswitch/etc/odbcinst.ini<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">            ln -s /etc/odbc.ini /usr/local/freeswitch/etc/odbc.ini<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">but it doesn&#39;t help too. Thanks in advance.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><br>
Arthur<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
</div>

<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><br>Arthur</div></div></div></div>
</div>