<a href="http://wiki.freeswitch.org/wiki/Mod_lua#How_can_I_get_Lua_to_see_my_own_libraries_using_.22require.22">http://wiki.freeswitch.org/wiki/Mod_lua#How_can_I_get_Lua_to_see_my_own_libraries_using_.22require.22</a><br><br>
<br><div class="gmail_quote">On Tue, Apr 19, 2011 at 2:00 PM, Boris Kovalenko <span dir="ltr">&lt;<a href="mailto:boris@tagnet.ru">boris@tagnet.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


  
    
  
  <div text="#000000" bgcolor="#ffffff">
    Hello!<br>
    <br>
        Would You please explain why?? I have no db_connect.lua in my
    scripts directory and also no freeswitch installed in
    /usr/local/freeswitch. <br><div><div></div><div class="h5">
    <br>
    <blockquote type="cite">Before run Freeswitch you have to put this command:<br>
      <br>
      export LUA_PATH=/usr/local/freeswitch/scripts/db_connect.lua<br>
      <br>
      <br>
      <div class="gmail_quote">On Tue, Apr 19, 2011 at 10:34 AM, Boris
        Kovalenko <span dir="ltr">&lt;<a href="mailto:boris@tagnet.ru" target="_blank">boris@tagnet.ru</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hello!<br>
          <br>
              I want to include LUA script into another LUA script. I
          have<br>
          modified lua.conf.xml and set &lt;param
          name=&quot;script-directory&quot;<br>
          value=&quot;$${base_dir}/scripts/?&quot;/&gt; and restarted freeswitch.
          In my script<br>
          called test1.lua I wrote: require(&#39;test2.lua&#39;);<br>
          test2.lua is placed into the same directory as test1.lua, and
          directory<br>
          is /opt/fs/scripts/. But luarun test1.lua gives an error:<br>
           2011-04-19 10:14:40.651205 [ERR] mod_lua.cpp:182<br>
          /opt/fs/scripts/test1.lua:3: module &#39;test2.lua&#39; not found:<br>
                  no field package.preload[&#39;test2.lua&#39;]<br>
                  no file &#39;/opt/fs/scripts/test2/lua&#39;<br>
                  no file &#39;./test2/lua.so&#39;<br>
                  no file &#39;./libtest2/lua51.so&#39;<br>
                  no file &#39;/usr/local/lib/lua/5.1/test2/lua.so&#39;<br>
                  no file &#39;/usr/local/lib/lua/5.1/libtest2/lua51.so&#39;<br>
                  no file &#39;/usr/local/lib/lua/5.1/loadall.so&#39;<br>
                  no file &#39;./test2.so&#39;<br>
                  no file &#39;./libtest251.so&#39;<br>
                  no file &#39;/usr/local/lib/lua/5.1/test2.so&#39;<br>
                  no file &#39;/usr/local/lib/lua/5.1/libtest251.so&#39;<br>
                  no file &#39;/usr/local/lib/lua/5.1/loadall.so&#39;<br>
          stack traceback:<br>
                  [C]: in function &#39;require&#39;<br>
                  /opt/fs/scripts/test1.lua:3: in main chunk<br>
          <br>
          <br>
          What is wrong with my setup?<br>
          <br>
          --<br>
          Regards,<br>
          Boris<br>
          <br>
          <br>
          <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>
      <br clear="all">
      <br>
      -- <br>
      Regards <br>
      ---------- <br>
      M Emran<br>
      <br>
      E-Mail: <a href="mailto:info@e-softbilling.com" target="_blank">info@e-softbilling.com</a><br>
      Web: <a href="http://www.e-softbilling.com/" target="_blank">www.e-softbilling.com</a><br>
               <a href="http://www.isoftswitch.com/" target="_blank">www.isoftswitch.com</a><br>
               <a href="http://www.howtonix.com/" target="_blank">www.howtonix.com</a><br>
               <a href="http://www.sipmobiledialer.com/" target="_blank">www.sipmobiledialer.com</a><br>
      <pre><fieldset></fieldset>
_______________________________________________
FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
    </blockquote>
    <br>
    <br>
    </div></div><pre cols="72">-- 
Regards,
Boris

</pre>
  </div>

<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><br clear="all"><br>-- <br>Regards <br>---------- <br>M Emran<br><br>E-Mail: <a href="mailto:info@e-softbilling.com" target="_blank">info@e-softbilling.com</a><br>Web: <a href="http://www.e-softbilling.com/" target="_blank">www.e-softbilling.com</a><br>
         <a href="http://www.isoftswitch.com/" target="_blank">www.isoftswitch.com</a><br>
         <a href="http://www.howtonix.com/" target="_blank">www.howtonix.com</a><br>         <a href="http://www.sipmobiledialer.com/" target="_blank">www.sipmobiledialer.com</a><br>