$ sudo apt-get install \
autoconf automake devscripts gawk g++ git-core \
libjpeg-dev libncurses5-dev libtool make python-dev \
gawk pkg-config libtiff4-dev libperl-dev libgdbm-dev \
libdb-dev gettext libssl-dev libcurl4-openssl-dev \
libpcre3-dev libspeex-dev libspeexdsp-dev libsqlite3-dev \
libedit-dev libldns-dev libpq-dev
$ cd ${HOME}
$ mkdir src
$ cd src
# To build from the current release source code:
$ git clone -b v1.4 https://stash.freeswitch.org/scm/fs/freeswitch.git
$ cd freeswitch
# The -j argument spawns multiple threads to speed the build process
$./bootstrap.sh -j
# if you want to add or remove modules from the build, edit modules.conf
$ vim.tiny modules.conf
$ ./configure \
--prefix=/opt/freeswitch_v1.4 \
--enable-core-pgsql-support
$ make
# hide the .spec files
$ mkdir ../freesqitch-hide && mv *.spec ../freesqitch-hide/
$ sudo checkinstall \
--pkgname="freeswitch-mdsh" \
--pkgversion="1:$(date +%Y%m%d%H%M)-1.4" \
--backup=no \
--fstrans=no \
--nodoc \
--default \
sh -c "make install \
&& chown -R freeswitch:daemon /opt/freeswitch_v1.4/ \
&& chmod -R ug=rwX,o= /opt/freeswitch_v1.4/ \
&& chmod -R u=rwx,g=rx /opt/freeswitch_v1.4/*"
# disable built-in FreeSwitch
$ sudo update-rc.d freeswitch disable
# enable our version
$ sudo update-rc.d freeswitch-mdsh defaults
${FREESWITCH_INSTALL}/conf
freeswitch.xml includes, in order...
- vars.xml
global server-wide variables
- autoload_configs/*.xml
module configuration files
which usually includes sofia.conf.xml, that then includes...
- sip_profiles/*.xml
which usually includes internal.xml and external.xml
which define two sofia profiles named internal and external, that then include...
- sip_profiles/external/*.xml
- sip_profiles/internal/*.xml
- dialplan/*.xml
which usually includes default.xml and public.xml, that then include...
- dialplan/default/*.xml
- dialplan/public/*.xml
- directory/*.xml
which usually includes default.xml, that then includes...
- directory/default/*.xml
each file usually defines a user allowed to make calls
- lang/de/*.xml
- lang/en/*.xml
- lang/fr/*.xml
- lang/ru/*.xml
Run ${FREESWITCH_INSTALL}/bin/fs_cli and execute reloadxml, which does what you expect.
VoIP at home
We have a
FreeSwitch server, an SPA-3000 on the incoming POTS line, and 4 SPA-921 phones. Internal phones use the number range 200-299.
Outgoing calls from VoIP phones to the POTS line do not require a prefix - there is enough logic in the dial-plan to sort that out.
Incoming calls from the POTS line calls a selection of VoIP handsets in parallel.
Incoming configuration
The SPA-3000 registers with the
FreeSwitch server. The SPA-3000 is configured with the
PSTN Caller Default DP set to
(S0<:s>)
${FREESWITCH_INSTALL}/conf/dialplan/public/09_pstn.xml includes this, which forwards the incoming call the extension
house in the default XML dialplan.
<extension name="FROM_PSTN">
<condition field="destination_number" expression="^s$">
<action application="set" data="domain_name=$${domain}"/>
<action application="transfer" data="house XML default"/>
</condition>
</extension>
${FREESWITCH_INSTALL}/conf/dialplan/default/03_extensions.xml includes this, which forwards the incoming call to the group
house.
<extension name="HouseGroup">
<condition field="destination_number" expression="^house$">
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="set" data="call_timeout=15"/>
<action application="bridge" data="{ignore_early_media=true}${group_call(house+A@${domain_name})}"/>
<action application="hangup"/>
</condition>
</extension>
${FREESWITCH_INSTALL}/conf/directory/default.xml includes this, which defines members of the
house group.
<group name="house">
<users>
<user id="200" type="pointer"/>
<user id="201" type="pointer"/>
<user id="222" type="pointer"/>
<user id="251" type="pointer"/>
</users>
</group>
${FREESWITCH_INSTALL}/conf/dialplan/default/03_extensions.xml includes this, which actually bridges the call to the internal phones - possibly doing id to number conversion.
<extension name="HouseExtension">
<condition field="destination_number" expression="^2[0-9]{2}$">
<action application="bridge" data="user/${user_data(${destination_number}@${domain_name} attr id)}"/>
</condition>
</extension>
FreeSwitch is mentioned on: Linux