<div dir="ltr">I found my answer: needed to link up another location in the lua config:<div>&lt;param name=&quot;script-directory&quot; value=&quot;/usr/share/lua/5.1/?.lua&quot;/&gt;<br></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Mon, Nov 25, 2013 at 6:04 PM, Neil Patel <span dir="ltr">&lt;<a href="mailto:neilp@cs.stanford.edu" target="_blank">neilp@cs.stanford.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Hi All,<div><br></div><div>I have FS 1.2 stable installed on fresh Ubuntu 12.04 LTS. I installed lua and lua socket libraries from package:</div><div><br></div># apt-get install lua5.1 liblua5.1-socket-dev liblua5.1-socket2<div>


<span><span style="vertical-align:baseline;font-size:12px;white-space:pre-wrap;background-color:transparent;font-family:Arial;font-weight:bold"><br></span></span></div>This installed socket module in /usr/lib/i386-linux-gnu/lua/5.1/, which I added as a module directory in lua.conf.xml.<div>


<br></div><div>When I attempt to run the command &quot;require &#39;socket.http&#39;&quot; in a lua script within FS, I get this error:</div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px">2013-11-25 10:14:38.394321 [ERR] mod_lua.cpp:199 /usr/local/freeswitch/scripts/test.lua:27: module &#39;socket.http&#39; not found:</div>


<div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">        </span>no field package.preload[&#39;socket.http&#39;]</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">        </span>no file &#39;./socket/http.lua&#39;</div>


<div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">        </span>no file &#39;/usr/local/share/lua/5.1/socket/http.lua&#39;</div><div style="font-family:arial,sans-serif;font-size:13px">


<span style="white-space:pre-wrap">        </span>no file &#39;/usr/local/share/lua/5.1/socket/http/init.lua&#39;</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">        </span>no file &#39;/usr/local/lib/lua/5.1/socket/http.lua&#39;</div>


<div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">        </span>no file &#39;/usr/local/lib/lua/5.1/socket/http/init.lua&#39;</div><div style="font-family:arial,sans-serif;font-size:13px">


<span style="white-space:pre-wrap">        </span>no file &#39;/usr/lib/i386-linux-gnu/lua/5.1/socket/http.so&#39;</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">        </span>no file &#39;/usr/lib/i386-linux-gnu/lua/5.1/socket.so&#39;</div>


<div style="font-family:arial,sans-serif;font-size:13px">stack traceback:</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">        </span>[C]: in function &#39;require&#39;</div></div>


<div><br></div><div>It&#39;s looking for http.so; however in the socket module library there are only the files core.so and unix.so<br></div><div><br></div><div>When I run lua interpreter from terminal and try the same require command, it works without complaint:</div>


<div><br></div><div><div>root@server:~# lua</div><div>Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio</div><div>&gt; require &quot;socket.http&quot;;</div></div><div>&gt;</div><div><br></div><div>So why is FS&#39; lua complaining about a luasocket library that standard lua isn&#39;t, and how do I deal with it?</div>


<div><br></div><div>Thanks,<br>Neil</div></div>
</blockquote></div><br></div>