[Freeswitch-users] mod_lua and require

Boris Kovalenko boris at tagnet.ru
Tue Apr 19 12:24:10 MSD 2011


Thank You!

> http://wiki.freeswitch.org/wiki/Mod_lua#How_can_I_get_Lua_to_see_my_own_libraries_using_.22require.22
>
>
> On Tue, Apr 19, 2011 at 2:00 PM, Boris Kovalenko <boris at tagnet.ru 
> <mailto:boris at tagnet.ru>> wrote:
>
>     Hello!
>
>         Would You please explain why?? I have no db_connect.lua in my
>     scripts directory and also no freeswitch installed in
>     /usr/local/freeswitch.
>
>>     Before run Freeswitch you have to put this command:
>>
>>     export LUA_PATH=/usr/local/freeswitch/scripts/db_connect.lua
>>
>>
>>     On Tue, Apr 19, 2011 at 10:34 AM, Boris Kovalenko
>>     <boris at tagnet.ru <mailto:boris at tagnet.ru>> wrote:
>>
>>         Hello!
>>
>>             I want to include LUA script into another LUA script. I have
>>         modified lua.conf.xml and set <param name="script-directory"
>>         value="$${base_dir}/scripts/?"/> and restarted freeswitch. In
>>         my script
>>         called test1.lua I wrote: require('test2.lua');
>>         test2.lua is placed into the same directory as test1.lua, and
>>         directory
>>         is /opt/fs/scripts/. But luarun test1.lua gives an error:
>>          2011-04-19 10:14:40.651205 [ERR] mod_lua.cpp:182
>>         /opt/fs/scripts/test1.lua:3: module 'test2.lua' not found:
>>                 no field package.preload['test2.lua']
>>                 no file '/opt/fs/scripts/test2/lua'
>>                 no file './test2/lua.so'
>>                 no file './libtest2/lua51.so'
>>                 no file '/usr/local/lib/lua/5.1/test2/lua.so'
>>                 no file '/usr/local/lib/lua/5.1/libtest2/lua51.so'
>>                 no file '/usr/local/lib/lua/5.1/loadall.so'
>>                 no file './test2.so'
>>                 no file './libtest251.so'
>>                 no file '/usr/local/lib/lua/5.1/test2.so'
>>                 no file '/usr/local/lib/lua/5.1/libtest251.so'
>>                 no file '/usr/local/lib/lua/5.1/loadall.so'
>>         stack traceback:
>>                 [C]: in function 'require'
>>                 /opt/fs/scripts/test1.lua:3: in main chunk
>>
>>
>>         What is wrong with my setup?
>>
>>         --
>>         Regards,
>>         Boris
>>
>>
>>
>>         _______________________________________________
>>         FreeSWITCH-users mailing list
>>         FreeSWITCH-users at lists.freeswitch.org
>>         <mailto:FreeSWITCH-users at lists.freeswitch.org>
>>         http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>         UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>         http://www.freeswitch.org
>>
>>
>>
>>
>>     -- 
>>     Regards
>>     ----------
>>     M Emran
>>
>>     E-Mail: info at e-softbilling.com <mailto:info at e-softbilling.com>
>>     Web: www.e-softbilling.com <http://www.e-softbilling.com/>
>>     www.isoftswitch.com <http://www.isoftswitch.com/>
>>     www.howtonix.com <http://www.howtonix.com/>
>>     www.sipmobiledialer.com <http://www.sipmobiledialer.com/>
>>
>>
>>     _______________________________________________
>>     FreeSWITCH-users mailing list
>>     FreeSWITCH-users at lists.freeswitch.org  <mailto:FreeSWITCH-users at lists.freeswitch.org>
>>     http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>     UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>     http://www.freeswitch.org
>
>
>     -- 
>     Regards,
>     Boris
>
>
>
>     _______________________________________________
>     FreeSWITCH-users mailing list
>     FreeSWITCH-users at lists.freeswitch.org
>     <mailto:FreeSWITCH-users at lists.freeswitch.org>
>     http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>     UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>     http://www.freeswitch.org
>
>
>
>
> -- 
> Regards
> ----------
> M Emran
>
> E-Mail: info at e-softbilling.com <mailto:info at e-softbilling.com>
> Web: www.e-softbilling.com <http://www.e-softbilling.com/>
> www.isoftswitch.com <http://www.isoftswitch.com/>
> www.howtonix.com <http://www.howtonix.com/>
> www.sipmobiledialer.com <http://www.sipmobiledialer.com/>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org


-- 
? ?????????,
   ????? ?????????
   ??? "??????"
   ???. +7 (3435) 230001
   ???? +7 (3435) 230005

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110419/ee7d6971/attachment.html 


More information about the FreeSWITCH-users mailing list