[Freeswitch-users] Lua script not working in Freeswitch

Joli Martinez mrjoli021 at gmail.com
Sat Jan 4 06:43:13 MSK 2014


attached is from 23-31.  All the python script does is connects to the mysql db and returns a string back.  I had to do it this way because the luasql was having the same issue.  Script works when called via commandline, but when called in FS it fails.


pythonResult = assert (io.popen ('/usr/bin/python python2lua.py ' ..callerID))


freeswitch.consoleLog("INFO","--------------------------------------------------\n");
        freeswitch.consoleLog("INFO", "got here OK \n");
        freeswitch.consoleLog("INFO","---------------------------------------------------\n");


freeswitch.consoleLog("INFO", '|'..pythonResult.. "-----\n");
On Jan 3, 2014, at 10:07 PM, Erik M. Devane - Comms Guy <emdevane at gmail.com> wrote:

> Are you using .. in your script somewhere?
> 
> There may be some work (like converting to string) that happens on the command line, but won't in dialplan use.
> 
> Can we see line 31 of your script?
> 
> On Friday, January 3, 2014, Joli Martinez wrote:
> Hello,
> 
> I have a script that connects to a mysql db.  The script works perfect when I type "lua  <scriptname>", but when I have Freeswitch all the script I get the following error message.  I have changed my script to now call a python script to read the database and I am experiencing the same result.  If I call the script from the command line it works but Freeswitch throws this error.
> 
> Please help,
> 
> Thanks,
> 
> 2014-01-03 18:52:28.381720 [ERR] mod_lua.cpp:199 /usr/local/freeswitch/scripts/testCallerID.lua:31: attempt to concatenate global 'pythonResult' (a userdata value)
> stack traceback:
> 	/usr/local/freeswitch/scripts/testCallerID.lua:31: in main chunk
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> 
> 
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140103/4eaf1348/attachment-0001.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list