<div dir="ltr">In FreeSWITCH you're better off using <a href="https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh">https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh</a> than luasql - I've seen reports on the ML of stability problems with the latter</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On 4 January 2014 03:43, Joli Martinez <span dir="ltr"><<a href="mailto:mrjoli021@gmail.com" target="_blank">mrjoli021@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">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.<div>
<br><div><br></div><div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)">pythonResult = <span style="color:#25b2bf">assert</span> (<span style="color:#25b2bf">io.popen</span> (<span style="color:#bc321c">'/usr/bin/python python2lua.py '</span> ..callerID))</div>
<div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px"><br></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px">
<br></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(188,50,28);background-color:rgb(254,244,156)"><span style="color:#000000">freeswitch.consoleLog(</span>"INFO"<span style="color:#000000">,</span>"--------------------------------------------------<span style="color:#ce33cc">\n</span>"<span style="color:#000000">);</span></div>
<div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)"> freeswitch.consoleLog(<span style="color:#bc321c">"INFO"</span>, <span style="color:#bc321c">"got here OK </span><span style="color:#ce33cc">\n</span><span style="color:#bc321c">"</span>);</div>
<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(188,50,28);background-color:rgb(254,244,156)"><span style="color:#000000"> freeswitch.consoleLog(</span>"INFO"<span style="color:#000000">,</span>"---------------------------------------------------<span style="color:#ce33cc">\n</span>"<span style="color:#000000">);</span></div>
<div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px"><br></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px">
<br></div><div style="margin:0px;font-size:11px;font-family:Menlo;background-color:rgb(254,244,156)">freeswitch.consoleLog(<span style="color:#bc321c">"INFO"</span>, <span style="color:#bc321c">'|'</span>..pythonResult.. <span style="color:#bc321c">"-----</span><span style="color:#ce33cc">\n</span><span style="color:#bc321c">"</span>);</div>
<div><div><div class="h5"><div>On Jan 3, 2014, at 10:07 PM, Erik M. Devane - Comms Guy <<a href="mailto:emdevane@gmail.com" target="_blank">emdevane@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite">
<div><div class="h5">Are you using .. in your script somewhere?<div><br></div><div>There may be some work (like converting to string) that happens on the command line, but won't in dialplan<span></span> use.</div><div>
<br></div><div>Can we see line 31 of your script?<br>
<br>On Friday, January 3, 2014, Joli Martinez wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hello,<div><br></div><div>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.</div>
<div><br></div><div>Please help,</div><div><br></div><div>Thanks,</div><div><br></div><div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(188,50,28);background-color:rgb(254,244,156)">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)</div>
<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(188,50,28);background-color:rgb(254,244,156)">stack traceback:</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(188,50,28);background-color:rgb(254,244,156)">
<span style="white-space:pre-wrap">        </span>/usr/local/freeswitch/scripts/testCallerID.lua:31: in main chunk</div></div><div><br></div></div></blockquote></div></div></div>
_________________________________________________________________________<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></blockquote></div><br></div></div></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>
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">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></blockquote></div><br></div>