Lua FreeSWITCH 1.6 dbh and PostgreSQL
Hello everybody, How can i connect to postgres database from lua through freeswitch.dbh ? I tried local dbh = freeswitch.dbh("pgsql://hostaddr=127.0.0.1 dbname=some_db user=uname password='passwd'") -- returns nil local dbh = freeswitch.dbh("odbc://some_db:uname:passwd") -- returns nil too Also I set up ODBS with PostgreSQL driver. If I run this command in console: isql some_db uname passwd then I can successfully connect to my database. What am i doing wrong? Also I tried to link odbc*.ini files for freeswitch: mkdir /usr/local/freeswitch/etc ln -s /etc/odbcinst.ini /usr/local/freeswitch/etc/odbcinst.ini ln -s /etc/odbc.ini /usr/local/freeswitch/etc/odbc.ini but it doesn't help too. Thanks in advance. -- Arthur
Works for me in 1.4-1.7: local dbh = freeswitch.Dbh("odbc://dbname:user:password") -- connect to ODBC database maybe the big D in Dbh ? Von: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] Im Auftrag von Artur Mega Gesendet: Dienstag, 26. Januar 2016 09:04 An: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Betreff: [Freeswitch-users] Lua FreeSWITCH 1.6 dbh and PostgreSQL Hello everybody, How can i connect to postgres database from lua through freeswitch.dbh ? I tried local dbh = freeswitch.dbh("pgsql://hostaddr=127.0.0.1 dbname=some_db user=uname password='passwd'") -- returns nil local dbh = freeswitch.dbh("odbc://some_db:uname:passwd") -- returns nil too Also I set up ODBS with PostgreSQL driver. If I run this command in console: isql some_db uname passwd then I can successfully connect to my database. What am i doing wrong? Also I tried to link odbc*.ini files for freeswitch: mkdir /usr/local/freeswitch/etc ln -s /etc/odbcinst.ini /usr/local/freeswitch/etc/odbcinst.ini ln -s /etc/odbc.ini /usr/local/freeswitch/etc/odbc.ini but it doesn't help too. Thanks in advance. -- Arthur
Thank you! Now it works! I copy/pasted from examples in documentation at https://freeswitch.org/confluence/display/FREESWITCH/Lua+FreeSWITCH+dbh You see, there freeswitch.dbh with small d. Bug in docs) need to correct. 2016-01-26 16:10 GMT+05:00 Marcel Haldemann <marcel.haldemann@convercom.ch>:
Works for me in 1.4-1.7:
local dbh = freeswitch.Dbh("odbc://dbname:user:password") -- connect to ODBC database
maybe the big D in Dbh ?
*Von:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *Im Auftrag von *Artur Mega *Gesendet:* Dienstag, 26. Januar 2016 09:04 *An:* FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> *Betreff:* [Freeswitch-users] Lua FreeSWITCH 1.6 dbh and PostgreSQL
Hello everybody, How can i connect to postgres database from lua through freeswitch.dbh ?
I tried
local dbh = freeswitch.dbh("pgsql://hostaddr=127.0.0.1 dbname=some_db user=uname password='passwd'") -- returns nil
local dbh = freeswitch.dbh("odbc://some_db:uname:passwd") -- returns nil too
Also I set up ODBS with PostgreSQL driver. If I run this command in console:
isql some_db uname passwd
then I can successfully connect to my database. What am i doing wrong? Also I tried to link odbc*.ini files for freeswitch:
mkdir /usr/local/freeswitch/etc
ln -s /etc/odbcinst.ini /usr/local/freeswitch/etc/odbcinst.ini
ln -s /etc/odbc.ini /usr/local/freeswitch/etc/odbc.ini
but it doesn't help too. Thanks in advance.
--
Arthur
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Arthur
Fixed a bunch of these on this page and a related page paralell to this one too... Thanks
On Jan 26, 2016, at 12:40 PM, Artur Mega <findmeinwland@gmail.com> wrote:
Thank you! Now it works! I copy/pasted from examples in documentation at https://freeswitch.org/confluence/display/FREESWITCH/Lua+FreeSWITCH+dbh <https://freeswitch.org/confluence/display/FREESWITCH/Lua+FreeSWITCH+dbh>
You see, there freeswitch.dbh with small d. Bug in docs) need to correct.
2016-01-26 16:10 GMT+05:00 Marcel Haldemann <marcel.haldemann@convercom.ch <mailto:marcel.haldemann@convercom.ch>>: Works for me in 1.4-1.7:
local dbh = freeswitch.Dbh("odbc://dbname:user:password") -- connect to ODBC database
maybe the big D in Dbh ?
Von: freeswitch-users-bounces@lists.freeswitch.org <mailto:freeswitch-users-bounces@lists.freeswitch.org> [mailto:freeswitch-users-bounces@lists.freeswitch.org <mailto:freeswitch-users-bounces@lists.freeswitch.org>] Im Auftrag von Artur Mega Gesendet: Dienstag, 26. Januar 2016 09:04 An: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org <mailto:freeswitch-users@lists.freeswitch.org>> Betreff: [Freeswitch-users] Lua FreeSWITCH 1.6 dbh and PostgreSQL
Hello everybody, How can i connect to postgres database from lua through freeswitch.dbh ?
I tried
local dbh = freeswitch.dbh("pgsql://hostaddr=127.0.0.1 dbname=some_db user=uname password='passwd'") -- returns nil
local dbh = freeswitch.dbh("odbc://some_db:uname:passwd") -- returns nil too
Also I set up ODBS with PostgreSQL driver. If I run this command in console:
isql some_db uname passwd
then I can successfully connect to my database. What am i doing wrong? Also I tried to link odbc*.ini files for freeswitch:
mkdir /usr/local/freeswitch/etc
ln -s /etc/odbcinst.ini /usr/local/freeswitch/etc/odbcinst.ini
ln -s /etc/odbc.ini /usr/local/freeswitch/etc/odbc.ini
but it doesn't help too. Thanks in advance.
--
Arthur
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
Official FreeSWITCH Sites http://www.freeswitch.org <http://www.freeswitch.org/> http://confluence.freeswitch.org <http://confluence.freeswitch.org/> http://www.cluecon.com <http://www.cluecon.com/>
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://www.freeswitch.org <http://www.freeswitch.org/>
--
Arthur _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
it's freeswitch.Dbh with a capital D. On Tue, Jan 26, 2016 at 3:03 AM, Artur Mega <findmeinwland@gmail.com> wrote:
Hello everybody, How can i connect to postgres database from lua through freeswitch.dbh ?
I tried local dbh = freeswitch.dbh("pgsql://hostaddr=127.0.0.1 dbname=some_db user=uname password='passwd'") -- returns nil local dbh = freeswitch.dbh("odbc://some_db:uname:passwd") -- returns nil too
Also I set up ODBS with PostgreSQL driver. If I run this command in console:
isql some_db uname passwd
then I can successfully connect to my database. What am i doing wrong? Also I tried to link odbc*.ini files for freeswitch:
mkdir /usr/local/freeswitch/etc ln -s /etc/odbcinst.ini /usr/local/freeswitch/etc/odbcinst.ini ln -s /etc/odbc.ini /usr/local/freeswitch/etc/odbc.ini
but it doesn't help too. Thanks in advance.
--
Arthur
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (4)
-
Abaci B
-
Artur Mega
-
Marcel Haldemann
-
Michael Jerris