[Freeswitch-users] Re- FreeSWITCH 1.6.5 Lua version (can it be upgraded)?

Andrew Keil andrew.keil at visytel.com
Wed Dec 2 08:50:05 MSK 2015


Luis,

This seems a strange answer to say that I would break CentOS 6.  Especially when earlier versions of the FreeSWITCH 1.4 branch did not use the system version of Lua and compiled their own version of Lua and ran Lua version 5.2 on CentOS 6.

I actually need some Lua features that are inside Lua 5.2 and later, hence the need to make this work.

Obviously I will run tests to make sure nothing breaks during this process.

Andrew

From: Luis Daniel Lucio Quiroz [mailto:luis.daniel.lucio at gmail.com]
Sent: Wednesday, 2 December 2015 4:41 PM
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>; Andrew Keil <andrew.keil at visytel.com>
Subject: Re: [Freeswitch-users] Re- FreeSWITCH 1.6.5 Lua version (can it be upgraded)?

Don't upgrade to LUA5.2, you are going to break the Centos6. Freeswitch can and uses system lua, that gives you many advantages, like using luarocks and other lua modules. Some lua modules are not source, but binary; the binary lua-modules are linked against lua5.1 (because the RPM system).

I have not found any LUA script not compatible on Lua5.1 that runs on Freeswitch. And if you are going to install any 'compiled' lua script, you need to stick with lua version (like the binary modules).

Luis Daniel Lucio Quiroz
CISSP, CISM, CISA
Linux, VoIP and much more fun
www.okay.com.mx<http://www.okay.com.mx>

Need LCR? Check out LCR for FusionPBX with FreeSWITCH
Need Billing? Check out Billing for FusionPBX with FreeSWITCH

2015-12-02 0:11 GMT-05:00 Michael Jerris <mike at jerris.com<mailto:mike at jerris.com>>:
I would check how the rpm is doing the build.  Looks like an fpic issue, Installing the dev package against a different version manually installed is a recipie for causing all kinds of issues that are a pain to fix.  If you are using packages at all, don't mix it.


On Tuesday, December 1, 2015, Andrew Keil <andrew.keil at visytel.com<mailto:andrew.keil at visytel.com>> wrote:
To FreeSWITCH users,

I just noticed that since upgrading to FreeSWITCH 1.6.5 (on CentOS 6.7 or CentOS 7) that the Lua version is 5.1.4 (since when running yum install lua-devel the version installed is 5.1.4).
Also when I type: lua -v {it returns 5.1.4}

In order to try to upgrade Lua inside FreeSWITCH to version 5.2.4 I followed this procedure:

First I uninstalled lua-devel by typing: yum -y remove lua-devel

Then I then installed off lua.org<http://lua.org> a later version (in this case 5.2.4, even though they are up to 5.3.2 now):


1)      cd /usr/local/src

2)      curl -R -O http://www.lua.org/ftp/lua-5.2.4.tar.gz

3)      cd lua-5.2.4

4)      make linux test

5)      make linux install

6)      Tested by typing: lua -v (to check the version number) – All OK now reports 5.2.4 correctly

Next I followed the instructions below from (7) to (13) {first I made sure the freeswitch directory was removed by typing rm -rf freeswitch from the /usr/local/src directory}

Unfortunately, I received this error message from the FreeSWITCH make command:

making all mod_lua
make[4]: Entering directory `/usr/local/src/freeswitch/src/mod/languages/mod_lua'
  CXXLD  mod_lua.la<http://mod_lua.la>
/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o): relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/liblua.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [mod_lua.la<http://mod_lua.la>] Error 1
make[4]: Leaving directory `/usr/local/src/freeswitch/src/mod/languages/mod_lua'
make[3]: *** [mod_lua-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch'
make: *** [all] Error 2

I found this was fixed by re-installing lua-devel via: yum –y install lua-devel

However now when I continue on and complete the make && make install then start FreeSWITCH I get this error:

2015-12-02 15:19:22.341356 [CRIT] switch_loadable_module.c:1520 Error Loading module /usr/local/freeswitch/mod/mod_lua.so
**/usr/local/freeswitch/mod/mod_lua.so: undefined symbol: lua_callk**

I assume this issue is now related to the fact that lua-devel is version 5.1.4 and the installed system wide Lua is 5.2.4.

Can anyone assist me in upgrading Lua to run Lua version 5.2.x within FreeSWITCH 1.6.5?

Please note the procedure below works fine and runs Lua at version 5.1.4.

FreeSWITCH 1.6.5 on CentOS 6.7 setup instructions:
========================================================

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 lua-devel libsndfile-devel
5.1) These should install successfully

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

7) cd /usr/local/src

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

9) cd /usr/local/src/freeswitch

10) ./bootstrap.sh

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

12) ./configure

13) make

14) make install

15) make cd-sounds-install

16) make cd-moh-install

17) cd /usr/local/freeswitch/conf

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

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

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

21) cd /usr/local/freeswitch/bin

22) ./freeswitch -nonat -nonatmap

23) ... to exit from the FreeSWITCH console

Kind Regards,

Andrew Keil


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.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

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


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