Difference between revisions of "Freeswitch"

From SME Server
Jump to navigationJump to search
 
(29 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
__TOC__
 
__TOC__
 
==About==
 
==About==
'''[http://freeswitch.org Freeswitch]''' is a scalable open source cross-platform telephony platform designed to route and interconnect popular communication protocols using audio, video, text or any other form of media.  It was created in 2006 to fill the void left by proprietary commercial solutions.  FreeSWITCH also provides a stable telephony platform on which many applications can be developed using a wide range of free tools
+
"'''[http://freeswitch.org Freeswitch]''' is a scalable open source cross-platform telephony platform designed to route and interconnect popular communication protocols using audio, video, text or any other form of media.  It was created in 2006 to fill the void left by proprietary commercial solutions.  FreeSWITCH also provides a stable telephony platform on which many applications can be developed using a wide range of free tools".
 +
 
 +
Please visit the http://freeswitch.org website for more detailed information.
  
  
 
==Installation==
 
==Installation==
Both the '''[[Freeswitch_repo|Freeswitch]]''' and '''[[epel|Epel]]''' repositories have to be enabled. Please enable these repositories first.
+
The latest Freeswitch version available for CentOS 6 is the 1.4 branch which is EOL. There will be no Freeswitch RPM's available from the freeswitch repo, only for CentOS 7. Fortunately, the [[okay]] repo has the Freeswitch 1.6 branch RPM's available and up to date. ( http://repo.okay.com.mx/?dir=centos/6/x86_64/release )
 +
 
 +
 
 +
The '''[[okay]]''', '''[[epel|Epel]]''' and '''[[remi]]''' repositories have to be enabled. Please enable these repositories first.
 
After enabling the above repositories, one can install Freeswitch and it's dependencies with yum:
 
After enabling the above repositories, one can install Freeswitch and it's dependencies with yum:
  yum install --nogpgcheck freeswitch-config-vanilla --enablerepo=freeswitch --enablerepo=,epel
+
  yum install ffmpeg --enablerepo=okay,epel
This will install about 60 RPM's with an installed size of 35M.
+
yum install *1.6.19-1* freeswitch-sounds* --enablerepo=okay,epel,remi --exclude=*php*
 +
This must be the above 2 commands, for otherwise there will be a strange dependency issue.
 +
 
 +
Or a basic vanilla install:
 +
yum install freeswitch-config-vanilla --enablerepo=okay,epel,remi,smetest
  
 
{{Note box|If you have installed the '''[[Sogo|SOGo]]''' contrib, you will encounter a dependency issue with libmemcached. There is no resolution yet and your input is welcomed.}}
 
{{Note box|If you have installed the '''[[Sogo|SOGo]]''' contrib, you will encounter a dependency issue with libmemcached. There is no resolution yet and your input is welcomed.}}
 
  
 
==Configuration==
 
==Configuration==
Line 24: Line 32:
 
  config setprop freeswitch status enabled
 
  config setprop freeswitch status enabled
 
  config setprop freeswitch access private
 
  config setprop freeswitch access private
  config setprop freeswitch UDPPorts "5060,5070,5080,3478,3479,16384:32768"
+
  config setprop freeswitch UDPPorts "5060:5061,5080:5081,16384:32768"
  config setprop freeswitch TCPPorts "5066,7443"
+
  config setprop freeswitch TCPPorts "5060:5061,5080:5081"
 
You can toggle the ''access'' property to enable public/private access. Then to apply the new service:
 
You can toggle the ''access'' property to enable public/private access. Then to apply the new service:
 
  signal-event remoteaccess-update
 
  signal-event remoteaccess-update
Line 33: Line 41:
 
  service freeswitch stop
 
  service freeswitch stop
  
 +
==FusionPBX freeswitch GUI==
 +
Like other PBX systems, FreeSWITCH has many options and can be managed from the command line interface (CLI) which for Freeswitch is 'fs_cli'. However a stable GUI for Freeswitch is freely available from FusionPBX and makes life much easier. FusionPBX is only the Graphical interface and relies on a correctly installed Freeswitch engine.
 +
 +
 +
===Installation===
 +
First we need to create a mysql database for FusionPBX where it keeps its configurations.
 +
mysqladmin create fusionpbx
 +
then we enter the mysql cli:
 +
mysql
 +
grant all privileges on fusionpbx.* to 'admin'@'localhost' identified by 'very_strong_password';
 +
flush privileges;
 +
exit
 +
 +
* Install git
 +
* change to Primary /home/e-smith/files/Primary
 +
* git clone https://github.com/fusionpbx/fusionpbx.git
 +
* remove html dir, rename FusionPBX to html set permission to admin:shared
 +
* setting permissions chown -R www:www /home/e-smith/files/Primary/html/*
 +
* change /etc/freeswitch/autoload_configs/event_socket.conf.xml and set listen-ip value (::) to localhost
 +
* Enable Mysql InnoDB ([https://wiki.contribs.org/MySQL#Enable_InnoDB_engine see wiki])
 +
* change /core/install/resources/classes/install_fusionpbx.php and replace 127.0.0.1 with localhost (around line 154) This is for when using MySQL as database.
 +
* set openbasedir of the Primary to /home/e-smith/files/ibays/Primary/html:/tmp
  
===Configuration file===
+
===Setup ODBC===
 +
* Install mysql-connector-odbc
 +
yum install mysql-connector-odbc
 +
* create symbolic link
 +
ln -s /usr/lib64/libmyodbc5.so /usr/lib64/libmyodbc.so
 +
Add FusionPBX to /etc/odbc.ini
 +
[fusionpbx]
 +
Description = MySQL connection to 'fusionpbx' database
 +
Driver = MySQL
 +
Database = fusionpbx
 +
Server = localhost
 +
UserName = [mysql fusionpbx db user]
 +
Password = [mysql fusionpbx db password]
 +
Port = 3306
 +
Socket = /var/lib/mysql/mysql.sock
 +
* Test the ODBC connection
 +
isql fusionpbx [fusion db user]
 +
show tables
 +
quit
 +
* Adjust switch.xml and add
 +
<param name="core-db-dsn" value="database:username:password"/>
 +
* Install php-fpm
 +
yum install php-fpm
 +
and create the db service
 +
config set php-fpm set service status enabled
 +
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S90php-fpm
  
 
[[Category:Howto]]
 
[[Category:Howto]]

Latest revision as of 08:55, 8 September 2017

Warning.png Work in Progress:
This page is a Work in Progress. The contents off this page may be in flux, please have a look at this page history the to see list of changes.


Freeswitch.png

About

"Freeswitch is a scalable open source cross-platform telephony platform designed to route and interconnect popular communication protocols using audio, video, text or any other form of media. It was created in 2006 to fill the void left by proprietary commercial solutions. FreeSWITCH also provides a stable telephony platform on which many applications can be developed using a wide range of free tools".

Please visit the http://freeswitch.org website for more detailed information.


Installation

The latest Freeswitch version available for CentOS 6 is the 1.4 branch which is EOL. There will be no Freeswitch RPM's available from the freeswitch repo, only for CentOS 7. Fortunately, the okay repo has the Freeswitch 1.6 branch RPM's available and up to date. ( http://repo.okay.com.mx/?dir=centos/6/x86_64/release )


The okay, Epel and remi repositories have to be enabled. Please enable these repositories first. After enabling the above repositories, one can install Freeswitch and it's dependencies with yum:

yum install ffmpeg --enablerepo=okay,epel
yum install *1.6.19-1* freeswitch-sounds* --enablerepo=okay,epel,remi --exclude=*php*

This must be the above 2 commands, for otherwise there will be a strange dependency issue.

Or a basic vanilla install:

yum install freeswitch-config-vanilla --enablerepo=okay,epel,remi,smetest


Important.png Note:
If you have installed the SOGo contrib, you will encounter a dependency issue with libmemcached. There is no resolution yet and your input is welcomed.


Configuration

Adding Freeswitch as a service and open ports

To automatically start Freeswitch at boot and configure the ports:

ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S99freeswitch
config set freeswitch service 
config setprop freeswitch status enabled
config setprop freeswitch access private
config setprop freeswitch UDPPorts "5060:5061,5080:5081,16384:32768"
config setprop freeswitch TCPPorts "5060:5061,5080:5081"

You can toggle the access property to enable public/private access. Then to apply the new service:

signal-event remoteaccess-update

Freeswitch can now be started and stopped with

service freeswitch start
service freeswitch stop

FusionPBX freeswitch GUI

Like other PBX systems, FreeSWITCH has many options and can be managed from the command line interface (CLI) which for Freeswitch is 'fs_cli'. However a stable GUI for Freeswitch is freely available from FusionPBX and makes life much easier. FusionPBX is only the Graphical interface and relies on a correctly installed Freeswitch engine.


Installation

First we need to create a mysql database for FusionPBX where it keeps its configurations.

mysqladmin create fusionpbx

then we enter the mysql cli:

mysql
grant all privileges on fusionpbx.* to 'admin'@'localhost' identified by 'very_strong_password';
flush privileges;
exit
  • Install git
  • change to Primary /home/e-smith/files/Primary
  • git clone https://github.com/fusionpbx/fusionpbx.git
  • remove html dir, rename FusionPBX to html set permission to admin:shared
  • setting permissions chown -R www:www /home/e-smith/files/Primary/html/*
  • change /etc/freeswitch/autoload_configs/event_socket.conf.xml and set listen-ip value (::) to localhost
  • Enable Mysql InnoDB (see wiki)
  • change /core/install/resources/classes/install_fusionpbx.php and replace 127.0.0.1 with localhost (around line 154) This is for when using MySQL as database.
  • set openbasedir of the Primary to /home/e-smith/files/ibays/Primary/html:/tmp

Setup ODBC

  • Install mysql-connector-odbc
yum install mysql-connector-odbc
  • create symbolic link
ln -s /usr/lib64/libmyodbc5.so /usr/lib64/libmyodbc.so

Add FusionPBX to /etc/odbc.ini

[fusionpbx]
Description = MySQL connection to 'fusionpbx' database
Driver = MySQL
Database = fusionpbx
Server = localhost
UserName = [mysql fusionpbx db user]
Password = [mysql fusionpbx db password]
Port = 3306
Socket = /var/lib/mysql/mysql.sock
  • Test the ODBC connection
isql fusionpbx [fusion db user]
show tables
quit
  • Adjust switch.xml and add
<param name="core-db-dsn" value="database:username:password"/>
  • Install php-fpm
yum install php-fpm

and create the db service

config set php-fpm set service status enabled
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S90php-fpm