<div dir="ltr"><div>Hi,</div><div><br></div>Effectively Joel, the problem was with LUA versions / compilations but I do not remember ever manually compiling it.<div><br></div><div>I tried several versions available in the repositories (ubuntu 16.04), 5.0, 5.1, 5.2 and 5.3, uninstalling LUA completely before installing a new version and specifying the PATH in the XML, even using luarocks but the problem persisted again and again.<br></div><div><br></div><div><div>Finally the solution was to use 'luaver' to install specifically the versions of LUA and luarocks and I already managed to make it work.</div><div><br></div><div>The couple of versions that worked for me were:</div><div><br></div><div>- lua 5.2.4</div><div>- luarocks 2.2.2</div></div><div><br></div><div>Thanks to all.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><p style="font-size:12.8px"><span style="font-size:12.8px">José David Jurado Alonso </span></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">El mié., 22 ago. 2018 a las 19:51, Jurijs Ivolga (<<a href="mailto:jurijs.ivolga@gmail.com">jurijs.ivolga@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I'm doing in following way:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>function postbla(bla)<br><br><br>local body =<br>[[<br>{<br> "bla": "]]..bla..[["<br>}<br>]]<br><br>path = pathzzz .. "postbla"<br><br>c = curl.easy{<br> url = path,<br> post = true,<br> httpheader = {<br> "Content-Type: application/json";<br> };<br> postfields = body;<br>}<br><br><br> c:perform{<br> writefunction = function(s)<br> res = s<br> end<br> }<br><br>statuscode = c:getinfo_response_code()<br><br>return statuscode, res, body<br><br>end<br></div></blockquote><div><br></div><div><div><div dir="ltr" class="m_6015940901946378595gmail_signature"><div dir="ltr">Jurijs<br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 21, 2018 at 11:19 PM Jose David Jurado Alonso <<a href="mailto:josedavid@zennio.com" target="_blank">josedavid@zennio.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><pre class="m_6015940901946378595m_-3121348840927180298gmail-tw-data-text m_6015940901946378595m_-3121348840927180298gmail-tw-ta m_6015940901946378595m_-3121348840927180298gmail-tw-text-small" id="m_6015940901946378595m_-3121348840927180298gmail-tw-target-text" style="height:144px" dir="ltr"><span lang="en">Thank you very much David, if you find the script it would be a great help.
I have been on vacation and I have not been able to try much more in this time.</span></pre><div class="gmail_extra"><div><div class="m_6015940901946378595m_-3121348840927180298gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><p style="font-size:12.8px"><span style="font-size:small">2018-08-03 20:07 GMT+02:00 David Villasmil </span><span dir="ltr" style="font-size:small"><<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>></span><span style="font-size:small">:</span><br></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Oh this took me some time to figure out, i'll dig up ny script and share it with you.</p>
<br><div class="gmail_quote"><div><div class="m_6015940901946378595m_-3121348840927180298h5"><div dir="ltr">On Fri, Aug 3, 2018, 13:16 Jose David Jurado Alonso <<a href="mailto:josedavid@zennio.com" target="_blank">josedavid@zennio.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_6015940901946378595m_-3121348840927180298h5"><div dir="ltr">Hi,<div><br>I have tried to make a HTTP POST request from LUA script but it does not work correctly in any way.<div><div><br></div><div>This is an example of the errors that I have obtained:
<div><br></div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 2018-08-03 12:23:07.981581 [ERR] mod_lua.cpp:203 error loading module socket.core from file /usr/local/lib/lua/5.1/socket/core.so:</font></div></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 <span style="white-space:pre-wrap"> </span>/usr/local/lib/lua/5.1/socket/core.so: undefined symbol: lua_pcall</font></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 stack traceback:</font></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 <span style="white-space:pre-wrap"> </span>[C]: in ?</font></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 <span style="white-space:pre-wrap"> </span>[C]: in function require</font></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 <span style="white-space:pre-wrap"> </span>/usr/local/share/lua/5.1/socket.lua:12: in main chunk</font></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 <span style="white-space:pre-wrap"> </span>[C]: in function require</font></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 <span style="white-space:pre-wrap"> </span>/usr/local/share/lua/5.1/socket/http.lua:10: in main chunk</font></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 <span style="white-space:pre-wrap"> </span>[C]: in function require</font></div></div></div></div><div><div><div><div><font face="times new roman, serif">09802b39-524f-4011-ada7-418e6a870248 <span style="white-space:pre-wrap"> </span>/usr/share/freeswitch/scripts/test.lua:3: in main chunk</font></div></div></div></div></blockquote><div><div><div><br></div></div><div><br></div><div>The lua script is:</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div><font face="times new roman, serif">local http = require "socket.http";</font></div></div></div><div><div><div><font face="times new roman, serif"><br></font></div></div></div><div><div><div><font face="times new roman, serif">local req_url = "<a href="http://localhost/" target="_blank">http://localhost/</a>"</font></div></div></div><div><div><div><font face="times new roman, serif"><br></font></div></div></div><div><div><div><font face="times new roman, serif">http.request{</font></div></div></div><div><div><div><font face="times new roman, serif"> url = req_url,</font></div></div></div><div><div><div><font face="times new roman, serif"> method = "POST"</font></div></div></div><div><div><div><font face="times new roman, serif">}</font></div></div></div></blockquote><div><div><br></div><div><br></div><div>I tried several tutorials and several configurations:</div><div><br></div><div><ul><li><a href="https://freeswitch.org/confluence/display/FREESWITCH/Installing+LuaSocket" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/Installing+LuaSocket</a><br></li><li><a href="https://freeswitch.org/confluence/display/FREESWITCH/Third+Party+Libraries" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/Third+Party+Libraries</a> with <a href="https://luarocks.org/modules/jakeg/lua-requests" target="_blank"> https://luarocks.org/modules/jakeg/lua-requests</a><br></li></ul><div>And some other things that I do not remember but always fail for some "undefined symbol".</div></div></div><div><br></div><div>Any ideas? Thanks!</div><div><br></div><div>José D.</div></div></div></div>
_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer" target="_blank">https://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" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer" target="_blank">https://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" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br></blockquote></div><br></div></div>
_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer" target="_blank">https://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" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>
_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer" target="_blank">https://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" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>