Hi, I tried executing a simple DB query in lua script in freeswitch. dbh:execute{"Select * from dir_users"} But I got this error 2013-02-12 14:09:56.247165 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/directory.lua:184: attempt to call method 'execute' (a nil value) stack traceback: /usr/local/freeswitch/scripts/directory.lua:184: in main chunk 2013-02-12 14:09:56.247165 [ERR] mod_lua.cpp:264 LUA script parse/execute error! Can anyone please point what is the mistake I have done and why execute method is not being recognised? Thanks. Regards, Archana
Maybe because dbh has no 'execute' method? Try with: dbh:query(sql) Regards, François. On Tue, 2013-02-12 at 14:15 +0000, Archana Venugopan wrote:
Hi,
I tried executing a simple DB query in lua script in freeswitch.
dbh:execute{"Select * from dir_users"}
But I got this error
2013-02-12 14:09:56.247165 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/directory.lua:184: attempt to call method 'execute' (a nil value)
stack traceback:
/usr/local/freeswitch/scripts/directory.lua:184: in main chunk
2013-02-12 14:09:56.247165 [ERR] mod_lua.cpp:264 LUA script parse/execute error!
Can anyone please point what is the mistake I have done and why execute method is not being recognised? Thanks.
Regards,
Archana
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
Dbh:query works. But I want execute a Stored procedure. In that case what can I use? Please suggest. Many thanks. Regards, Archana -----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of François Delawarde Sent: 12 February 2013 14:31 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Calling db in lua script Maybe because dbh has no 'execute' method? Try with: dbh:query(sql) Regards, François. On Tue, 2013-02-12 at 14:15 +0000, Archana Venugopan wrote:
Hi,
I tried executing a simple DB query in lua script in freeswitch.
dbh:execute{"Select * from dir_users"}
But I got this error
2013-02-12 14:09:56.247165 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/directory.lua:184: attempt to call method 'execute' (a nil value)
stack traceback:
/usr/local/freeswitch/scripts/directory.lua:184: in main chunk
2013-02-12 14:09:56.247165 [ERR] mod_lua.cpp:264 LUA script parse/execute error!
Can anyone please point what is the mistake I have done and why execute method is not being recognised? Thanks.
Regards,
Archana
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
Try that: sql=" {call procedure_name()}" dbh:query(sql, mycallback) (don't forget to define your callback function, mycallback in this case) Regards, François. On Tue, 2013-02-12 at 14:35 +0000, Archana Venugopan wrote:
Dbh:query works. But I want execute a Stored procedure. In that case what can I use? Please suggest. Many thanks.
Regards, Archana
-----Original Message----- From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of François Delawarde Sent: 12 February 2013 14:31 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] Calling db in lua script
Maybe because dbh has no 'execute' method?
Try with: dbh:query(sql)
Regards, François.
On Tue, 2013-02-12 at 14:15 +0000, Archana Venugopan wrote:
Hi,
I tried executing a simple DB query in lua script in freeswitch.
dbh:execute{"Select * from dir_users"}
But I got this error
2013-02-12 14:09:56.247165 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/directory.lua:184: attempt to call method 'execute' (a nil value)
stack traceback:
/usr/local/freeswitch/scripts/directory.lua:184: in main chunk
2013-02-12 14:09:56.247165 [ERR] mod_lua.cpp:264 LUA script parse/execute error!
Can anyone please point what is the mistake I have done and why execute method is not being recognised? Thanks.
Regards,
Archana
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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 _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.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 (2)
-
Archana Venugopan
-
François Delawarde