freeSWITCH 运行环境 及 编译安装

Prerequisites

Use the yum package manager tool or Add/Remove Applications menu function to add the following packages to a basic installation:

  • autoconf
  • automake
  • gcc-c++
  • git-core
  • libjpeg-devel
  • libtool
  • make
  • ncurses-devel
 yum install autoconf automake gcc-c++ git-core libjpeg-devel libtool make ncurses-devel pkgconfig

To install the optional packages needed to enable all FreeSWITCH modules to be built:

 yum install unixODBC-devel openssl-devel libogg-devel libvorbis-devel libcurl-devel \
     libtiff-devel libjpeg-devel python-devel expat-devel zlib zlib-devel bzip2 \
     which pcre pcre-devel speex-devel sqlite-devel
sudo yum install expat-devel openssl-devel libtiff-devel libX11-devel unixODBC-devel libssl-devel python-devel \
                 zlib-devel libzrtpcpp-devel alsa-lib-devel libogg-devel libvorbis-devel perl-libs gdbm-devel \
                 libdb-devel uuid-devel @development-tools  
					from (http://wiki.freeswitch.org/wiki/Linux_Quick_Install_Guide#Downlo

Git:

  git clone https://stash.freeswitch.org/scm/fs/freeswitch.git
cd freeswitch ./bootstrap.sh

Edit modules.conf

This is optional but consider editing modules.conf.

Compile the Source

 ./configure
 make

Install FreeSWITCH™

 make all install cd-sounds-install cd-moh-install

You will also need to install the following packages if you need the modules listed below:

  • mod_event_zmq needs "openssl-devel" and "libuuid-devel" packages.
  • mod_erlang_event needs "openssl-devel" and "erlang-devel" packages.
  • mod_flite needs "openssl-devel" and "bzip2" packages.
  • mod_osp needs "openssl-devel" package and the "OSP Toolkit" see mod_osp.
  • mod_snmp needs "openssl-devel" and "net-snmp-devel" packages.
  • mod_xml_ldap needs "openssl-devel" and "cyrus-sasl-devel" packages.
YUM Based Installation

FreeSWITCH is now available via yum. You will need to add the FreeSWITCH yum repository

To install the FreeSWITCH Repo

 rpm -Uvh http://files.freeswitch.org/freeswitch-release-1-0.noarch.rpm

Then to install FreeSWITCH with the generic vanilla example configs

 yum install --nogpgcheck freeswitch-config-vanilla

This will give you a base working FreeSWITCH. At the time of this update (2012-FEB-13) these RPMs are Beta but should be working fine. Please report any bugs in them via JIRA

After that you need to install FreeSWITCH sound related files. For that you need to issue following command.

 yum install sox freeswitch-sounds*
Automatic Startup At Boot

To get FreeSWITCH to start up automatically at system start, just copy the FreeSWITCH init script into the /etc/init.d directory. An example init script is included in the git repository, under the build directory, named as freeswitch.init.redhat. You may need to modify the script to get FreeSWITCH starting up from the directory where the binaries are installed. After the file has been modified to suit your needs, simply run this command:

 chkconfig --add freeswitch && chkconfig --levels 35 freeswitch on

This procedure will also work exactly the same way on Fedora systems.

Installation

Continue with the normal installation steps or the Linux Quick Install Guide Downloads section.

FreeSWITCH v.1.4/master openssl requirement change

Required: openssl version 1.0.1g or later to build

For CentOS 5:

wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
tar -zxvf openssl-1.0.1g.tar.gz
cd openssl-1.0.1f
./config --prefix=/usr/openssl101g -fPIC
make 
make install
then go over to FS build root (even on existing build that had picked up the dependency by a git pull)
./configure CFLAGS="-I/usr/openssl101g/include" LDFLAGS="-L/usr/openssl101g/lib"  
then build as normal
Release(es) 6 and Later

A change by Red Hat in RHEL 6 and later releases was to compile the kernel to run tickless by default. As previously brought up on the mailing lists, it is recommended that the kernel's tickless feature should be disabled for optimum performance when running FreeSwitch under the newer operating system's kernel. You can disable the tickless feature by appending nohz=off to your boot options under GRUB. The GRUB start up configuration file is located under /boot/grub or as /etc/grub.conf. Add it to the line beginning with "kernel". This is also applicable to Fedora releases 8 and later.

In addition, FS may not behave 100% correctly in CentOS 6.x, please review Jira issues: FS-4396, FS-4316, FS-4291

UPDATE: We have anecdotal evidence that CentOS 6.3 does not seem to have the problems listed above. If you experience any of the above symptoms with CentOS 6.3 please comment on the Jira cases listed.




Which version should I use?

For current installation instructions, please refer to the new FreeSWITCH documentation athttps://confluence.freeswitch.org/display/FREESWITCH/Installation

Recommended: Git

Git provides access to the latest features and bug fixes added throughout the day. Most often you will only use the clone and pull commands. There is an excellent Online Git Book available in multiple languages. For help installing Git see Git_Install. The following creates a freeswitch directory and downloads a "clone" of the current source:

cd /usr/local/src
git clone git://git.freeswitch.org/freeswitch.git
OR
git clone -b v1.2.stable git://git.freeswitch.org/freeswitch.git
(SEE BELOW)

Note: git reset --hard <commit_id> - will revert all local changes and reset the working copy to the specified commit.

Selecting version

There are 2 branches in Git - Master and v1.2.stable

v1.2.stable is the branch for the 1.2 series. It contains the most recent 1.2.x release, plus any patches made since that release.

git clone -b v1.2.stable git://git.freeswitch.org/freeswitch.git

Master is where the development for the future 1.4 release is being done. New features are added to this branch, but it may be less stable than 1.2.stable at times.

git clone git://git.freeswitch.org/freeswitch.git

You can switch branches on an already cloned Git tree:

git checkout v1.2.stable
git checkout master

If you get an error on GIT PULL on v1.2.stable saying You asked me to pull without telling me which branch you want to merge with
Then run this to add the definition for that branch to .git/config:

git branch --set-upstream v1.2.stable origin/v1.2.stable

You can see all remote branches with git branch -r. You can check out 1.4beta for example with

git checkout v1.4.beta

Some more information for people trying git tag: 1.4beta is snapshots of the 1.5 dev codebase. Some time in future, 1.4 will replace 1.2 as the stable branch.

Reverting to an Earlier Commit in Git

Sometimes when things go terribly wrong with the latest commits (regression-type bugs), you can always revert to an earlier commit with git. Simply type in:

git checkout <revhash>

where <revhash> is the hash of an earlier commit. You can find the commit hashes here.

After reverting to a previous version, it is strongly recommended that you (in the following order):

  • Report the issue to the FreeSWITCH JIRA
  • Run 'git clean -d -f -x' on the root directory of the sources of FreeSWITCH to remove non-git files and spare compilation files.
  • Run 'rm -rf /usr/local/freeswitch/{lib,mod,bin}/*' to remove the current binary files in those 3 directories.
  • Re-bootstrap the code
  • Re-run the configure process

... before you re-build the code from an earlier revision.

To go back to the very latest commit from the development branch, simply type in

git checkout master
Revert only certain commit

To reverse only the one commit change on newer build

git log -1 -p <revhash> | patch -p1 -R
freeswitch-contrib

Contributed source may be obtained from the freeswitch-contrib tree as follows (this will compile and install updates):

 git clone git://git.freeswitch.org/freeswitch-contrib.git

Sample configs can be downloaded as well:

git clone git://git.freeswitch.org/freeswitch-sample-configs.git

The Latest Build site latest.freeswitch.org is currently empty.

Compiling and Installation

Ensure that the required prerequisites are installed. Also check if there are notes for your distribution in Distribution Information and Installation.

Switch to the src/freeswitch Directory

The remaining commands are executed from the directory containing the FreeSWITCH™ source (use whatever directory the source is located in):

cd /usr/local/src/freeswitch

Installed from Git

If Git was used to download, the configuration files must be built before the first compile. ./bootstrap.sh creates many files including modules.conf. Once this is performed it's not normally required to be performed again. If you're installing from a tarball, this script was run before packaging, and you shouldn't need to run it.

 ./bootstrap.sh

You can use multiple cores for your bootstrap/config/build, by specifying it at the start, e.g.: (note this may make build errors harder to spot)

 ./bootstrap.sh -j

However, its not recommended to use the -j flag for either bootstrap.sh or make, on bootstrap.sh on a slow machine (older machines or say a raspberry pi) -j will fail randomly due to how it is handled. on the make this may also randomly fail. (quoted from Ken Rice in FS-4891)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值