FreeSWITCH          




Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Don't change global Git config where possible

...

Panel
borderColorlightgray
bgColor#ffdddd
borderWidth1
titleBGColor#F7F7F7
borderStyledotted
titleCompiling from source code

Building From Source

Compiling Release Branch (production)

Code Block
languagebash
themeEmacs
titleRelease source build
wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -

echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
apt-get update
apt-get install -y --force-yes freeswitch-video-deps-most
 
# because then let's get the source. Use the -b flag to get a specific branch
cd /usr/src/
git clone https://freeswitch.org/stash/scm/fs/freeswitch.git -bv1.6 freeswitch
cd freeswitch
 
# Because we're in a branch that will go through many rebases, it's
# better to set this one, or you'll get CONFLICTS when pulling (update).
git config --global pull.rebase true
 
# then let's get the source. Use the -b flag to get a specific branch
cd /usr/src/
git clone https://freeswitch.org/stash/scm/fs/freeswitch.git -bv1.6 freeswitch
cd freeswitchand do the build
./bootstrap.sh -j
./configure
make
make install

 

Compiling Latest Master (for testing)

Status
colourYellow
titleWARNING
not suitable for production

Code Block
languagebash
themeEmacs
titleMaster source build
wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -

echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
echo "deb http://files.freeswitch.org/repo/deb/debian-unstable/ jessie main" >> /etc/apt/sources.list.d/freeswitch.list
apt-get update
apt-get install -y --force-yes freeswitch-video-deps-most

# Then let's get the source. Use the -b flag to get a specific branch
cd /usr/src/
git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch
cd freeswitch

# Because we're in a branch that will go through many rebases, it's
# better to set this one, or you'll get CONFLICTS when pulling (update).
git config --global pull.rebase true

# Then let's get the source. Use the -b flag to get a specific branch
cd /usr/src/
git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitchand cddo freeswitchthe build

# The -j argument spawns multiple threads to speed the build process, but causes trouble on some systems
./bootstrap.sh -j

# if you want to add or remove modules from the build, edit modules.conf
vi modules.conf

# add a module by removing '#' comment character at the beginning of the line
# remove a module by adding the '#' comment character at the beginning of the line 
# containing the name of the module to be skipped in the build process

./configure
make
make install

# Install audio files:
make cd-sounds-install cd-moh-install

# To update an installed build:
cd /usr/src/freeswitch
make current

Before Starting FreeSWITCH

If you built

Fs
from source code you should set file permissions and ownership before starting FreeSWITCH. Follow the post-installation instructions.

 

...

Code Block
languagebash
titleScript FreeSWITCH demo install
#!/bin/sh
# Simple script to setup a webrtc enabled lab with freeswitch, nginx, letsencrypt certificates and verto_communicator.
# Adapt the DOMAIN & IP variables below and launch as root on on a freshly minimal installed debian 8 ( jessie ) server.
# DO NOT USE IN PRODUCTION, it's for proof-of-concept purposes.
# FreeSWITCH config is the default vanilla demo config, you SHOULD CHANGE the DEFAULT PASSWORDS ( extensions, event_socket, etc ... )
# At the end of the script, you can navigate to https://$DOMAIN/vc and enjoy Verto Communicator in your web browser!
# Author: "Tristan Mahe" <gled@remote-shell.net>
# License: WTFPL

DOMAIN="your.domain.here"
IP="1.2.3.4"

apt-get clean && apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade

apt-get install -y wget git

wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -

cd /usr/src

git clone https://freeswitch.org/stash/scm/fs/freeswitch.git -bv1.6 freeswitch

echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/debian-backports.list

apt-get update && apt-get install -y freeswitch-meta-all nginx-extras freeswitch-mod-verto freeswitch-mod-rtc

apt-get install -y letsencrypt -t jessie-backports
letsencrypt certonly -a webroot --webroot-path=/var/www/html -d $DOMAIN

cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/letsencrypt/live/$DOMAIN/privkey.pem > /etc/freeswitch/tls/wss.pem

cp -f /usr/src/freeswitch/html5/verto/video_demo/dp/dp.xml /etc/freeswitch/dialplan/default/0000_dp.xml

perl -i -pe 's/# listen/listen/g' /etc/nginx/sites-enabled/default
perl -i -pe 's/# include snippets\/snakeoil.conf/include snippets\/letsencrypt.conf/g' /etc/nginx/sites-enabled/default
perl -i -pe 's/<!--  <param name="ext-rtp-ip" value=""\/> -->/<param name="ext-rtp-ip" value="$IP"\/>/g' /etc/freeswitch/autoload_configs/verto.conf.xml

echo "ssl_certificate /etc/letsencrypt/live/$DOMAIN/fullchain.pem;" >> /etc/nginx/snippets/letsencrypt.conf
echo "ssl_certificate_key /etc/letsencrypt/live/$DOMAIN/privkey.pem;" >> /etc/nginx/snippets/letsencrypt.conf

# Attention with this, it may break other software you want to get through Git
git config --global url."https://".insteadOf git://

cd /usr/src/freeswitch/html5/verto/verto_communicator/
./debian8-install.sh

ln -s /usr/src/freeswitch/html5/verto/verto_communicator/dist /var/www/html/vc

service nginx restart
service freeswitch restart