<div dir="ltr"><div><br></div>hello,<div><br></div><div>1- Can freeswitch.dbh be used directly as core dsn (without ODBC Like the DSN used at freeswitch startup). If yes would it support connection pooling? </div><div><br></div><div>I believe you must use odbc. As someone said before, yes, it will use connection pooling.</div><div><br></div><div>2- Can freeswitch.dbh be used to connect to some different database (Then core database) in lua scripts?</div><div><br></div><div>Yes, you can connect to any db. In the case of MySQL it&#39;s like so:</div><div><br></div><div><div>/etc/odbc.ini</div><div><div><div>[freeswitch]</div><div>Driver<span class="" style="white-space:pre">                </span>= /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so</div><div>SERVER<span class="" style="white-space:pre">                </span>= [SERVER-IP]</div><div>PORT<span class="" style="white-space:pre">                </span>= 3306</div><div>DATABASE<span class="" style="white-space:pre">        </span>= [DATABASE]</div><div>OPTION<span class="" style="white-space:pre">                </span>= 67108864</div><div>USER<span class="" style="white-space:pre">                </span>= [USER]</div><div>PASSWORD<span class="" style="white-space:pre">        </span>= [PASSWORD]</div></div><div><br></div><div><br></div><div><div><div>[my_other_db]</div><div>Driver<span class="" style="white-space:pre">                </span>= /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so</div><div>SERVER<span class="" style="white-space:pre">                </span>= [SERVER-IP]</div><div>PORT<span class="" style="white-space:pre">                </span>= 3306</div><div>DATABASE<span class="" style="white-space:pre">        </span>= [DATABASE]</div><div>OPTION<span class="" style="white-space:pre">                </span>= 67108864</div><div>USER<span class="" style="white-space:pre">                </span>= [USER]</div><div>PASSWORD<span class="" style="white-space:pre">        </span>= [PASSWORD]</div></div><div><br></div></div></div></div><div><div>/etc/odbcinst.ini</div><div>[MySQL]</div><div>Description<span class="" style="white-space:pre">        </span>= MySQL driver</div><div>Driver<span class="" style="white-space:pre">                </span>= /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so</div><div>Setup<span class="" style="white-space:pre">                </span>= /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so</div><div>UsageCount<span class="" style="white-space:pre">        </span>= 1</div><div>FileUsage       = 1</div><div>Threading       = 0</div></div><div><br></div><div><br></div><div><br></div><div><div>function dbConnect()</div><div><span class="" style="white-space:pre">        </span>conn = freeswitch.Dbh(&quot;odbc://my_other_db:user:passw&quot;);</div><div><span class="" style="white-space:pre">        </span>assert(conn:connected())</div><div>end</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 14, 2015 at 8:24 AM, John Nash <span dir="ltr">&lt;<a href="mailto:john.nash778@gmail.com" target="_blank">john.nash778@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Thank you.<br><br></div>I have compiled freeswitch with postgresql core as per <a href="https://freeswitch.org/confluence/display/FREESWITCH/PostgreSQL+in+the+core" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/PostgreSQL+in+the+core</a><br></div>I read many documentation pages but am still confused on few points...<br><br></div>1- Can freeswitch.dbh be used directly as core dsn (without ODBC Like the DSN used at freeswitch startup). If yes would it support connection pooling? <br><br></div>2- Can freeswitch.dbh be used to connect to some different database (Then core database) in lua scripts?<br><div><div><br><br><br><br><br><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jan 14, 2015 at 2:06 AM, Bote Man <span dir="ltr">&lt;<a href="mailto:bote_radio@botecomm.com" target="_blank">bote_radio@botecomm.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black">Surely you mean the Confluence pages at<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"><a href="https://freeswitch.org/confluence/display/FREESWITCH/Lua+freeswitch+dbh" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/Lua+freeswitch+dbh</a><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"><a href="https://freeswitch.org/confluence/display/FREESWITCH/Databases" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/Databases</a> (formerly DSN)<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black">That nasty old wiki is deprecated, I don&#39;t know why people are still linking to it.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black">Bote<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p><div style="border-style:none none none solid;border-left-color:blue;border-left-width:1.5pt;padding:0in 0in 0in 4pt"><div><div style="border-style:solid none none;border-top-color:rgb(181,196,223);border-top-width:1pt;padding:3pt 0in 0in"><p class="MsoNormal"><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,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>On Behalf Of </b>Steven Ayre<br><b>Sent:</b> Tuesday, 13 January, 2015 09:19<br><b>To:</b> FreeSWITCH Users Help<br><b>Subject:</b> Re: [Freeswitch-users] Database query from dialplan<u></u><u></u></span></p></div></div><div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Use freeswitch.Dbh (<a href="https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh" target="_blank">https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh</a>)<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">It&#39;s stable and uses FreeSWITCH&#39;s connection pools.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">It supports any FreeSWITCH DSNs - so sqlite, ODBC or postgresql native driver.<u></u><u></u></p></div><div><p class="MsoNormal"><a href="https://wiki.freeswitch.org/wiki/DSN" target="_blank">https://wiki.freeswitch.org/wiki/DSN</a><u></u><u></u></p></div></div></div></div></div></div></div><br></div></div><span class="">_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></span></blockquote></div><br></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" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" 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" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">DVG<br><br>-- <br>Imagination is more important than knowledge<br>Albert Einstein</div>
</div></div></div>