[Freeswitch-users] mod_lua and require
M.Emran
monemran at gmail.com
Tue Apr 19 11:39:51 MSD 2011
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> 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
> 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
Web: www.e-softbilling.com
www.isoftswitch.com
www.howtonix.com
www.sipmobiledialer.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110419/f1bb3745/attachment.html
More information about the FreeSWITCH-users
mailing list