SlideShare a Scribd company logo
1 of 5
Download to read offline
pen source projects have lowered
the barrier to entry into tele-
phony for hobbyists and busi-
nesses alike. The popular Asterisk PBX
tool, for instance, is a high-functioning
and low-budget telephony alternative
that has proven disruptive in the world of
business telephone systems [1]. Perhaps
the most disruptive software of all, how-
ever, comes in the form of the scalable
softswitch library called FreeSWITCH.
The FreeSWITCH website [2] says that
it can be used as a “simple switching en-
gine, a PBX, a media gateway, or a
media server to host IVR applications.”
True to that chameleon-like descrip-
tion, FreeSWITCH has appeared in pro-
duction environments as a telco switch,
in numerous business scenarios as a
PBX, as a softphone for laptop users,
and even as a voice routing engine for
the OpenSim project.
Additionally, you can deploy
FreeSWITCH as an application or use it
as a library (libfreeswitch) that can be
embedded in third-party software. This
double identity is similar to the relation-
ship between cURL (application) and
libcurl (library).
FreeSWITCH has been used in some
exotic scenarios; however, those new to
telephony applications are best served
starting out with FreeSWITCH in its de-
fault configuration as a SOHO PBX. Al-
though you might find the numerous
FreeSWITCH configuration files and set-
tings overwhelming, in a short time, you
will appreciate the power and flexibility
of this versatile telephony tool.
As of this writing, the current, stable
version of FreeSWITCH is 1.0.4, which
can be downloaded from the project
website [3], or you can use the Subver-
sion repository to install the latest ver-
sion. Unlike many projects, the SVN
trunk is extremely stable, so it might be
convenient for you simply to use the lat-
est trunk.
In any case, the FreeSWITCH develop-
ers have made it very easy to update to
the latest trunk, even if you have in-
stalled from the latest stable version.
Some pre-compiled binaries are known
to exist; however, I recommend compil-
ing from source.
First, unpack and install the source. In
this example, I will download into /usr/
src and install from there:
tar zxvf freeswitch-1.0.4.tar.gz
cd freeswitch-1.0.4
./configure
make install
I recommend getting the sound files:
make cd-sounds-install
make cd-moh-install
FreeSWITCH comes with and can han-
dle sound files at 8, 16, 32, and 48kHz
sampling rates. Few, if any, telephony
systems – open source or proprietary –
can do the kinds of things FreeSWITCH
can do with calls at multiple sampling
rates.
The installation will take some time,
so feel free to chain the commands to-
gether with the && operator.
FreeSWITCH is a powerful and versatile telephony platform that can scale
from a softphone to a PBX and even to a carrier-class softswitch.
BY MICHAEL S. COLLINS
FreeSWITCH
54 ISSUE 106 SEPTEMBER 2009
When the process is complete, you
will have a basic FreeSWITCH installa-
tion. Because it is handy to have the two
main FreeSWITCH executable files avail-
able in the bin path, I use symlinks:
ln -s
/usr/local/freeswitch/bin/freeswitch
/usr/local/bin/freeswitch
ln -s /usr/local/freeswitch/bin
/fs_cli /usr/local/bin/fs_cli
To launch the application, enter
freeswitch, and use the fs_cli utility to ac-
cess the command line of any
FreeSWITCH server to which you have
access, even if it is on another server. At
first, you’ll see quite a bit of debug/log
information, but don’t worry about er-
rors or warnings at this point.
The first basic command is version,
which displays the version of Free-
SWITCH you are running, including the
SVN revision. The status command
shows information about your instance
of FreeSWITCH, including uptime and
the number of currently active sessions.
Another basic command is the self-de-
scriptive help.
To exit FreeSWITCH, type fsctl shut-
down or use the shortcut command ...
(three periods).
If you have a sound card or headset on
your system then try this:
load mod_portaudio
After several debug lines, you’ll see
+OK when the module is loaded. Now
list the PortAudio devices available on
your system:
pa devlist
API CALL [pa(devlist)] output:
0;Built-in Microphone;2;0;i
1;Built-in Input;2;0;
2;Built-in Output;0;2;r,o
3;Logitech USB Headset;0;2;
4;Logitech USB Headset;1;0;
The i and o are next to the currently se-
lected input and output devices. To
change the input device, use the pa
indev command with the device number,
pa indev #x
where x is the number of the input de-
vice. The output device can be changed
with the pa outdev command. In my
setup, I’ll use device 4 as output and de-
vice 5 as input.
If you have the MOH (music on hold)
files installed, this command will make a
call to the MOH extension and send the
MOH to the PortAudio output device:
pa call 9999
If you hear music, it was a successful
call. If not, make sure
the MOH files were in-
stalled properly. Hang
up with the pa
hangup command.
To make sure both
input and output de-
vices are working, do
an echo test:
pa call 9996
Now when you speak
into the input device,
your voice should be
echoed to the output
device. The pa
hangup command dis-
connects.
As you can see, it is
possible to use Free-
SWITCH and PortAu-
dio to create a simple
softphone. In this way, you will be able
to use any codec that your FreeSWITCH
installation supports – and there are
some very high quality codecs available
– without installing a softphone client.
The most common way to use Free-
SWITCH is with a SIP phone. A physical
handset is often called a hard phone,
whereas a software-based phone is ap-
propriately called a softphone. Numer-
ous types of hard phones are available
from manufacturers. Softphones come in
both proprietary and FLOSS varieties. A
popular free – but not open source –
softphone is X-Lite from CounterPath
[4], which is available for Linux, Mac OS
X, and Windows. Even if your Free-
SWITCH server runs on Linux, your soft-
phones can run on any operating sys-
tem, as long as they are SIP compliant.
To begin, download X-Lite for your
desktop or laptop operating system and
perform a default install. (Installing a
softphone on the same system that is
running FreeSWITCH is not recom-
mended; however, in many cases, it will
work for the sake of testing.)
FreeSWITCH
55ISSUE 106SEPTEMBER 2009
SIP is a TCP/IP-based Application Layer
protocol used for multimedia sessions
over the Internet. The text-based proto-
col is similar to HTTP, with requests and
responses, header fields, encoding
rules, and status codes. In addition to
VoIP, SIP is used in instant messaging,
online gaming, and distribution of
streaming multimedia.
Session Initiation Protocol
Now launch X-Lite and open the SIP
Account Settings menu by clicking the
Show Menu button. (The button is the
small down-arrow at the top of the
phone, just left of center.)
Only one SIP account is available in X-
Lite, so click on it then click the Proper-
ties button. As shown in Figure 1, fill in
the fields and use 1234 as the password
for extension 1000.
Next, clear out the Dialing plan field
because it is not needed with
FreeSWITCH. Now click OK then Close,
and the phone will attempt to register.
Figure 2 shows a successful registration.
To make a test call, dial 9999 and click
the green button to send. In a few mo-
ments you should hear music on hold.
Figure 3 shows a call in progress to ex-
tension 9999.
To shut down FreeSWITCH, use the
fsctl shutdown (...) command.
The default FreeSWITCH configuration
has many features. Table 1 shows Dial-
plan highlights, and Table 2 shows some
of the more important files and subdi-
rectories in the FreeSWITCH configura-
tion.
The default install will create a direc-
tory named /usr/local/freeswitch/conf,
which I’ll refer to as $CONF. All config
files are XML and can include other XML
files.
The top of this XML tree is $CONF/
freeswitch.xml, which includes various
XML files that in turn include still more
XML files. This arrangement allows you
to make changes to the FreeSWITCH
configuration without sift-
ing through a particularly
large file.
To start FreeSWITCH as a
daemon, use the -nc (no
console) command-line ar-
gument:
freeswitch -nc
FreeSWITCH will report
that it is backgrounding
and will give the process ID
(PID). To stop Free-
SWITCH, simply execute
freeswitch -stop at the Linux prompt. For
now, leave FreeSWITCH running and use
the fs_cli command to connect: You will
be greeted with a brief welcome message
and a CLI prompt and perhaps some
debug messages on the screen. To turn
down the debug level, type:
/log info
This will restrict log messages to the
INFO level and lower and keep you from
being inundated with debug information.
All commands to the fs_cli program
begin with a slash, so type /help to see a
list of available commands. Anything
else typed at the fs_cli prompt will be
sent to the FreeSWITCH server, with one
exception: The ellipsis (...) will not shut
down FreeSWITCH from fs_cli; rather, it
exits the fs_cli program. Instead of shut-
ting down FreeSWITCH from within fs_
cli, exit the program and then issue the
freeswitch -stop command at the Linux
prompt.
Just let FreeSWITCH continue to run
in the background while you set up a
new user and modify the Dialplan.
FreeSWITCH comes with 20 users pre-
defined, but if you want to add more,
just two steps modify the configuration:
$CONF/directory/
default/
user to be called
To add a new user named “Katherine”
with extension number 1500, change di-
rectory into $CONF/directory/default and
make a copy of 1000.xml:
cp 1000.xml 1500.xml
In an editor, open 1500.xml, replace
1000 with 1500, and change the effec-
tive_caller_id_name to Katherine. Your
new file should look similar to Listing 1.
Now open $CONF/dialplan/default.
xml and locate the Dialplan entry (or
“extension”) named Local_Extension. In
the line
<condition field=
"destination_number"
expression="^(10[01][0-9])$">
those familiar with regular expressions
will recognize that ^(10[01][0-9])$
means “match exactly four digits – of
which the first two are 10, the next one
is 0 or 1, and the last one is any digit
from 0 to 9 – and store the matched
value in the variable $1.” Put more sim-
ply, it matches anything from 1000-1019,
inclusive.
To add the new user Katherine at ex-
tension 1500, use the pipe character,
which is a logical OR:
<condition field=
"destination_number"
expression="^(10[01][0-9]|1500)$">
Now launch the fs_cli program and then
type reloadxml or press F6. The new ex-
tension is now ready for use.
The best way to test it is to set up a
softphone (or a hard phone, if you have
one) as 1500 with FreeSWITCH. In your
X-Lite client, open the SIP account set-
tings and change the display name to
Katherine and the User name and Autho-
FreeSWITCH
56 ISSUE 106 SEPTEMBER 2009
Extension Function
1000-1019 Default extensions
2000-2002 Sample dial groups
30xx Narrowband conferences (8kHz)
31xx Wideband conferences (16kHz)
32xx Ultra-wideband conferences (32kHz)
33xx CD-quality conferences (48kHz)
4000 Voicemail retrieval
5000 Sample IVR
5900 Call park
5901 Call park retrieval
9888 FreeSWITCH conference
9992 Information application
9996 Echo test
9999 Music on hold
Table 1: Dialplan Highlights
rization user name fields to 1500 before
saving the settings. Your client will mo-
mentarily say registering and then will
say Ready in the display. Now you can
make calls from your new extension. If
you have a second phone, you can regis-
ter it as 1000 and use it to call 1500.
One advantage of VoIP is that you can
make free or very low cost phone calls
on the Internet. FreeSWITCH can route
calls to and from the Internet, even if it
is behind a NAT device. NAT devices
cause all sorts of trouble for SIP calls;
however, FreeSWITCH does a good job
of working around these issues.
In many cases, the default configura-
tion will work without any changes. A
simple test is to call the FreeSWITCH
public conference server. The SIP URI of
this server is sip:888@conference.
freeswitch.org, and the default Dialplan
will connect your phone if you simply
dial 9888.
If your call is successful, you will hear
a text-to-speech (TTS) voice announce
your caller ID name or number. If you
are the only person in the conference,
you will also hear a recording saying so.
To call the conference with PortAudio,
enter:
pa call
sip:888@conference.freeswitch.org
A number of service providers offer
connection services to give you access to
and from the public switched telephone
network (PSTN) or simple SIP accounts.
FreeSWITCH uses the concept of “gate-
ways” to establish connections to these
service providers. Gateways are used for
outbound registrations to providers. If
you already have a SIP provider, you will
want to use the settings for that provider.
The FreeSWITCH wiki has sample con-
figurations for a number of providers
[5]. In this example, I will show you how
to set up a gateway for iptel.org, which
offers free SIP accounts.
First, create an account on the iptel.
org website [6] and note your username
and password. Next, create a new file
called iptel.org.xml in $CONF/sip_pro-
files/external. Be sure to put your user-
name and password in the appropriate
fields. The file should look like Listing 2.
Now save the file, then at the Free-
SWITCH prompt, issue the command:
sofia profile external
restart reloadxml
“Sofia” is the name of the SIP library [7]
used by FreeSWITCH and is also the
name of the command to perform SIP-
related functions. (Just type sofia to see
the syntax.) The above command tells
FreeSWITCH to restart the external pro-
file after reloading the XML data. The re-
loadxml is optional; however, if you’ve
made changes to the XML data (by cre-
ating or editing a file), you will want
those changes loaded when restarting
the profile.
To see whether your system registered
with iptel.org, issue the command:
sofia status
If your registration was successful, you
will see a line like the following:
iptel gateway
sip:myusername@sip.iptel.org REGED
The REGED state means that the gateway
is successfully registered to the provider.
If you see FAIL_WAIT, then most likely
you have a configuration problem.
The last step to receiving calls is to
allow incoming calls in the Dialplan. The
default configuration has a “public”
Dialplan context that treats incoming
calls from the Internet as inherently
untrusted.
First you need to allow calls to your
new iptel.org user, then you need to
specify where to route those calls. To do
FreeSWITCH
57ISSUE 106SEPTEMBER 2009
01 <include>
02 <user id="1500" mailbox="1500">
03 <params>
04 <param name="password" value="$${default_password}"/>
05 <param name="vm-password" value="1500"/>
06 </params>
07 <variables>
08 <variable name="toll_allow" value="domestic,international,local"/>
09 <variable name="accountcode" value="1500"/>
10 <variable name="user_context" value="default"/>
11 <variable name="effective_caller_id_name" value="Katherine"/>
12 <variable name="effective_caller_id_number" value="1500"/>
13 <variable name="outbound_caller_id_name" value="$${outbound_caller_
name}"/>
14 <variable name="outbound_caller_id_number" value="$${outbound_caller_
id}"/>
15 <variable name="callgroup" value="techsupport"/>
16 </variables>
17 </user>
18 </include
Listing 1: New User 1500.xml
Subdirectory/File Description
$CONF/vars.xml Defines a number of customizable sys-
tem variables, like default passwords and
codec preference lists
$CONF/dialplan/default.xml The bulk of the default Dialplan is config-
ured here
$CONF/directory/default/*.xml Individual users are defined here, e.g.,
1000.xml
$CONF/sip_profiles/internal.xml A “SIP profile,” or SIP UA to service an IP/
port (usually port 5060)
$CONF/sip_profiles/external.xml Another SIP UA to handle outbound reg-
istrations to SIP providers (port 5080)
$CONF/autoload_configs/modules.conf.xml Modules loaded automatically when
FreeSWITCH starts
Table 2: Notable Configuration Files
so, create a new file called $CONF/dial-
plan/public/00_inbound_iptel.xml (or
make a copy of the example file named
00_inbound_did.xml). It should look like
Listing 3.
Be sure to specify your iptel.org user-
name in the regular expression. Your
username is the destination number.
(Destination numbers are not restricted
to numeric characters.)
The call is routed to the extension
specified in parameters that are fed to
the transfer application.
In my case, I routed to the MOH exten-
sion for the sake of testing. Also, you
can route to your SIP phone. If you are
registered as 1000, then the transfer des-
tination is 1000 XML default. Save the
file and then go to the FreeSWITCH
prompt and press F6 (or type reloadxml)
at the FreeSWITCH prompt.
To receive a call on your new account,
you will need someone to make a SIP
call to your new iptel.org SIP URI. In a
pinch, you can test with PortAudio. At
the FreeSWITCH prompt type:
pa call sip:myusername@sip.iptel.org
A successful call will ring the destination
extension.
Traditional telephone calls are of mar-
ginal sound quality and mobile phone
calls are worse. FreeSWITCH delivers
high-quality, voice-quality calls with free
and open source codecs. The CELT [8]
open source codec is high quality and
lossless.
Also included with FreeSWITCH are
the Siren [9] codecs from Polycom.
These high-quality codecs are closed
source but royalty free. The default con-
figuration loads the Siren codecs.
To load the CELT codec, issue the load
mod_celt command.
One thing to keep in mind is that
higher quality codecs could expose limi-
tations in your headset equipment. Most
newer headsets and those that are listed
as “Skype certified” will generally per-
form well with the higher quality codecs.
Personally, I use a Logitech Clear Chat
Pro USB headset with good success.
For testing, I recommend making a
call to a friend who also has Free-
SWITCH installed.
To start, make a PSTN or mobile
phone call, then hang up and immedi-
ately make a call with a high-quality
codec. With the use of PortAudio, it is
easy to test. First, edit $CONF/autoload_
configs/portaudio.xml. Locate the line
<param name="sample-rate" value
="8000"/>, change the value to 48000,
and save the file.
At the FreeSWITCH prompt issue these
commands:
reloadxml
reload mod_portaudio
Now make a call to your friend or call
the FreeSWITCH conference:
pa call 9888
The audio quality should be much bet-
ter, especially if you have a fast Internet
connection. FreeSWITCH conferences
can mix calls of any codec and any sam-
pling rate. In fact, you can call in to the
Free-SWITCH conference via the PSTN
by dialing +1-213-799-1400 and com-
pare the difference between the high-
quality VoIP codecs and the low quality
of the PSTN.
This brief introduction to FreeSWITCH
barely scratches the surface of what this
open source software can do. One way
to put FreeSWITCH to practical use is
presented by IBM’s Rob Smart, who
wrote a tutorial called “Home VOIP sys-
tem using FreeSwitch and a Linksys 3102
voice gateway” [10] on how to set up
FreeSWITCH as a home communications
server in the UK.
A vibrant and growing community of-
fers support to newcomers and veterans
alike, so join this community and con-
tinue learning about the amazing possi-
bilities of VoIP.
FreeSWITCH
58 ISSUE 106 SEPTEMBER 2009
[1] “How does FreeSWITCH compare to
Asterisk?” http://www.freeswitch.
org/node/117
[2] FreeSWITCH website:
http://www.freeswitch.org
[3] FreeSWITCH downloads:
http://files.freeswitch.org/
[4] X-Lite: http://www.counterpath.com/
x-lite.html
[5] FreeSWITCH wiki:
http://wiki.freeswitch.org/wiki/SIP_
Provider_Examples
[6] iptel.org website:
http://www.iptel.org
[7] Sofia-SIP library:
http://sofia-sip.sourceforge.net
[8] CELT codec:
http://www.celt-codec.org
[9] Siren codecs: http://www.polycom.
com/company/about_us/technology/
siren_g7221/index.html
[10] FreeSWITCH tutorial:
http://robsmart.co.uk/2009/06/02/
freeswitch_linksys3102
INFO
01 <include>
02 <extension name="iptel-inbound">
03 <condition field="destination_number" expression="^(YOUR_IPTEL.ORG_
USERNAME)$">
04 <action application="set" data="domain_name=$${domain}"/>
05 <action application="transfer" data="9999 XML default"/>
06 </condition>
07 </extension>
08 </include>
Listing 3: 00_inbound_iptel.xml
01 <include>
02 <gateway name="iptel"> <!-- used in dialstrings -->
03 <param name="username" value="YOUR_USERNAME_HERE"/>
04 <param name="realm" value="iptel.org"/>
05 <param name="password" value="YOUR_PASSWORD_HERE"/>
06 <param name="proxy" value="sip.iptel.org"/>
07 </gateway>
08 </include>
Listing 2: Setting Up a Gateway for a SIP Account

More Related Content

What's hot

FreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBCFreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBCMoises Silva
 
第20回 OpenStack勉強会 Neutron Deep Dive - DVR
第20回 OpenStack勉強会 Neutron Deep Dive - DVR第20回 OpenStack勉強会 Neutron Deep Dive - DVR
第20回 OpenStack勉強会 Neutron Deep Dive - DVRToru Makabe
 
IPv6 Address Planning
IPv6 Address PlanningIPv6 Address Planning
IPv6 Address PlanningAPNIC
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPThomas Graf
 
IPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onIPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onAPNIC
 
[OpenStack Days Korea 2016] Track2 - 아리스타 OpenStack 연동 및 CloudVision 솔루션 소개
[OpenStack Days Korea 2016] Track2 - 아리스타 OpenStack 연동 및 CloudVision 솔루션 소개[OpenStack Days Korea 2016] Track2 - 아리스타 OpenStack 연동 및 CloudVision 솔루션 소개
[OpenStack Days Korea 2016] Track2 - 아리스타 OpenStack 연동 및 CloudVision 솔루션 소개OpenStack Korea Community
 
OpenStack Quantum Intro (OS Meetup 3-26-12)
OpenStack Quantum Intro (OS Meetup 3-26-12)OpenStack Quantum Intro (OS Meetup 3-26-12)
OpenStack Quantum Intro (OS Meetup 3-26-12)Dan Wendlandt
 
Enable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunEnable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunheut2008
 
High Performance Networking with DPDK & Multi/Many Core
High Performance Networking with DPDK & Multi/Many CoreHigh Performance Networking with DPDK & Multi/Many Core
High Performance Networking with DPDK & Multi/Many Coreslankdev
 
#dnstudy 01 ドメイン名の歴史
#dnstudy 01 ドメイン名の歴史#dnstudy 01 ドメイン名の歴史
#dnstudy 01 ドメイン名の歴史Takashi Takizawa
 
ML2/OVN アーキテクチャ概観
ML2/OVN アーキテクチャ概観ML2/OVN アーキテクチャ概観
ML2/OVN アーキテクチャ概観Yamato Tanaka
 
Operationalizing EVPN in the Data Center: Part 2
Operationalizing EVPN in the Data Center: Part 2Operationalizing EVPN in the Data Center: Part 2
Operationalizing EVPN in the Data Center: Part 2Cumulus Networks
 
Hyper-Converged Infrastructure: Concepts
Hyper-Converged Infrastructure: ConceptsHyper-Converged Infrastructure: Concepts
Hyper-Converged Infrastructure: ConceptsNick Scuola
 

What's hot (20)

FreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBCFreeSWITCH as a Kickass SBC
FreeSWITCH as a Kickass SBC
 
第20回 OpenStack勉強会 Neutron Deep Dive - DVR
第20回 OpenStack勉強会 Neutron Deep Dive - DVR第20回 OpenStack勉強会 Neutron Deep Dive - DVR
第20回 OpenStack勉強会 Neutron Deep Dive - DVR
 
Automating Network Infrastructure : Ansible
Automating Network Infrastructure : AnsibleAutomating Network Infrastructure : Ansible
Automating Network Infrastructure : Ansible
 
IPv6 Address Planning
IPv6 Address PlanningIPv6 Address Planning
IPv6 Address Planning
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDP
 
Meetup 23 - 02 - OVN - The future of networking in OpenStack
Meetup 23 - 02 - OVN - The future of networking in OpenStackMeetup 23 - 02 - OVN - The future of networking in OpenStack
Meetup 23 - 02 - OVN - The future of networking in OpenStack
 
IPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onIPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-on
 
Kamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load BalancersKamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load Balancers
 
Deploying IPv6 on OpenStack
Deploying IPv6 on OpenStackDeploying IPv6 on OpenStack
Deploying IPv6 on OpenStack
 
[OpenStack Days Korea 2016] Track2 - 아리스타 OpenStack 연동 및 CloudVision 솔루션 소개
[OpenStack Days Korea 2016] Track2 - 아리스타 OpenStack 연동 및 CloudVision 솔루션 소개[OpenStack Days Korea 2016] Track2 - 아리스타 OpenStack 연동 및 CloudVision 솔루션 소개
[OpenStack Days Korea 2016] Track2 - 아리스타 OpenStack 연동 및 CloudVision 솔루션 소개
 
VPNaaS in Neutron
VPNaaS in NeutronVPNaaS in Neutron
VPNaaS in Neutron
 
OpenStack Quantum Intro (OS Meetup 3-26-12)
OpenStack Quantum Intro (OS Meetup 3-26-12)OpenStack Quantum Intro (OS Meetup 3-26-12)
OpenStack Quantum Intro (OS Meetup 3-26-12)
 
Enable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunEnable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zun
 
High Performance Networking with DPDK & Multi/Many Core
High Performance Networking with DPDK & Multi/Many CoreHigh Performance Networking with DPDK & Multi/Many Core
High Performance Networking with DPDK & Multi/Many Core
 
#dnstudy 01 ドメイン名の歴史
#dnstudy 01 ドメイン名の歴史#dnstudy 01 ドメイン名の歴史
#dnstudy 01 ドメイン名の歴史
 
VXLAN
VXLANVXLAN
VXLAN
 
ML2/OVN アーキテクチャ概観
ML2/OVN アーキテクチャ概観ML2/OVN アーキテクチャ概観
ML2/OVN アーキテクチャ概観
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Operationalizing EVPN in the Data Center: Part 2
Operationalizing EVPN in the Data Center: Part 2Operationalizing EVPN in the Data Center: Part 2
Operationalizing EVPN in the Data Center: Part 2
 
Hyper-Converged Infrastructure: Concepts
Hyper-Converged Infrastructure: ConceptsHyper-Converged Infrastructure: Concepts
Hyper-Converged Infrastructure: Concepts
 

Similar to Freeswitch

Setup VoIP System and Interconnection with LTE network
Setup VoIP System and Interconnection with LTE networkSetup VoIP System and Interconnection with LTE network
Setup VoIP System and Interconnection with LTE networkNazmul Hossain Rakib
 
First steps after free pbx installation
First steps after free pbx installationFirst steps after free pbx installation
First steps after free pbx installationvincent david
 
Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Kaan Aslandağ
 
6 th
6 th6 th
6 thErm78
 
VoIPER: Smashing the VoIP stack while you sleep
VoIPER: Smashing the VoIP stack while you sleepVoIPER: Smashing the VoIP stack while you sleep
VoIPER: Smashing the VoIP stack while you sleepguestad6e9e
 
INFA 620Lab 4 Firewall.docx
INFA 620Lab 4 Firewall.docxINFA 620Lab 4 Firewall.docx
INFA 620Lab 4 Firewall.docxjaggernaoma
 
Database Security Explained
Database Security ExplainedDatabase Security Explained
Database Security Explainedwensheng wei
 
Raspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software SetupRaspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software SetupRANAALIMAJEEDRAJPUT
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreRod Flohr
 
Introduction to Networking | Linux-Unix and System Administration | Docker an...
Introduction to Networking | Linux-Unix and System Administration | Docker an...Introduction to Networking | Linux-Unix and System Administration | Docker an...
Introduction to Networking | Linux-Unix and System Administration | Docker an...andega
 
Central management of network and call services
Central management of network and call servicesCentral management of network and call services
Central management of network and call servicesNazmul Hossain Rakib
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0venkatakrishnan k
 

Similar to Freeswitch (20)

Backtrack Manual Part4
Backtrack Manual Part4Backtrack Manual Part4
Backtrack Manual Part4
 
Clear Choice
Clear ChoiceClear Choice
Clear Choice
 
Setup VoIP System and Interconnection with LTE network
Setup VoIP System and Interconnection with LTE networkSetup VoIP System and Interconnection with LTE network
Setup VoIP System and Interconnection with LTE network
 
final doc
final docfinal doc
final doc
 
First steps after free pbx installation
First steps after free pbx installationFirst steps after free pbx installation
First steps after free pbx installation
 
Linux
LinuxLinux
Linux
 
Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8Configuration Firewalld On CentOS 8
Configuration Firewalld On CentOS 8
 
Symbian OS
Symbian  OS Symbian  OS
Symbian OS
 
6 th
6 th6 th
6 th
 
VoIPER: Smashing the VoIP stack while you sleep
VoIPER: Smashing the VoIP stack while you sleepVoIPER: Smashing the VoIP stack while you sleep
VoIPER: Smashing the VoIP stack while you sleep
 
snortinstallguide
snortinstallguidesnortinstallguide
snortinstallguide
 
Presentación1
Presentación1Presentación1
Presentación1
 
INFA 620Lab 4 Firewall.docx
INFA 620Lab 4 Firewall.docxINFA 620Lab 4 Firewall.docx
INFA 620Lab 4 Firewall.docx
 
Database Security Explained
Database Security ExplainedDatabase Security Explained
Database Security Explained
 
Raspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software SetupRaspberry pi Board Hardware & Software Setup
Raspberry pi Board Hardware & Software Setup
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
 
Doc_VOIP_Xivo
Doc_VOIP_XivoDoc_VOIP_Xivo
Doc_VOIP_Xivo
 
Introduction to Networking | Linux-Unix and System Administration | Docker an...
Introduction to Networking | Linux-Unix and System Administration | Docker an...Introduction to Networking | Linux-Unix and System Administration | Docker an...
Introduction to Networking | Linux-Unix and System Administration | Docker an...
 
Central management of network and call services
Central management of network and call servicesCentral management of network and call services
Central management of network and call services
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0
 

Recently uploaded

cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Freeswitch

  • 1. pen source projects have lowered the barrier to entry into tele- phony for hobbyists and busi- nesses alike. The popular Asterisk PBX tool, for instance, is a high-functioning and low-budget telephony alternative that has proven disruptive in the world of business telephone systems [1]. Perhaps the most disruptive software of all, how- ever, comes in the form of the scalable softswitch library called FreeSWITCH. The FreeSWITCH website [2] says that it can be used as a “simple switching en- gine, a PBX, a media gateway, or a media server to host IVR applications.” True to that chameleon-like descrip- tion, FreeSWITCH has appeared in pro- duction environments as a telco switch, in numerous business scenarios as a PBX, as a softphone for laptop users, and even as a voice routing engine for the OpenSim project. Additionally, you can deploy FreeSWITCH as an application or use it as a library (libfreeswitch) that can be embedded in third-party software. This double identity is similar to the relation- ship between cURL (application) and libcurl (library). FreeSWITCH has been used in some exotic scenarios; however, those new to telephony applications are best served starting out with FreeSWITCH in its de- fault configuration as a SOHO PBX. Al- though you might find the numerous FreeSWITCH configuration files and set- tings overwhelming, in a short time, you will appreciate the power and flexibility of this versatile telephony tool. As of this writing, the current, stable version of FreeSWITCH is 1.0.4, which can be downloaded from the project website [3], or you can use the Subver- sion repository to install the latest ver- sion. Unlike many projects, the SVN trunk is extremely stable, so it might be convenient for you simply to use the lat- est trunk. In any case, the FreeSWITCH develop- ers have made it very easy to update to the latest trunk, even if you have in- stalled from the latest stable version. Some pre-compiled binaries are known to exist; however, I recommend compil- ing from source. First, unpack and install the source. In this example, I will download into /usr/ src and install from there: tar zxvf freeswitch-1.0.4.tar.gz cd freeswitch-1.0.4 ./configure make install I recommend getting the sound files: make cd-sounds-install make cd-moh-install FreeSWITCH comes with and can han- dle sound files at 8, 16, 32, and 48kHz sampling rates. Few, if any, telephony systems – open source or proprietary – can do the kinds of things FreeSWITCH can do with calls at multiple sampling rates. The installation will take some time, so feel free to chain the commands to- gether with the && operator. FreeSWITCH is a powerful and versatile telephony platform that can scale from a softphone to a PBX and even to a carrier-class softswitch. BY MICHAEL S. COLLINS FreeSWITCH 54 ISSUE 106 SEPTEMBER 2009
  • 2. When the process is complete, you will have a basic FreeSWITCH installa- tion. Because it is handy to have the two main FreeSWITCH executable files avail- able in the bin path, I use symlinks: ln -s /usr/local/freeswitch/bin/freeswitch /usr/local/bin/freeswitch ln -s /usr/local/freeswitch/bin /fs_cli /usr/local/bin/fs_cli To launch the application, enter freeswitch, and use the fs_cli utility to ac- cess the command line of any FreeSWITCH server to which you have access, even if it is on another server. At first, you’ll see quite a bit of debug/log information, but don’t worry about er- rors or warnings at this point. The first basic command is version, which displays the version of Free- SWITCH you are running, including the SVN revision. The status command shows information about your instance of FreeSWITCH, including uptime and the number of currently active sessions. Another basic command is the self-de- scriptive help. To exit FreeSWITCH, type fsctl shut- down or use the shortcut command ... (three periods). If you have a sound card or headset on your system then try this: load mod_portaudio After several debug lines, you’ll see +OK when the module is loaded. Now list the PortAudio devices available on your system: pa devlist API CALL [pa(devlist)] output: 0;Built-in Microphone;2;0;i 1;Built-in Input;2;0; 2;Built-in Output;0;2;r,o 3;Logitech USB Headset;0;2; 4;Logitech USB Headset;1;0; The i and o are next to the currently se- lected input and output devices. To change the input device, use the pa indev command with the device number, pa indev #x where x is the number of the input de- vice. The output device can be changed with the pa outdev command. In my setup, I’ll use device 4 as output and de- vice 5 as input. If you have the MOH (music on hold) files installed, this command will make a call to the MOH extension and send the MOH to the PortAudio output device: pa call 9999 If you hear music, it was a successful call. If not, make sure the MOH files were in- stalled properly. Hang up with the pa hangup command. To make sure both input and output de- vices are working, do an echo test: pa call 9996 Now when you speak into the input device, your voice should be echoed to the output device. The pa hangup command dis- connects. As you can see, it is possible to use Free- SWITCH and PortAu- dio to create a simple softphone. In this way, you will be able to use any codec that your FreeSWITCH installation supports – and there are some very high quality codecs available – without installing a softphone client. The most common way to use Free- SWITCH is with a SIP phone. A physical handset is often called a hard phone, whereas a software-based phone is ap- propriately called a softphone. Numer- ous types of hard phones are available from manufacturers. Softphones come in both proprietary and FLOSS varieties. A popular free – but not open source – softphone is X-Lite from CounterPath [4], which is available for Linux, Mac OS X, and Windows. Even if your Free- SWITCH server runs on Linux, your soft- phones can run on any operating sys- tem, as long as they are SIP compliant. To begin, download X-Lite for your desktop or laptop operating system and perform a default install. (Installing a softphone on the same system that is running FreeSWITCH is not recom- mended; however, in many cases, it will work for the sake of testing.) FreeSWITCH 55ISSUE 106SEPTEMBER 2009 SIP is a TCP/IP-based Application Layer protocol used for multimedia sessions over the Internet. The text-based proto- col is similar to HTTP, with requests and responses, header fields, encoding rules, and status codes. In addition to VoIP, SIP is used in instant messaging, online gaming, and distribution of streaming multimedia. Session Initiation Protocol
  • 3. Now launch X-Lite and open the SIP Account Settings menu by clicking the Show Menu button. (The button is the small down-arrow at the top of the phone, just left of center.) Only one SIP account is available in X- Lite, so click on it then click the Proper- ties button. As shown in Figure 1, fill in the fields and use 1234 as the password for extension 1000. Next, clear out the Dialing plan field because it is not needed with FreeSWITCH. Now click OK then Close, and the phone will attempt to register. Figure 2 shows a successful registration. To make a test call, dial 9999 and click the green button to send. In a few mo- ments you should hear music on hold. Figure 3 shows a call in progress to ex- tension 9999. To shut down FreeSWITCH, use the fsctl shutdown (...) command. The default FreeSWITCH configuration has many features. Table 1 shows Dial- plan highlights, and Table 2 shows some of the more important files and subdi- rectories in the FreeSWITCH configura- tion. The default install will create a direc- tory named /usr/local/freeswitch/conf, which I’ll refer to as $CONF. All config files are XML and can include other XML files. The top of this XML tree is $CONF/ freeswitch.xml, which includes various XML files that in turn include still more XML files. This arrangement allows you to make changes to the FreeSWITCH configuration without sift- ing through a particularly large file. To start FreeSWITCH as a daemon, use the -nc (no console) command-line ar- gument: freeswitch -nc FreeSWITCH will report that it is backgrounding and will give the process ID (PID). To stop Free- SWITCH, simply execute freeswitch -stop at the Linux prompt. For now, leave FreeSWITCH running and use the fs_cli command to connect: You will be greeted with a brief welcome message and a CLI prompt and perhaps some debug messages on the screen. To turn down the debug level, type: /log info This will restrict log messages to the INFO level and lower and keep you from being inundated with debug information. All commands to the fs_cli program begin with a slash, so type /help to see a list of available commands. Anything else typed at the fs_cli prompt will be sent to the FreeSWITCH server, with one exception: The ellipsis (...) will not shut down FreeSWITCH from fs_cli; rather, it exits the fs_cli program. Instead of shut- ting down FreeSWITCH from within fs_ cli, exit the program and then issue the freeswitch -stop command at the Linux prompt. Just let FreeSWITCH continue to run in the background while you set up a new user and modify the Dialplan. FreeSWITCH comes with 20 users pre- defined, but if you want to add more, just two steps modify the configuration: $CONF/directory/ default/ user to be called To add a new user named “Katherine” with extension number 1500, change di- rectory into $CONF/directory/default and make a copy of 1000.xml: cp 1000.xml 1500.xml In an editor, open 1500.xml, replace 1000 with 1500, and change the effec- tive_caller_id_name to Katherine. Your new file should look similar to Listing 1. Now open $CONF/dialplan/default. xml and locate the Dialplan entry (or “extension”) named Local_Extension. In the line <condition field= "destination_number" expression="^(10[01][0-9])$"> those familiar with regular expressions will recognize that ^(10[01][0-9])$ means “match exactly four digits – of which the first two are 10, the next one is 0 or 1, and the last one is any digit from 0 to 9 – and store the matched value in the variable $1.” Put more sim- ply, it matches anything from 1000-1019, inclusive. To add the new user Katherine at ex- tension 1500, use the pipe character, which is a logical OR: <condition field= "destination_number" expression="^(10[01][0-9]|1500)$"> Now launch the fs_cli program and then type reloadxml or press F6. The new ex- tension is now ready for use. The best way to test it is to set up a softphone (or a hard phone, if you have one) as 1500 with FreeSWITCH. In your X-Lite client, open the SIP account set- tings and change the display name to Katherine and the User name and Autho- FreeSWITCH 56 ISSUE 106 SEPTEMBER 2009 Extension Function 1000-1019 Default extensions 2000-2002 Sample dial groups 30xx Narrowband conferences (8kHz) 31xx Wideband conferences (16kHz) 32xx Ultra-wideband conferences (32kHz) 33xx CD-quality conferences (48kHz) 4000 Voicemail retrieval 5000 Sample IVR 5900 Call park 5901 Call park retrieval 9888 FreeSWITCH conference 9992 Information application 9996 Echo test 9999 Music on hold Table 1: Dialplan Highlights
  • 4. rization user name fields to 1500 before saving the settings. Your client will mo- mentarily say registering and then will say Ready in the display. Now you can make calls from your new extension. If you have a second phone, you can regis- ter it as 1000 and use it to call 1500. One advantage of VoIP is that you can make free or very low cost phone calls on the Internet. FreeSWITCH can route calls to and from the Internet, even if it is behind a NAT device. NAT devices cause all sorts of trouble for SIP calls; however, FreeSWITCH does a good job of working around these issues. In many cases, the default configura- tion will work without any changes. A simple test is to call the FreeSWITCH public conference server. The SIP URI of this server is sip:888@conference. freeswitch.org, and the default Dialplan will connect your phone if you simply dial 9888. If your call is successful, you will hear a text-to-speech (TTS) voice announce your caller ID name or number. If you are the only person in the conference, you will also hear a recording saying so. To call the conference with PortAudio, enter: pa call sip:888@conference.freeswitch.org A number of service providers offer connection services to give you access to and from the public switched telephone network (PSTN) or simple SIP accounts. FreeSWITCH uses the concept of “gate- ways” to establish connections to these service providers. Gateways are used for outbound registrations to providers. If you already have a SIP provider, you will want to use the settings for that provider. The FreeSWITCH wiki has sample con- figurations for a number of providers [5]. In this example, I will show you how to set up a gateway for iptel.org, which offers free SIP accounts. First, create an account on the iptel. org website [6] and note your username and password. Next, create a new file called iptel.org.xml in $CONF/sip_pro- files/external. Be sure to put your user- name and password in the appropriate fields. The file should look like Listing 2. Now save the file, then at the Free- SWITCH prompt, issue the command: sofia profile external restart reloadxml “Sofia” is the name of the SIP library [7] used by FreeSWITCH and is also the name of the command to perform SIP- related functions. (Just type sofia to see the syntax.) The above command tells FreeSWITCH to restart the external pro- file after reloading the XML data. The re- loadxml is optional; however, if you’ve made changes to the XML data (by cre- ating or editing a file), you will want those changes loaded when restarting the profile. To see whether your system registered with iptel.org, issue the command: sofia status If your registration was successful, you will see a line like the following: iptel gateway sip:myusername@sip.iptel.org REGED The REGED state means that the gateway is successfully registered to the provider. If you see FAIL_WAIT, then most likely you have a configuration problem. The last step to receiving calls is to allow incoming calls in the Dialplan. The default configuration has a “public” Dialplan context that treats incoming calls from the Internet as inherently untrusted. First you need to allow calls to your new iptel.org user, then you need to specify where to route those calls. To do FreeSWITCH 57ISSUE 106SEPTEMBER 2009 01 <include> 02 <user id="1500" mailbox="1500"> 03 <params> 04 <param name="password" value="$${default_password}"/> 05 <param name="vm-password" value="1500"/> 06 </params> 07 <variables> 08 <variable name="toll_allow" value="domestic,international,local"/> 09 <variable name="accountcode" value="1500"/> 10 <variable name="user_context" value="default"/> 11 <variable name="effective_caller_id_name" value="Katherine"/> 12 <variable name="effective_caller_id_number" value="1500"/> 13 <variable name="outbound_caller_id_name" value="$${outbound_caller_ name}"/> 14 <variable name="outbound_caller_id_number" value="$${outbound_caller_ id}"/> 15 <variable name="callgroup" value="techsupport"/> 16 </variables> 17 </user> 18 </include Listing 1: New User 1500.xml Subdirectory/File Description $CONF/vars.xml Defines a number of customizable sys- tem variables, like default passwords and codec preference lists $CONF/dialplan/default.xml The bulk of the default Dialplan is config- ured here $CONF/directory/default/*.xml Individual users are defined here, e.g., 1000.xml $CONF/sip_profiles/internal.xml A “SIP profile,” or SIP UA to service an IP/ port (usually port 5060) $CONF/sip_profiles/external.xml Another SIP UA to handle outbound reg- istrations to SIP providers (port 5080) $CONF/autoload_configs/modules.conf.xml Modules loaded automatically when FreeSWITCH starts Table 2: Notable Configuration Files
  • 5. so, create a new file called $CONF/dial- plan/public/00_inbound_iptel.xml (or make a copy of the example file named 00_inbound_did.xml). It should look like Listing 3. Be sure to specify your iptel.org user- name in the regular expression. Your username is the destination number. (Destination numbers are not restricted to numeric characters.) The call is routed to the extension specified in parameters that are fed to the transfer application. In my case, I routed to the MOH exten- sion for the sake of testing. Also, you can route to your SIP phone. If you are registered as 1000, then the transfer des- tination is 1000 XML default. Save the file and then go to the FreeSWITCH prompt and press F6 (or type reloadxml) at the FreeSWITCH prompt. To receive a call on your new account, you will need someone to make a SIP call to your new iptel.org SIP URI. In a pinch, you can test with PortAudio. At the FreeSWITCH prompt type: pa call sip:myusername@sip.iptel.org A successful call will ring the destination extension. Traditional telephone calls are of mar- ginal sound quality and mobile phone calls are worse. FreeSWITCH delivers high-quality, voice-quality calls with free and open source codecs. The CELT [8] open source codec is high quality and lossless. Also included with FreeSWITCH are the Siren [9] codecs from Polycom. These high-quality codecs are closed source but royalty free. The default con- figuration loads the Siren codecs. To load the CELT codec, issue the load mod_celt command. One thing to keep in mind is that higher quality codecs could expose limi- tations in your headset equipment. Most newer headsets and those that are listed as “Skype certified” will generally per- form well with the higher quality codecs. Personally, I use a Logitech Clear Chat Pro USB headset with good success. For testing, I recommend making a call to a friend who also has Free- SWITCH installed. To start, make a PSTN or mobile phone call, then hang up and immedi- ately make a call with a high-quality codec. With the use of PortAudio, it is easy to test. First, edit $CONF/autoload_ configs/portaudio.xml. Locate the line <param name="sample-rate" value ="8000"/>, change the value to 48000, and save the file. At the FreeSWITCH prompt issue these commands: reloadxml reload mod_portaudio Now make a call to your friend or call the FreeSWITCH conference: pa call 9888 The audio quality should be much bet- ter, especially if you have a fast Internet connection. FreeSWITCH conferences can mix calls of any codec and any sam- pling rate. In fact, you can call in to the Free-SWITCH conference via the PSTN by dialing +1-213-799-1400 and com- pare the difference between the high- quality VoIP codecs and the low quality of the PSTN. This brief introduction to FreeSWITCH barely scratches the surface of what this open source software can do. One way to put FreeSWITCH to practical use is presented by IBM’s Rob Smart, who wrote a tutorial called “Home VOIP sys- tem using FreeSwitch and a Linksys 3102 voice gateway” [10] on how to set up FreeSWITCH as a home communications server in the UK. A vibrant and growing community of- fers support to newcomers and veterans alike, so join this community and con- tinue learning about the amazing possi- bilities of VoIP. FreeSWITCH 58 ISSUE 106 SEPTEMBER 2009 [1] “How does FreeSWITCH compare to Asterisk?” http://www.freeswitch. org/node/117 [2] FreeSWITCH website: http://www.freeswitch.org [3] FreeSWITCH downloads: http://files.freeswitch.org/ [4] X-Lite: http://www.counterpath.com/ x-lite.html [5] FreeSWITCH wiki: http://wiki.freeswitch.org/wiki/SIP_ Provider_Examples [6] iptel.org website: http://www.iptel.org [7] Sofia-SIP library: http://sofia-sip.sourceforge.net [8] CELT codec: http://www.celt-codec.org [9] Siren codecs: http://www.polycom. com/company/about_us/technology/ siren_g7221/index.html [10] FreeSWITCH tutorial: http://robsmart.co.uk/2009/06/02/ freeswitch_linksys3102 INFO 01 <include> 02 <extension name="iptel-inbound"> 03 <condition field="destination_number" expression="^(YOUR_IPTEL.ORG_ USERNAME)$"> 04 <action application="set" data="domain_name=$${domain}"/> 05 <action application="transfer" data="9999 XML default"/> 06 </condition> 07 </extension> 08 </include> Listing 3: 00_inbound_iptel.xml 01 <include> 02 <gateway name="iptel"> <!-- used in dialstrings --> 03 <param name="username" value="YOUR_USERNAME_HERE"/> 04 <param name="realm" value="iptel.org"/> 05 <param name="password" value="YOUR_PASSWORD_HERE"/> 06 <param name="proxy" value="sip.iptel.org"/> 07 </gateway> 08 </include> Listing 2: Setting Up a Gateway for a SIP Account