[Freeswitch-users] How to get later versions of Lua to run on FreeSWITCH 1.6.5 running on CentOS 6 or CentOS 7

Andrew Keil andrew.keil at visytel.com
Wed Dec 2 12:29:32 MSK 2015


To all,

After much testing I have managed to get Lua 5.3.2 (the latest Lua version, however this will work with all the Lua 5.2.x versions) to run inside FreeSWITCH 1.6.5 on CentOS 6.7 (however the same should work inside CentOS 7).

Here is what I have done.  Please make any comments and improvements to this procedure.

*** One part I am not happy with is that I have to manually copy the liblua.so from /usr/local/lib to /usr/local/freeswitch/lib (see point 22 below).  For some reason FreeSWITCH does not find the shared library inside /usr/local/lib.  Maybe there is a setting for this I can change as the other option is to put liblua.so inside /usr/lib64 where "yum install lua-devel" puts the liblua.so for Lua version 5.1.4, however I do not like this concept. ***

Please note: Currently mod_fsv and mod_vpx (both are relating to FreeSWITCH video features) are not supported inside these instructions, however if you are wanting to move off 1.4.x (since this is going end-of-life in 2016 at some stage) then this could at least be a very good first step, especially if upgrading to Centos 7 is not possible based on your current environment setup.

This is based on a fresh installation of CentOS 6.7 (CentOS-6.7-x86_64-bin-DVD1.iso).  In my case I ran a default setup selecting Software Development Workstation.

Logged in as root user.

1) Make sure yum update is run and CentOS is up-to-date

2) {optional} Inside Terminal window select Edit Profile Preferences and select "Use custom default terminal size" and make it 160 x 60.  Close terminal and re-open for the change to take effect.

3) yum -y install epel-release

4) yum -y install git gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel libjpeg-devel openssl-devel sqlite-devel libcurl-devel libxml2-devel libidn-devel
4.1) These should be already installed and up-to-date

5) yum -y install e2fsprogs-devel pcre-devel speex-devel ldns-devel libedit-devel libyuv-devel opus-devel libvpx-devel unbound-devel libuuid-devel libsndfile-devel
5.1) These should install successfully
5.2) Originally I also installed lua-devel, so if this has already been installed then remove it by: yum -y remove lua-devel

6) Note: No packages for: libvpx2*, libdb4* (so mod_vpx & mod_fsv will not be supported)

7) Setup Lua 5.3.2 here (obviously you can select your own version):
7.1) cd /usr/local/src
7.2) curl -R -O http://www.lua.org/ftp/lua-5.3.2.tar.gz
7.3) tar zxf lua-5.3.2.tar.gz
7.4) cd /usr/local/src/lua-5.3.2
7.5) vi Makefile
                Change: TO_LIB= liblua.a
                To be: TO_LIB= liblua.a liblua.so
Save and close (<Esc> :wq!)
7.6) cd /usr/local/src/lua-5.3.2/src
7.7) vi Makefile
                Change: CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
                To be: CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) -fPIC
                Add under: LUA_A= liblua.a
The line: LUA_SO= liblua.so
Change: ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
                To be: ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
Add under: $(LUAC_T): $(LUAC_O) $(LUA_A)
                $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
The lines: $(LUA_SO): $(CORE_O) $(LIB_O)
                $(CC) -o $@ -shared $?
Save and close (<Esc> :wq!)
7.8) make linux test
7.9) make linux install

8) cd /usr/local/src

9) git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git

10) cd /usr/local/src/freeswitch

11) ./bootstrap.sh

12) vi modules.conf
12.1) comment out (ie. place '#' infront):
mod_fsv
mod_vpx
Save and close (<Esc> :wq!)

13) ./configure

14) make

15) make install

16) make cd-sounds-install

17) make cd-moh-install

18) cd /usr/local/freeswitch/conf

19) vi vars.xml
19.1) change:  <X-PRE-PROCESS cmd="set" data="default_password=1234"/> { !! set it to something different !! }
    Save and close (<Esc> :wq!)

20) cd /usr/local/freeswitch/conf/autoload_configs

21) vi modules.conf.xml
21.1) comment out (ie. place '<!--' infront and '-->' at the end):
mod_fsv
mod_vpx
Save and close (<Esc> :wq!)

22) cp /usr/local/lib/liblua.so /usr/local/freeswitch/lib/.

23) cd /usr/local/freeswitch/bin

24) ./freeswitch -nonat -nonatmap

25) ... to exit from the FreeSWITCH console

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


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list