Installing FreeSWITCH on Scaleway C1

Scaleway (a cloud service by online.net) offers ARM-based dedicated servers for EUR9.99/month, and the first month free. The platform is powerful enough to run a small or FreeSWITCH server, and it shows nice results in voice quality tests.

These instructions are for Debian Wheezy distribution.

By default, the server is created with Linux kernel 3.2.34, and this kernel version does not have a high-resolution timer. You need to choose 3.19.3 in server settings.

At Scaleway, you get a dedicated public IP address and 1:1 NAT to a private IP address on your server. So, FreeSWITCH SIP profiles need to be updated (“ext-rtp-ip” and “ext-sip-ip” to point to you rpublic IP address).

FreeSWITCH compiles and links “mpg123-1.13.2” library, which fails to compile on ARM architecture.  You need to edit the corresponding files to point to “mpg123-1.19.0” and commit back to Git, because the build scripts check if any modified and uncommitted files exist in the source tree. Also the patch forces to use gcc-4.7, as 4.6 is known with some problems on ARM architecture.

apt-get update && apt-get install -y make curl git sox flac

mkdir -p /usr/src/freeswitch
cd /usr/src/freeswitch/
git clone https://gist.github.com/b27f4e41cc02f49d31a0.git
git clone -b v1.4 https://stash.freeswitch.org/scm/fs/freeswitch.git /usr/src/freeswitch/src
cd src
git apply ../b27f4e41cc02f49d31a0/freeswitch-arm.patch
git add --all
git commit -m 'mpg123-1.19.0.patch' 
./debian/util.sh build-all -i -z1 -aarmhf -cwheezy

# This will run for about 4 hours, and you can build the sound packages in parallel in another terminal.

mkdir /usr/src/freeswitch-sounds
cd /usr/src/freeswitch-sounds
git clone https://github.com/traviscross/freeswitch-sounds.git music-default
cd music-default
./debian/bootstrap.sh -p freeswitch-music-default
./debian/rules get-orig-source
tar -xv --strip-components=1 -f *_*.orig.tar.xz && mv *_*.orig.tar.xz ../
dpkg-buildpackage -uc -us -Zxz -z1


cd /usr/src/freeswitch-sounds
git clone https://github.com/traviscross/freeswitch-sounds.git sounds-en-us-callie
cd sounds-en-us-callie
./debian/bootstrap.sh -p freeswitch-sounds-en-us-callie
./debian/rules get-orig-source
tar -xv --strip-components=1 -f *_*.orig.tar.xz && mv *_*.orig.tar.xz ../
dpkg-buildpackage -uc -us -Zxz -z1


cd /usr/src/freeswitch-sounds
dpkg -i *.deb

cd /usr/src/freeswitch
# this will fail because dependencies are not installed
dpkg -i freeswitch-all_*
# this will add dependencies
apt-get -f install 
# finally, install FreeSWITCH
dpkg -i freeswitch-all_*

# Minimal configuration that you can use
cd /etc
git clone https://github.com/voxserv/freeswitch_conf_minimal.git freeswitch
# edit sip_profiles/*.xml and put the public IP address into "ext-rtp-ip" and "ext-sip-ip"
insserv freeswitch
service freeswitch start

Advertisements

, , , ,

  1. #1 by samy on September 10, 2015 - 1:04 am

    when I wrote “dpkg -i freeswitch-all_*”
    I got the following error

    dpkg: error processing archive freeswitch-all_* (–install):
    cannot access archive: No such file or directory
    Errors were encountered while processing:
    freeswitch-all_*

    I would appreciate a help

    • #2 by txlab on September 10, 2015 - 8:02 am

      that’s right, there are new dependencies in current freeswitch: by default, it tries to build video modules, and they require additional libraries. You can disable mod_fsv (also probably mod_png and mod_vpx). See the instructions in debian/README.source in FreeSWITCH source tree.

  2. #3 by samy on September 13, 2015 - 4:25 pm

    Oh thanks a lot. it is working pretty fine now. thanks for the great article.

    • #4 by txlab on September 13, 2015 - 4:32 pm

      Would you send an update?

  3. #5 by samy on September 14, 2015 - 2:26 pm

    Well, I just disabled mod_fsv mod_png and mod_vpx and built it and it worked with no issue. but today I have used a new Ubuntu instance and just apt-get install freeswitch after the update and it worked right away after installation.

  4. #6 by samy on September 14, 2015 - 2:30 pm

    by the way srtp and opus are doing very well on this types of servers.

  5. #7 by frederic on March 7, 2016 - 3:28 pm

    Which Ubuntu instance exactly? And is it possible to have instructions for freeswitch 1.6? Thank you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: