Personal tools
You are here: Home Linux FreeSWITCH Install FreeSWITCH on a CentOS v6 VM

Install FreeSWITCH on a CentOS v6 VM

Use the binary RPM's from the repository at freeswitch.org to install FreeSWITCH

 

# rpm -Uvh http://files.freeswitch.org/yum/freeswitch-release-1-0.noarch.rpm
# yum install freeswitch-config-vanilla

The init.d script set the default daemon program as 'FS_FILE=${FS_FILE-/usr/freeswitch}', which isn't where it is installed by the RPM. Add the following directive to '/etc/sysconfig/freeswitch':

FS_FILE=/usr/bin/freeswitch

The service is installed to start. Start the service:

# service freeswitch start

Blue.Box

Use the bluebox php web interface to manage the freeswitch instance. Instead of using the default Apache (httpd) server, use Nginx and php-fpm to host the site. The php-fpm instance runs as the 'freeswitch' user so that it can modify the freeswitch configuration files, with the 'apache' group so that it can access the web site content and the php session variables (in '/var/lib/php/session').

# rpm -Uvh http://mirror.xnet.co.nz/pub/epel/6/x86_64/epel-release-6-6.noarch.rpm
# yum install nginx mysql-server
# yum install http://files.2600hz.org/bluebox-v1.0.3.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# yum install php php-fpm php-pdo php-sqlite php-xml php-mysql
# yum install sqlite2 
# yum install freeswitch-sounds-en-us-callie-all freeswitch-sounds-music

Create a php-fpm config for the nginx server '/etc/php-fpm.d/nginx.conf' based on the sample www.conf:

[freeswitch]
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
user = freeswitch
group = apache
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

slowlog = /var/log/php-fpm/nginx-slow.log
php_admin_value[error_log] = /var/log/php-fpm/nginx-error.log
php_admin_flag[log_errors] = on

 Configure and start php fpm:

# chkconfig php-fpm on
# service php-fpm start

Create a mysql database instance:

# chkconfig mysqld on
# service mysqld start

# mysqladmin create bluebox
# mysql
mysql> GRANT USAGE ON *.* TO 'bluebox'@'localhost' IDENTIFIED BY 'bluebox'; 
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, LOCK TABLES, ALTER ON bluebox.* TO 'bluebox'@'localhost'; 
mysql> flush privileges;

Add an nginx configuration for bluebox

server {
   listen 80;
    server_name _;
    index index.php;

    root /var/www/html/bluebox;
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ {
            expires      30d;
        }
        if (-f $request_filename) {
                break;
        }

        location ~ ^(.+)\.json$ {
                rewrite ^(.+)\.json$ /json.php/$1 last;
        }
        location ~ ^(.+)\.xml$ {
                rewrite ^(.+)\.xml$ /xml.php/$1 last;
        }
        # all other requests go to Wordpress
        if (!-e $request_filename) {
                rewrite ^/(.+)$ /index.php?kohana_uri=/$1 last; # NOTICE THIS LINE CHANGE
              break;
        }
        location ~ \.php$ {
            fastcgi_pass    127.0.0.1:9000;
            fastcgi_index   index.php;
            fastcgi_param   SCRIPT_FILENAME /var/www/html/bluebox/$fastcgi_script_name;
            include         fastcgi_params;
        }

}

Start nginx:

# service nginx start

Install Wizard

Navigate to the web site with a web browser (which will redirect to the installer script - e.g. http://127.0.4.3/index.php/installer)

The first screen will display errors if there are unsatisfied dependencies. Because this installation doesn't use Apache, mod_rewrite is not installed.

2012-05-06_164125 Step 1.png

 

Select the database type. It is important to note that the MySQL server port number had to be entered to successfully navigate to the next step.

 2012-05-06_171953 Step 2 - MySQL with port entered.png

The database is brand new, so this warning can be ignored

2012-05-06_172008 Step 2 - Are you sure.png

Add an admin user:

2012-05-06_172418 Step 3.png

 

The following items are configured based on the RPM installation:

  • the conf directory is '/etc/freeswitch'
  • the sounds directory is '/usr/share/freeswitch/sounds'

 

2012-05-06_183138 Step 4.png

The configuration files are factory defaults, so once again this warning can be ignored:

2012-05-06_183430 Step 4 - Are you really sure.png

Let the installation proceed:

2012-05-06_183444 Step 5.png

2012-05-06_183453 Progress.png

Done

2012-05-06_184331 Home page.png

Voicemail

The voice mail data directory isn't created by the RPM installation, so manually create it:

# mkdir -p /usr/storage/voicemail
# chown freeswitch.daemon /usr/storage/voicemail

Skype Support

 

Residual: Get this working and document.

# yum install freeswitch-endpoint-skypopen

 

$ wget http://download.skype.com/linux/skype_static-2.2.0.35.tar.bz2

 

Links

 

Appendices

yum install freeswitch-config-vanilla

Dependencies Resolved

=======================================================================================================
 Package                                   Arch        Version                   Repository       Size
=======================================================================================================
Installing:
 freeswitch-config-vanilla                 x86_64      1.1.beta2-45.el6          freeswitch      6.2 M
Installing for dependencies:
 alsa-lib                                  x86_64      1.0.22-3.el6              base            370 k
 freeswitch                                x86_64      1.1.beta2-45.el6          freeswitch      8.0 M
 freeswitch-application-abstraction        x86_64      1.1.beta2-45.el6          freeswitch       28 k
 freeswitch-application-avmd               x86_64      1.1.beta2-45.el6          freeswitch       34 k
 freeswitch-application-blacklist          x86_64      1.1.beta2-45.el6          freeswitch       31 k
 freeswitch-application-callcenter         x86_64      1.1.beta2-45.el6          freeswitch       76 k
 freeswitch-application-cidlookup          x86_64      1.1.beta2-45.el6          freeswitch       44 k
 freeswitch-application-conference         x86_64      1.1.beta2-45.el6          freeswitch      148 k
 freeswitch-application-curl               x86_64      1.1.beta2-45.el6          freeswitch       50 k
 freeswitch-application-db                 x86_64      1.1.beta2-45.el6          freeswitch       37 k
 freeswitch-application-directory          x86_64      1.1.beta2-45.el6          freeswitch       45 k
 freeswitch-application-distributor        x86_64      1.1.beta2-45.el6          freeswitch       32 k
 freeswitch-application-easyroute          x86_64      1.1.beta2-45.el6          freeswitch       33 k
 freeswitch-application-enum               x86_64      1.1.beta2-45.el6          freeswitch      275 k
 freeswitch-application-esf                x86_64      1.1.beta2-45.el6          freeswitch       31 k
 freeswitch-application-expr               x86_64      1.1.beta2-45.el6          freeswitch       58 k
 freeswitch-application-fifo               x86_64      1.1.beta2-45.el6          freeswitch      100 k
 freeswitch-application-fsk                x86_64      1.1.beta2-45.el6          freeswitch       48 k
 freeswitch-application-fsv                x86_64      1.1.beta2-45.el6          freeswitch       34 k
 freeswitch-application-hash               x86_64      1.1.beta2-45.el6          freeswitch      100 k
 freeswitch-application-httapi             x86_64      1.1.beta2-45.el6          freeswitch       79 k
 freeswitch-application-http-cache         x86_64      1.1.beta2-45.el6          freeswitch       46 k
 freeswitch-application-lcr                x86_64      1.1.beta2-45.el6          freeswitch       64 k
 freeswitch-application-limit              x86_64      1.1.beta2-45.el6          freeswitch       26 k
 freeswitch-application-memcache           x86_64      1.1.beta2-45.el6          freeswitch      947 k
 freeswitch-application-nibblebill         x86_64      1.1.beta2-45.el6          freeswitch       42 k
 freeswitch-application-redis              x86_64      1.1.beta2-45.el6          freeswitch       50 k
 freeswitch-application-rss                x86_64      1.1.beta2-45.el6          freeswitch       35 k
 freeswitch-application-sms                x86_64      1.1.beta2-45.el6          freeswitch       36 k
 freeswitch-application-snapshot           x86_64      1.1.beta2-45.el6          freeswitch       33 k
 freeswitch-application-snom               x86_64      1.1.beta2-45.el6          freeswitch       26 k
 freeswitch-application-soundtouch         x86_64      1.1.beta2-45.el6          freeswitch      118 k
 freeswitch-application-spy                x86_64      1.1.beta2-45.el6          freeswitch       32 k
 freeswitch-application-stress             x86_64      1.1.beta2-45.el6          freeswitch       41 k
 freeswitch-application-valet_parking      x86_64      1.1.beta2-45.el6          freeswitch       41 k
 freeswitch-application-voicemail          x86_64      1.1.beta2-45.el6          freeswitch      127 k
 freeswitch-application-voicemail-ivr      x86_64      1.1.beta2-45.el6          freeswitch       70 k
 freeswitch-codec-bv                       x86_64      1.1.beta2-45.el6          freeswitch      114 k
 freeswitch-codec-h26x                     x86_64      1.1.beta2-45.el6          freeswitch       28 k
 freeswitch-codec-ilbc                     x86_64      1.1.beta2-45.el6          freeswitch       89 k
 freeswitch-codec-passthru-amr             x86_64      1.1.beta2-45.el6          freeswitch       27 k
 freeswitch-codec-passthru-g723_1          x86_64      1.1.beta2-45.el6          freeswitch       28 k
 freeswitch-codec-passthru-g729            x86_64      1.1.beta2-45.el6          freeswitch       27 k
 freeswitch-codec-siren                    x86_64      1.1.beta2-45.el6          freeswitch       80 k
 freeswitch-codec-speex                    x86_64      1.1.beta2-45.el6          freeswitch      153 k
 freeswitch-format-local-stream            x86_64      1.1.beta2-45.el6          freeswitch       41 k
 freeswitch-format-native-file             x86_64      1.1.beta2-45.el6          freeswitch       28 k
 freeswitch-format-portaudio-stream        x86_64      1.1.beta2-45.el6          freeswitch      190 k
 freeswitch-format-tone-stream             x86_64      1.1.beta2-45.el6          freeswitch       29 k
 freeswitch-lang-en                        x86_64      1.1.beta2-45.el6          freeswitch       44 k
 libjpeg                                   x86_64      6b-46.el6                 base            134 k
 libogg                                    x86_64      2:1.1.4-2.1.el6           base             21 k
 libtheora                                 x86_64      1:1.1.0-2.el6             base            129 k
 libtiff                                   x86_64      3.9.4-5.el6_2             updates         341 k
 libtool-ltdl                              x86_64      2.2.6-15.5.el6            base             44 k
 libvorbis                                 x86_64      1:1.2.3-4.el6_2.1         updates         168 k
 postgresql-libs                           x86_64      8.4.9-1.el6_1.1           base            198 k
 unixODBC                                  x86_64      2.2.14-11.el6             base            378 k

Transaction Summary
=======================================================================================================
Install      59 Package(s)

Total download size: 20 M
Installed size: 54 M

yum install bluebox

===========================================================================================
 Package             Arch         Version                      Repository             Size
===========================================================================================
Installing:
 bluebox             noarch       1.0-1                        /bluebox-v1.0.3        36 M
Installing for dependencies:
 apr                 x86_64       1.3.9-3.el6_1.2              base                  123 k
 apr-util            x86_64       1.3.9-3.el6_0.1              base                   87 k
 apr-util-ldap       x86_64       1.3.9-3.el6_0.1              base                   15 k
 httpd               x86_64       2.2.15-15.el6.centos.1       updates               813 k
 httpd-tools         x86_64       2.2.15-15.el6.centos.1       updates                70 k
 mailcap             noarch       2.1.31-2.el6                 base                   27 k

Transaction Summary
===========================================================================================
Install       7 Package(s)

Total size: 37 M
Total download size: 1.1 M
Installed size: 40 M

yum install php php-fpm

===============================================================================================================
 Package                   Arch                  Version                             Repository           Size
===============================================================================================================
Installing:
 php                       x86_64                5.3.12-1.el6.remi                   remi                2.3 M
 php-fpm                   x86_64                5.3.12-1.el6.remi                   remi                1.1 M
 php-pdo                   x86_64                5.3.12-1.el6.remi                   remi                109 k
 php-sqlite                x86_64                5.3.12-1.el6.remi                   remi                 62 k
Installing for dependencies:
 php-cli                   x86_64                5.3.12-1.el6.remi                   remi                2.2 M
 php-common                x86_64                5.3.12-1.el6.remi                   remi                891 k

Transaction Summary
===============================================================================================================
Install       4 Package(s)

Total download size: 6.5 M
Installed size: 23 M

yum install mysql-server mysql php-mysql

===============================================================================================================
 Package                      Arch                 Version                            Repository          Size
===============================================================================================================
Installing:
 mysql                        x86_64               5.5.23-1.el6.remi                  remi               5.7 M
 mysql-server                 x86_64               5.5.23-1.el6.remi                  remi                10 M
 php-mysql                    x86_64               5.3.12-1.el6.remi                  remi               124 k
Installing for dependencies:
 compat-mysql51               x86_64               5.1.54-1.el6.remi                  remi               1.4 M
 libaio                       x86_64               0.3.107-10.el6                     base                21 k
 perl-DBD-MySQL               x86_64               4.013-3.el6                        base               134 k
 perl-DBI                     x86_64               1.609-4.el6                        base               705 k
Updating for dependencies:
 mysql-libs                   x86_64               5.5.23-1.el6.remi                  remi               768 k

Transaction Summary
===============================================================================================================
Install       7 Package(s)
Upgrade       1 Package(s)

yum install freeswitch-sounds-en-us-callie-all freeswitch-sounds-music

====================================================================================================
 Package                                    Arch         Version             Repository        Size
====================================================================================================
Installing:
 freeswitch-sounds-en-us-callie-all         noarch       1.0.18-1.el6        freeswitch       3.6 k
 freeswitch-sounds-music                    noarch       1.0.8-2.el6         freeswitch       2.0 k
Installing for dependencies:
 freeswitch-sounds-en-us-callie-16000       noarch       1.0.18-1.el6        freeswitch        27 M
 freeswitch-sounds-en-us-callie-32000       noarch       1.0.18-1.el6        freeswitch        53 M
 freeswitch-sounds-en-us-callie-48000       noarch       1.0.18-1.el6        freeswitch        77 M
 freeswitch-sounds-en-us-callie-8000        noarch       1.0.18-1.el6        freeswitch        14 M
 freeswitch-sounds-music-16000              noarch       1.0.8-2.el6         freeswitch        26 M
 freeswitch-sounds-music-32000              noarch       1.0.8-2.el6         freeswitch        50 M
 freeswitch-sounds-music-48000              noarch       1.0.8-2.el6         freeswitch        72 M
 freeswitch-sounds-music-8000               noarch       1.0.8-2.el6         freeswitch        13 M

Transaction Summary
====================================================================================================
Install      10 Package(s)

Total download size: 331 M
Installed size: 458 M

Log file error

The status page generates an ESL error. This is due to the log file location being hard coded in thr ESL module.

Fix: Link the hard coded path '/usr/local/freeswitch/log' to '/var/log/freeswitch'. See ticket 457.

2012-05-22_144657.png

 

Bluebox rpm installation output

  Installing : bluebox-1.0-1.noarch
========================================================
 ______  _      _     _ _______ ______  _______ _     _
(____  \(_)    (_)   (_|_______|____  \(_______|_)   (_)
 ____)  )_      _     _ _____   ____)  )_     _   ___
|  __  (| |    | |   | |  ___) |  __  (| |   | | |   |
| |__)  ) |____| |___| | |_____| |__)  ) |___| |/ / \ \
|______/|_______)_____/|_______)______/ \_____/|_|   |_|

      - - - Our free software. Your next VoIP system!
========================================================

SELINUX
---------------------------------------------------------
We have detected that selinux is enabled. This will cause
issues as it inhibits the webservers ability to write to
the softswitch config.
Would you like to disable selinux (Y/n)? # selinuxenabled 0
# sed -i -r 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

WEB USER
---------------------------------------------------------
We need to verify the web user so we can correctly set
the permissions on certain folder/files.
Web user name [apache]?
BLUEBOX PRIVILEGES
---------------------------------------------------------
Updating the permissions so Blue.box can write to its
configuration files.
# chgrp -R apache bluebox/logs/
# chmod -R g+w bluebox/logs
# chgrp -R apache bluebox/cache/
# chmod -R g+w bluebox/cache
# chgrp -R apache bluebox/config/
# chmod -R g+w bluebox/config/
# chgrp -R apache modules/freeswitch-*/config/freeswitch.php
# chmod -R g+w modules/freeswitch-*/config/freeswitch.php
# chgrp -R apache modules/asterisk-*/config/asterisk.php
# chmod -R g+w modules/asterisk-*/config/asterisk.php
# chgrp -R apache uploads/
# chmod -R g+w uploads/

SOFTSWITCH PRIVILEGES
---------------------------------------------------------
We need to verify the path to your softswitch confs
directory so we can update its permissions.
Softswitch conf dir []?
SOUND FILE PRIVILEGES
---------------------------------------------------------
We need to verify the path to your sound files.
Sound file dir []?
PLEASE SET UP YOUR DB
---------------------------------------------------------
You must now ensure your database has a user configured
for Blue.box, you will enter the credintials in the next
phase.

COMPLETE!
---------------------------------------------------------
Now point your web browser to your server and the
Blue.box installer will get your system ready.
Example http://127.0.0.1/

      Welcome and thank you for using Blue.Box!

Installed:
  bluebox.noarch 0:1.0-1
Document Actions