<div dir="ltr">I wonder if assert actually returns a value. Perhaps you need to do the assert on pythonResult after it has been assigned to the return value of io.popen.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On 5 January 2014 02:05, Erik M. Devane - Comms Guy <span dir="ltr"><<a href="mailto:emdevane@gmail.com" target="_blank">emdevane@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>Do you get a more clear error if you use :</div><div><br></div><div>freeswitch.consoleLog("INFO", <span></span>pythonResult);</div><div><br></div><div>(Wondering if you're hitting a character limit or it doesn't like mixing quote types).</div>
<div><br></div><div>Or does:</div><div><br></div><div>freeswitch.consoleLog("INFO", '|'..tostring(pythonResult).. "-----\n");</div><div><br></div><div>Work better?</div><div class="HOEnZb"><div class="h5">
<div><div><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">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>On Jan 3, 2014, at 10:07 PM, Erik M. Devane - Comms Guy <<a>emdevane@gmail.com</a>> wrote:</div><br><blockquote type="cite">
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>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a>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>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></blockquote></div></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>