Freeswitch¶
Freeswitch is a multi-protocol VoIP softswitch. It is only used here to provide connectivity tests. It could potentially be used for anything that requires answering a call automatically, like voicemail.
Install the Debian packages from the Linux Quick Start
apt-get install freeswitch-meta-bare freeswitch-meta-codecs freeswitch-meta-conf freeswitch-meta-vanilla
Post install¶
Link configuration files to system directory
ln -s /usr/share/freeswitch/conf/vanilla/ /etc/freeswitch
Configure FS to only listen on 127.0.0.1:5060. Calls will always originate through Kamailio.
Add the following line to the top of /etc/freeswitch/vars.xml
<X-PRE-PROCESS cmd="set" data="local_ip_v4=127.0.0.1"/>
Ensure all SIP configuration points to this variable.
cd /etc/freeswitch/sip_profiles grep -r local_ip_v4 .
Ensure that outputs the following. If it does not, open internal.xml and external.xml and correct the syntax
./internal.xml: <param name="rtp-ip" value="$${local_ip_v4}"/> ./internal.xml: <param name="sip-ip" value="$${local_ip_v4}"/> ./internal.xml: <param name="presence-hosts" value="$${domain},$${local_ip_v4}"/> ./internal.xml: <param name="ext-rtp-ip" value="$${local_ip_v4}"/> ./internal.xml: <param name="ext-sip-ip" value="$${local_ip_v4}"/> ./external.xml: <param name="rtp-ip" value="$${local_ip_v4}"/> ./external.xml: <param name="sip-ip" value="$${local_ip_v4}"/> ./external.xml: <param name="ext-rtp-ip" value="$${local_ip_v4}"/> ./external.xml: <param name="ext-sip-ip" value="$${local_ip_v4}"/>
By default Freeswitch does not allow unauthenticated calls to be answered. This doesn't work out too well for our echo test. Let's allow all connections from localhost to pass without restriction. Edit /etc/freeswitch/autoload_configs/acl.conf.xml
, substituting your public IP address for the value of cidr=
<node type="allow" cidr="<your public IP address>/32"/>
Now that network traffic is allowed from Kamailio, you have to add a public dialplan entry to terminate at the echo test for calls to 9196. Place the following contents in /etc/freeswitch/dialplan/public/00_inbound_did.xml
<include> <extension name="echo"> <condition field="destination_number" expression="^9196$"> <action application="answer"/> <action application="echo"/> </condition> </extension> </include>
You can supervise freeswitch with Monit