Installation Guide

From FreeSWITCH Wiki

Jump to: navigation, search

Contents

FreeSWITCH RC3 packages

FreeSWITCH RC3 RPM packages are located at http://files.freeswitch.org/RPMS/

This guide will discuss how you can obtain FreeSWITCH™ and if you decide, instructions to build FreeSWITCH™ from source. Once you have built FreeSWITCH™ you are encouraged to read the Getting Started Guide for information on configuration and use of the FreeSWITCH™ communications platform.

Quick and Dirty Install for the Impatient Ones

If you are impatient and know Linux at least moderately well then hop over to the quick and dirty install page!

Binary Installation or ISO CD-ROM Installation

The FreeSWITCH™ project maintains binary packages for a number of Linux distributions on the openSUSE Build Service. All external dependencies required by these FreeSWITCH™ packages are either part of the base Linux distros or available in the repository at: http://software.opensuse.org/download/network:/telephony/

Another option is the trixswitch ISO install package, a CentOS-based CD-ROM image that creates a boot CD that will automatically install CentOS, FreeSWITCH™, and the WikiPBX web GUI.

Warning

installing trixswitch will erase the hard drive!


If your preferred Linux distro and version is listed there, then we recommend you use these packages. If however you wish to build the source yourself, continue reading.



Obtaining the Source Code

Ensure that you have met the dependencies listed below. Once that is completed, you have two methods to obtain the source code. Via subversion (svn) or by downloading a tarball. Subversion provides access to the latest features and bug fixes, while the tarballs are created nightly. There are subversion clients for windows as well as Unix-like systems. This document assumes that you are using a command-line subversion client. You will want to save the source somewhere convenient, execute the following from the directory you wish to save the code into, eg c:\source or /usr/src for example.

Type This


You can download the latest tagged release source in a tarball from the following link.

Type This


Or you may download other tarballs from marked releases or binary releases from the following link

Type This


If you download the tarball you will need to untar it, in Windows you may use a tool like WinZip Unix-like systems come with tar preinstalled (and most modern ones with gunzip). If you are in a Unix-like system execute the following:

Type This
tar zxvf freeswitch-snapshot.tar.gz


If you are facing problems because of web proxy you could try something like this:

Type This
svn co http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch.trunk
 cd freeswitch.trunk
 svn propedit svn:externals . --editor-cmd=[your favorite editor here]
 remove the :81 from both externals urls
 save/exit
 svn update


Compiling the Source Code

Windows

  • Open Freeswitch.sln
  • Right click the main solution node at the top of the Solution Explorer
  • Right click and select Build

Unix-like systems (Linux, BSD, OS X)

All commands should be executed from within the main source repository. If you downloaded a tarball you may skip this step, jumping to ./configure

Type This
./bootstrap.sh


Informational Tip

Some Linux distributions (Debian, for example) include both autoconf2.13 and autoconf2.50 along with a script called "autoconf" that automatically selects between the two. The numbers appended to the programs show which flavor of autoconf it provides, but autoconf2.50 can actually be autoconf version 2.61. bootstrap.sh checks for the version of autoconf, but the autoconf script returns version 2.13 by default. If bootstrap.sh fails with a complaint about needing autoconf 2.59 or above and you have installed the prerequisites listed below, try:


 

Type This
AUTOCONF=/usr/bin/autoconf ./bootstrap.sh


By default FreeSWITCH is installed in the /usr/local/freeswitch prefix, however if you don’t have root access add --prefix=~/freeswitch to the command given below. For configuring with ODBC support see here. To configure:

Type This
./configure --prefix=/usr/local/freeswitch


Informational Tip

Not all Debian releases have /usr/bin/gcc. Instead you can find something like /usr/bin/gcc-X.Y so ./configure will fail, if it is missing. To execute without problem ./configure, try:

Type This
ln -s /usr/bin/gcc-X.Y /usr/bin/gcc

on such a release. Remember to change X.Y with the correct numbers. It will work like a charm.


 


You should now create a modules.conf.

Type This
cp build/modules.conf.in modules.conf


Edit modules.conf so that it will build the modules you desire. If you are unsure, leave this to the defaults. FreeSWITCH™ comes with a good set of modules as the default, until you become more familiar with FreeSWITCH™ it is advised that you not edit modules.conf. A # at the beginning will omit that module from being built. A list of the modules can be obtained from the Modules page.

Once you are done configuring the build environment you need to:

Type This
make
make install
make sounds-install
make moh-install


There are also higher bitrate sounds available for download and installation with:

Type This
make uhd-sounds-install
make uhd-moh-install
make hd-sounds-install
make hd-moh-install


FreeBSD

Installing FreeBSD dependencies:

SVN: Several Choices.

GNUMAKE: The GNU version of make. (will be installed automatically as a dependency to autoconf)

AUTOCONF: Version 2.50 or higher

Type This
cd ports/devel/autoconf261/
make install


GCC: Version 3.95 or higher

Type This
cd ports/lang/gcc34/
make install


WGET: Almost any version

Type This
pkg_add -r wget


AUTOMAKE: Version 1.70 or higher

Type This
cd /usr/ports/devel/automake19
make install


GLIBTOOL: Version 1.5.14 or higher

Type This
pkg_add -r libtool


LIBNCURSES: Almost any version

Type This
pkg_add -r ncurses


Build Process Download the src with svn or with wget

Type This
cd /tmp
wget http://files.freeswitch.org/freeswitch-snapshot.tar.gz  
tar zxvf freeswitch-snapshot.tar.gz
cd freeswitch-snapshot
./bootstrap.sh
./configure
cp build/modules.conf.in modules.conf
vi modules.conf
gmake install
gmake samples
gmake sounds-install
gmake moh-install


Run Freeswitch

Type This
cd /usr/local/freeswitch/bin
./freeswitch


Compile Errors?

Did you get any compile errors or notice any bugs? Remember FreeSWITCH is still in development and requires contribution from everybody. If you encounter a bug please file a bug report at http://jira.freeswitch.org or email freeswitch-dev@lists.freeswitch.org (we prefer that you use Jira so that we can track all issues). Sometimes bugs are fixed by the time you notice them, if you do encounter a bug you may wish to get a more recent version of the source code and rebuild.

Rebuilding

After doing a "svn update" or changing some source files, you may want to clean out your build area. To ensure that your build is clean, you should execute:

Type This
make clean modwipe


Alternatively, you can simply execute "make current" which will handle the svn up, clean up, and rebuild in one step:

Type This
make current
Warning

NOTE: make current will take a while as it completely cleans the build environment and rebuilds FreeSWITCH!


Also, the clean targets leave the "modules.conf" file. To see if there are any new modules you may want to execute

Type This
diff build/modules.conf.in modules.conf


Once you are satisfied with your options, follow the build directions above. If you have enabled a module that was not previously enabled, and you want to build just that module, or rebuild one that has changed, you may execute the following:

Type This
make mod_name-install


where mod_name is the name of the module you wish to rebuild.

Informational Tip

that doing a "make install" will not overwrite any existing files in $(PREFIX)/conf if there already exists a $(PREFIX)/conf/freeswitch.xml file.


 


Prerequisites

In order to build FreeSWITCH™ from the source code, you will need to have several tools installed. The list varies from platform to platform, and are listed here. Some distributions come with these requirements while others require you to obtain them.

Unix-like systems

  • SVN: an SVN client gives you access to the current code repository. Alternatively you may select to get a nightly tarball of the source instead of using SVN.
  • GNUMAKE: The GNU version of make.
  • AUTOCONF: Version 2.50 or higher
  • AUTOMAKE: Version 1.70 or higher
  • GLIBTOOL: Version 1.5.14 or higher
  • GCC: Version 3.95 or higher
  • WGET: Almost any version
  • LIBNCURSES: Almost any version

Mac OS X

You will need to install the Apple XCode development software (which requires registration, but is free). This should be performed first.

One easy way to install any missing tools is by using Fink. Fink is a MacOS X tool that allows you to download convenient, pre-compiled binaries as well as source code for over 1,700 software packages.

The standard "fink install" includes the 1.5.10 version of glibtool, in order to get the 1.5.14 or later version, you must tell Fink to use the unstable branch (fink.conf man page), which then leads to an automatic download and install of the latest glibtool version.

Type This
"fink install svn-client make automake1.9 autoconf2.5 libtool14 wget"


However you install these tools, you will need to make certain they're on your PATH.

Trixswitch ISO

To work with souce, you will need to install the c++ compiler: yum install gcc-c++

Then, you must run the following files to install automake,autoconf, and libtool:

fixlibtool.sh fixautomake.sh fixautoconf.sh

You can find these scripts in freeswitch/bin/trunk/build/

If you do wind up installing gcc-c++ after an aborted build, you must start back at the beginning with ./configure

Debian Linux

Debian uses the aptitude a.k.a. “apt” package manager. This allows you to quickly and easily install the prerequisites.

Type This
aptitude install subversion subversion-tools automake1.9 gcc-4.1 autoconf make wget libtool g++ libncurses5 libncurses5-dev


For TLS to work (needed to use Dingaling with gmail.com), also GNUTLS is necessary.

Type This
aptitude install libgnutls-dev


The source tree includes a debian/ directory, so you can build a package using standard debian tools. First, do the svn checkout into a directory named after the version in the debian/changelog (i.e. freeswitch-1.0~beta3) or move it there immediately after the svn checkout. Then you still need to start with the ./bootstrap.sh step, and once done you SHOULD NOT move the directory, as explicit paths will have been inserted into some of the Makefiles (don't run bootstrap.sh if you are going to use the debuild tool since its not needed, it will do it for you).

One of the several ways of then building the package is:

  • ensure that you have the devscripts package installed.
  • Then (optionally) change the package version to something that includes the SVN version you're building. This can be done by running dch -i and setting the version to something like: 1.0~beta3-0~svn7245
  • Perhaps (if you know what you're doing) edit the modules to build that are set near the start of debian/rules
  • then just run debuild (which might tell you that there are some build dependencies missing, in which case, just install them and try again)

After that, you should have a several .deb files in the directory above the source directory which can be installed with dpkg -i packagename.deb

CentOS

CentOS uses yum as a package manager; the following installs the required prerequisites on a base install of CentOS 5.0 and 5.1.

Type This
yum install subversion autoconf automake libtool gcc-c++ ncurses-devel


Gentoo Linux

Warning

The FreeSWITCH ebuild has been removed from the Gentoo voip overlay, please use one of the supported binary-only distributions (or the manual installation method, if it really has to be Gentoo).


Solaris

Solaris use the jds-cbe environment or fix path to working tr (as per FSBUILD-30).

Type This
export PATH=/usr/xpg4/bin:$PATH



Windows

To compile FreeSWITCH on Windows, you will need Visual C++ 2005 and if you are installing the Express Edition, the platform SDK (see these instructions for more details).

Personal tools