Ah I've spotted it. There's a bug in the code for detecting the old-style ODBC DSNs.<div><br></div><div><div>switch_core_sqldb.c:344 } else if ((!(i = strncasecmp(dsn, "odbc://", 7))) || strchr(dsn, ':')) {</div>
<div><br></div><div>This will match any DSN containing a ':' which obviously sqlite:// will. Therefore although the sqlite:// prefix is recognised and skipped over, that code path will never get reached.</div><div>
<br></div><div>The plain filename works because anything not odbc/pgsql is assumed to be a sqlite filename (switch_core_sqldb.c:366).</div><div><br></div><div>I've raised this in Jira: <a href="http://jira.freeswitch.org/browse/FS-5074">http://jira.freeswitch.org/browse/FS-5074</a></div>
<div><br></div><div>-Steve</div><div>
<br><br><div class="gmail_quote">On 5 February 2013 17:54, François Delawarde <span dir="ltr"><<a href="mailto:fdelawarde@wirelessmundi.com" target="_blank">fdelawarde@wirelessmundi.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There you go.<br>
<br>
** My script test.lua is the following one liner:<br>
local dbh = freeswitch.Dbh("sqlite:///tmp/test.db")<br>
<br>
<br>
freeswitch@internal> lua test.lua<br>
-ERR no reply<br>
<br>
2013-02-05 18:50:47.230744 [ERR] switch_odbc.c:365 STATE: IM002 CODE 0 ERROR: [unixODBC][Driver Manager]Data source name not found, and no default driver specified<br>
<br>
2013-02-05 18:50:47.230744 [CRIT] switch_core_sqldb.c:504 Failure to connect to PGSQL sqlite!<br>
2013-02-05 18:50:47.230744 [ERR] freeswitch_lua.cpp:354 Connection failed. DBH NOT Connected.<br>
<br>
<br>
<br>
<br>
** Now if I change test.lua to:<br>
local dbh = freeswitch.Dbh("/tmp/test.db")<br>
<br>
<br>
freeswitch@internal> lua test.lua<br>
-ERR no reply<br>
<br>
<br>
No ERR or CRIT in this last one.<br>
<br>
<br>
Cheers,<br>
François.<br>
<div><div><br>
On Tue, 2013-02-05 at 16:42 +0000, Steven Ayre wrote:<br>
> FAIL => "sqlite:///tmp/test.db" (this one should work)<br>
><br>
><br>
> What error does this give?<br>
><br>
><br>
><br>
> On 5 February 2013 16:31, François Delawarde<br>
> <<a href="mailto:fdelawarde@wirelessmundi.com" target="_blank">fdelawarde@wirelessmundi.com</a>> wrote:<br>
> I'm on HEAD, but I must be doing something wrong, there is no<br>
> apparent<br>
> reason from the code.<br>
><br>
> On Tue, 2013-02-05 at 16:05 +0000, Steven Ayre wrote:<br>
> > Honestly, I only use ODBC... Maybe someone else can shed<br>
> some light?<br>
> ><br>
> > What version are you using?<br>
> ><br>
> > Steve<br>
> ><br>
> ><br>
> ><br>
> > On 5 Feb 2013, at 15:42, François Delawarde<br>
> <<a href="mailto:fdelawarde@wirelessmundi.com" target="_blank">fdelawarde@wirelessmundi.com</a>> wrote:<br>
> ><br>
> > > Steven, does "sqlite://" prefix work for you? Not sure if<br>
> it's a bug or<br>
> > > I'm doing something wrong. I tried the following from lua<br>
> dbh:<br>
> > ><br>
> > > FAIL => "sqlite:///tmp/test.db" (this one should work)<br>
> > > FAIL => "sqlite://tmp/test.db" (shouldn't work, but just<br>
> in case...)<br>
> > > OK => "/tmp/test.db" (no prefix)<br>
> > ><br>
> > > François.<br>
> > ><br>
> > ><br>
> > > On Tue, 2013-02-05 at 12:55 +0000, Steven Ayre wrote:<br>
> > >> core: was an old prefix? I knew that change broke some<br>
> ODBC DSNs<br>
> > >> (names without username+password, eg when they're<br>
> specified in<br>
> > >> odbc.ini) but hadn't realised that had been broken too -<br>
> that needs<br>
> > >> documenting as well on the Wiki I guess...<br>
> > >> <a href="http://wiki.freeswitch.org/wiki/Release_Notes#odbc-dsn" target="_blank">http://wiki.freeswitch.org/wiki/Release_Notes#odbc-dsn</a><br>
> > >><br>
> > >><br>
> > >> Just a thought for the developers, but perhaps modules<br>
> with odbc-dsn<br>
> > >> parameters should have this renamed to dsn or something<br>
> now since it's<br>
> > >> not odbc-specific at all any longer. Easy enough to<br>
> recognise both<br>
> > >> 'dsn' and 'odbc-dsn' names to remain backwards compatible<br>
> (which I've<br>
> > >> seen done with typos in config setting names in the past<br>
> > >> as precedent).<br>
> > >><br>
> > >><br>
> > >> -Steve<br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >> On 5 February 2013 11:03, François Delawarde<br>
> > >> <<a href="mailto:fdelawarde@wirelessmundi.com" target="_blank">fdelawarde@wirelessmundi.com</a>> wrote:<br>
> > >> The behavior recently changed from "core:<path>"<br>
> to<br>
> > >> "sqlite://<path>".<br>
> > >><br>
> > >> Update: I just tested and it seems that<br>
> "sqlite://<path>"<br>
> > >> doesn't work,<br>
> > >> but as sqlite is the default, you can just omit<br>
> the prefix and<br>
> > >> use<br>
> > >> "<path>" to make it work.<br>
> > >><br>
> > >> François.<br>
> > >><br>
> > >><br>
> > >> On Tue, 2013-02-05 at 10:37 +0000, Steven Ayre<br>
> wrote:<br>
> > >>> 'Failure to connect to PGSQL core' happens on ODBC<br>
> > >> connections, that<br>
> > >>> seems to be a minor bug in the error message.<br>
> > >>><br>
> > >>><br>
> > >>> From the unixODBC error it's interpreting this as a ODBC<br>
> > >> DSN. The<br>
> > >>> reason is the sqlite prefix is sqlite:// not core://<br>
> > >>> (see <a href="http://wiki.freeswitch.org/wiki/DSN" target="_blank">http://wiki.freeswitch.org/wiki/DSN</a>). You also<br>
> don't<br>
> > >> have enough<br>
> > >>> slashes.<br>
> > >>><br>
> > >>><br>
> > >>> Try:<br>
> > >>> local dbh =<br>
> > >><br>
> freeswitch.Dbh("sqlite:///usr/local/temp/database.db");<br>
> > >>><br>
> > >>><br>
> > >>><br>
> > >>> (note the 3 slashes - :// is standard URI format, the<br>
> 3rd<br>
> > >> indicates an<br>
> > >>> absolute path).<br>
> > >>><br>
> > >>><br>
> > >>> -Steve<br>
> > >>><br>
> > >>><br>
> > >>><br>
> > >>><br>
> > >>> On 5 February 2013 08:56, Carlo Dimaggio<br>
> > >> <<a href="mailto:jaasmailing@gmail.com" target="_blank">jaasmailing@gmail.com</a>><br>
> > >>> wrote:<br>
> > >>> Hi all!<br>
> > >>><br>
> > >>> I have a lua script in which i have a statement<br>
> that<br>
> > >> connects<br>
> > >>> to a sqlite db:<br>
> > >>><br>
> > >>> local dbh =<br>
> > >>><br>
> freeswitch.Dbh("core:/usr/local/temp/database.db");<br>
> > >>><br>
> > >>> but i receve in FS CLI this error that refers to<br>
> a<br>
> > >> Pgsql<br>
> > >>> instead of sqlite:<br>
> > >>><br>
> > >>> 2013-02-05 09:40:10.379612 [ERR]<br>
> switch_odbc.c:365<br>
> > >> STATE:<br>
> > >>> IM002 CODE 0 ERROR: [unixODBC][Driver<br>
> Manager]Data<br>
> > >> source name<br>
> > >>> not found, and no default driver specified<br>
> > >>> 2013-02-05 09:40:10.379612 [CRIT]<br>
> > >> switch_core_sqldb.c:504<br>
> > >>> Failure to connect to PGSQL core!<br>
> > >>> 2013-02-05 09:40:10.379612 [ERR]<br>
> > >> freeswitch_lua.cpp:354<br>
> > >>> Connection failed. DBH NOT Connected.<br>
> > >>> 2013-02-05 09:40:10.379612 [ERR]<br>
> > >> freeswitch_lua.cpp:435 DBH<br>
> > >>> NOT Connected.<br>
> > >>><br>
> > >>><br>
> > >>> Can you help me?<br>
> > >>><br>
> > >>> Best regards,<br>
> > >><br>
> _________________________________________________________________________<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>
> > >>> FreeSWITCH-powered IP PBX: The CudaTel<br>
> Communication<br>
> > >> Server<br>
> > >>> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
> > >><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > >><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>
> > >><br>
> _________________________________________________________________________<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>
> > >>> FreeSWITCH-powered IP PBX: The CudaTel Communication<br>
> Server<br>
> > >>> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
> > >><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > >><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>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> _________________________________________________________________________<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>
> > >> FreeSWITCH-powered IP PBX: The CudaTel<br>
> Communication Server<br>
> > >> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
> > >><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > >><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>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> _________________________________________________________________________<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>
> > >> FreeSWITCH-powered IP PBX: The CudaTel Communication<br>
> Server<br>
> > >> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
> > >><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > >><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>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> _________________________________________________________________________<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>
> > > FreeSWITCH-powered IP PBX: The CudaTel Communication<br>
> Server<br>
> > > <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
> > ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > ><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>
> ><br>
> ><br>
> _________________________________________________________________________<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>
> > FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
> > <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> ><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>
><br>
><br>
><br>
> _________________________________________________________________________<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>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
><br>
><br>
><br>
> _________________________________________________________________________<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>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
<br>
<br>
<br>
_________________________________________________________________________<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>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.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://wiki.freeswitch.org" target="_blank">http://wiki.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>
</div></div></blockquote></div><br></div></div>