Communication in the post-PRISM world

Your Free Switchboard

The SIP server that best combines ease of installation and configuration, offers a large number of functionalities, and complies with the three laws of confidentiality is FreeSWITCH [8]. Although FreeSWITCH is not in the Debian repositories, it is very easy to obtain the software's source code.

To begin, install the Git version control software and then grab the latest stable version of FreeSWITCH from the project's repository:

# apt-get install git
$ git clone -b v1.2.stable git://

to grab the latest stable version of FreeSWITCH from the project's repository.

Although you may find compiling from scratch quite daunting, FreeSWITCH comes with well-thought-out scripts to help you along the way.

The next step is to download a couple of tools necessary to build the files you need before starting the compile proper:

# apt-get install autoconf libtool

Then, change to the freeswitch directory where you downloaded the source code,

$ cd freeswitch/

and run a script that builds the files you need to compile:

$ ./

On a vanilla Debian install, you need to run the following to satisfy all the dependencies that FreeSWITCH requires:

# apt-get install g++ pkg-config uuid-dev zlib1g-dev libgnutls-dev libjpeg8-dev libncurses5-dev libssl-dev

Next, you can configure the compilation by running the configure script created by the script:

$ ./configure

After running configure and before the actual compile, you might want to edit modules.conf and remove the pound sign (#) from the following line:


This step uncomments the line and makes IVR (Interactive Voice Response  – as used in voice-based interactive menus) available later. Finally, enter:

$ make
# make install

to compile.

Honks, Buzzes, and Robot Voices

To complete your setup, you'll need a full library of tones, irritating hold music, and voice prompts. To download and install the FreeSWITCH default library of sounds, enter:

# make all cd-sounds-install cd-moh-install

Of course, these items can be exchanged for your own personalized recordings later, but the files offered by FreeSWITCH are great to get started.

Up and Running

Now you can run FreeSWITCH with:


This step outputs a lot of status lines as it boots and will finally dump you at the FreeSWITCH command line. For all practical purposes, you are now up and running and can start placing calls through FreeSWITCH.

To test your setup, you first need to log on to one of the preset accounts. By default, FreeSWITCH establishes the IP address of the machine it is running on as the "host." If you are unsure what IP address FreeSWITCH is using, type

sofia status

at the FreeSWITCH command line, and you will see something like the information shown in Figure 2.

Figure 2: Use the FreeSWITCH command line to get information about the system.

Several default accounts are set up in FreeSWITCH, including extensions numbered 1000 through 1019, all of which have "1234" as passwords. You might want to change these accounts and their passwords once you move FreeSWITCH into production, but for testing, these accounts will be fine. (You can change default passwords and other variables by editing the var.xml file located in the conf directory.)

To configure Ekiga [9], for example, go to Edit | Accounts and then choose Accounts | Add a SIP Account and populate the fields with something similar to that shown in Figure 3.

Figure 3: Configuring Ekiga for use with a default FreeSWITCH account.

Configuration can vary from phone to phone; however, on a Samsung S3 running the latest CyanogenMod, you can open the Phone App, press Menu, choose Settings, then scroll down and, under Internet settings, select Accounts, then Add Account. You can then fill in the configuration screen as shown in Figure 4.

Figure 4: Configuring an SIP account on an Android device.

Next, you can, for example, phone 9198, and you will hear the Tetris theme played by the FreeSWITCH tone system.

To include your own users, create an XML file in the conf/directory/default directory under the FreeSWITCH default directory (if you have followed this tutorial to the letter up to this point, that would probably be the /usr/local/freeswitch/conf/directory/default directory). If you wanted to create an account for user paul, for example, you would create a file that looked something like Listing 1.

Listing 1



This is a bare-bones version of a user setup that will work with the default FreeSWITCH configuration. Realistically, however, a complete user file would look like Listing 2 and would require you to modify the /usr/local/freeswitch/conf/dialplan/default.xml and /usr/local/freeswitch/conf/dialplan/public.xml files to include the 1500 extension. To do this, locate the line that reads

Listing 2

paul.xml, Mark 2


<condition field="destination_number" expression="^(10[01][0-9])$">

in the Local_Extension section in default.xml and change it to

<condition field="destination_number" expression="^(10[01][0-9]|1500)$">

Then locate the line that reads

<condition field="destination_number" expression="^(10[10][0-9])$">

in public.xml and change it to

<condition field="destination_number" expression="^(10[10][0-9]|1500)$">

to include the new extension.

Here, the ^(10[01][0-9])$ string is a regular expression that gives you extensions from 1000 to 1019 by default. You can change it so you have more extensions.

If you rewrote this as ^(10[01][0-9]|150[012])$, for example, you would include, three more extensions, 1500,1501,1502. Before you go around creating tons of new numbers, however, read through default.xml and public.xml carefully and make sure you don't write a regex that overlaps with other patterns already in use.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More