Mastering FreeSWITCH - Anthony Minessale II - E-Book

Mastering FreeSWITCH E-Book

Anthony Minessale II

0,0
38,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Master the art of advanced VoIP and WebRTC communication with the most dynamic application server, FreeSWITCH

About This Book

  • Forget the hassle - make FreeSWITCH work for you
  • Discover how FreeSWITCH integrates with a range of tools and APIs
  • From high availability to IVR development use this book to become more confident with this useful communication software

Who This Book Is For

SysAdmins, VoIP engineers – whoever you are, whatever you're trying to do, this book will help you get more from FreeSWITCH.

What You Will Learn

  • Get to grips with the core concepts of FreeSWITCH
  • Learn FreeSWITCH high availability
  • Work with SIP profiles, gateways, ITSPs, and Codecs optimization
  • Implement effective security on your projects
  • Master audio manipulation and recording
  • Discover how FreeSWITCH works alongside WebRTC
  • Build your own complex IVR and PBX applications
  • Connect directly to PSTN/TDM
  • Create your own FreeSWITCH module
  • Trace SIP packets with the help of best open source tools
  • Implement Homer Sipcapture to troubleshoot and debug all your platform traffic

In Detail

FreeSWITCH is one of the best tools around if you're looking for a modern method of managing communication protocols through a range of different media. From real-time browser communication with the WebRTC API to implementing VoIP (voice over internet protocol), with FreeSWITCH you're in full control of your projects. This book shows you how to unlock its full potential – more than just a tutorial, it's packed with plenty of tips and tricks to make it work for you.

Written by members of the team who actually helped build FreeSWITCH, it will guide you through some of the newest features of version 1.6 including video transcoding and conferencing. Find out how FreeSWITCH interacts with other tools and APIs, learn how to tackle common (and not so common) challenges ranging from high availability to IVR development and programming advanced PBXs.

Great communication functionality begins with FreeSWITCH – find out how and get your project up and running today.

Style and approach

Find out how it works, then put your knowledge into practice - that's how this advanced FreeSWITCH guide has been designed to help you learn. You'll soon master FreeSWITCH and be confident using it in your projects.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 339

Veröffentlichungsjahr: 2016

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Mastering FreeSWITCH
Credits
About the Authors
About the Reviewers
Contributors
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Typical Voice Uses for FreeSWITCH
Understanding routing calls in FreeSWITCH
Wholesale (provider to providers)
Residential uses of FreeSWITCH
Routing with federated VoIP
Dialers/telemarketing
FreeSWITCH Products and Services
Business PBX services (hosted and on-premises)
Call centers
Value added services and games, prizes, and polls
"Class 4" vs "Class 5" operations (and SBCs)
WebRTC / web services / Internet-only services
Mobile "over-the-top" SIP
Development
Strict on output, broad on input
Very structured, very reusable techniques
Polyglot by vocation and destiny
Extreme scalability, from embedded to big irons
Born internationalist
Telcos internal integration ("FreeSWITCH is the Perl of VoIP")
Rapid new services prototyping
Accounting and billing
Call Detail Records (CDRs)
Mod_nibblebill / CGrateS
Other billing options (open source - commercial)
Summary
2. Deploying FreeSWITCH
Network requirements
Understanding QoS
LANs, WANs, and peering
Testing with SIPp
Running scenarios
Load testing
Logging with FreeSWITCH
Call Detail Records
Monitoring
SNMP
SNMP and FreeSWITCH
Installation and configuration (on Linux)
Getting more information
Monitoring tools
Monitoring with Nagios
Monitoring with Cacti
HA deployment
Storage, network, switches, power supply
Virtualization
Load balancing and integration with Kamailio and OpenSIPS
In the Web world
In the FreeSWITCH world
DNS SRV records for geographical distribution and HA
Summary
3. ITSP and Voice Codecs Optimization
ITSPs – what they do
Routes (to numbers)
DIDs (aka DDIs) – numbers
Quality of routes
White, black, and grey
Codecs and bandwidth
Infrastructure capability
Various important features
Support, redundancy, high availability, and number portability
Summary
4. VoIP Security
Latest versions of it all
Default configuration is a demo
Change passwords
Lock all that's not trusted
Dropping root privileges (file permissions)
Fail2ban on all services
FreeSWITCH jail
SIP(S) and (S|Z)RTP
Encrypting SIP with TLS (SIPS)
Encrypting (S)RTP via SDES (key exchange in SDP)
Encrypting (S)RTP via ZRTP (key exchange in RTP)
New frontiers of VoIP encryption (WebRTC, WebSockets, DTLS)
Summary
5. Audio File and Streaming Formats, Music on Hold, Recording Calls
Traditional telephony codecs constrain audio
HD audio frontiers are pushed by cellphones, right now
FreeSWITCH audio, file, and stream formats
Audio file formats
MP3 and streaming
Music on Hold
Playing and recording audio files and streams
Recording and modifying prompts and audio files
Recording calls
Tapping audio
Summary
6. PSTN and TDM
OpenZap
FreeTDM
I/O modules
Signaling modules
ISDN signaling modules
Analog modules
MFC-R2
SS7
Cellular GSM / CDMA (ftmod_gsm)
FreeTDM installation
Wanpipe drivers
DAHDI drivers
LibPRI
Sangoma ISDN stack
OpenR2
LibWAT
Analog modules
Configuring FreeTDM
Wanpipe
DAHDI
FreeTDM library configuration
FreeSWITCH configuration
Operation
Outbound calls
Inbound calls
Debugging
Checking the physical layer
Enabling ISDN tracing
Audio tracing
Summary
7. WebRTC and Mod_Verto
WebRTC
Browsers are already out there, waitin'
Web Real-Time Communication is coming
Under the hood
Encryption – security
Beyond peer to peer – WebRTC to communication networks and services
WebRTC gateways and application servers
Which architecture? Legacy on the Web, or Web on the Telco?
FreeSWITCH accommodates them ALL
What is Verto (module and jslib)?
Configure mod_verto
Test with Communicator
Build Your Own Verto App
Summary
8. Audio and Video Conferencing
Conference basics
Conference.conf.xml (profiles, DTMF interaction, and so on)
Configuration sections logic
Profile
Caller-Controls group
Conference invocation, dialplan, channel variables
Outbound conference
Moderating and managing conferences – API
Video conference
Video conference configuration
Mux profile settings
Video conference screen layouts
Screen sharing
Screen sharing dialplan extension
Managing video conferences
Conference performances
Summary
9. Faxing and T38
What is Fax on PSTN?
How it works
What is Fax over IP?
Enter T38
T38 terminals and gateways
Fax and FreeSWITCH
The mod_spandsp configuration
mod_spandsp usage
Debugging faxes
How to maximize reliability of fax traffic
PDF to fax and fax to PDF
Fax to mail
HylaFax and FreeSWITCH
ITSPs and Real World Fax Support
Summary
10. Advanced IVR with Lua
Installing IVR
Structure of welcome.lua
Incoming call processing
Before answering
First voice menu
Second and third voice menus
Fourth menu – asynch! Nonblocking! Fun with threads!
After hangup
Utility functions
Summary
11. Write Your FreeSWITCH Module in C
What is a FreeSWITCH module?
Developing a module
Mod_Example outline
Mandatory functions
Load function
Runtime function
Shutdown function
Configuration using XML
Reacting to channel state changes
Receiving and firing events
Dialplan application
API command
Summary
12. Tracing and Debugging VoIP
What can go wrong?
What else can go wrong? (NAT problems)
Other things can go wrong too
SIP, RTP, SDP, RTCP, OH MY!
Tools
Firewall
FreeSWITCH as SIP self tracer
Tcpdum – the mother of all packet captures
ngrep – network grep
tshark – pure packet power
pcapsipdump
sngrep – the holy grail
Sipgrep, Ngrep on steroids for VoIP
Wireshark – "the" packet overlord
Audacity – audio Swiss army knife
SoX – audio format converter
Summary
13. Homer, Monitoring and Troubleshooting Your Communication Platform
What is Homer?
Installing Homer and the Capture Server
Feeding SIP signaling from FreeSWITCH to Homer
Searching signaling with Homer
Feeding SIP signaling, QoS, MOS and RTP/RTCP stats from CaptAgent to Homer
Correlating A-leg and B-leg
Feeding logs and events to Homer
Logs to Homer
FreeSWITCH events to Homer
Summary
Index

Mastering FreeSWITCH

Mastering FreeSWITCH

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: July 2016

Production reference: 1260716

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78439-888-0

www.packtpub.com

Credits

Authors

Anthony Minessale II

Giovanni Maruzzelli

Reviewers

Ayobami Adewole

Brian West

Commissioning Editor

Amarabha Banerjee

Acquisition Editors

Neha Nagwekar

Rahul Nair

Content Development Editor

Kajal Thapar

Technical Editors

Pramod Kumavat

Mohita Vyas

Copy Editors

Dipti Mankame

Safis Editing

Project Coordinator

Shweta H. Birwatkar

Proofreader

Safis Editing

Indexer

Tejal Daruwale Soni

Graphics

Disha Haria

Production Coordinator

Arvindkumar Gupta

Cover Work

Arvindkumar Gupta

About the Authors

Anthony Minessale II is the primary author and founding member of the FreeSWITCH Open Source Soft-Switch. Anthony has spent around 20 years working with open source software. In 2001, Anthony spent a great deal of time contributing code to the Asterisk PBX and has authored numerous features and fixes to that project. In 2005, Anthony started coding a new idea for an open source voice application. The FreeSWITCH project was officially open to the public on January 1 2006. In the years that followed, Anthony has been actively maintaining and leading the software development of the FreeSWITCH project. Anthony also founded the ClueCon Technology Conference in 2005, and he continues to oversee the production of this annual event.

Anthony has been the author of several FreeSWITCH books, including FreeSWITCH 1.0.6, FreeSWITCH 1.2, FreeSWITCH Cookbook, and FreeSWITCH 1.6 Cookbook.

I'd like to thank my wife Jill and my kids, Eric and Abbi, who were in grade school when this project started and are now grown up. I'd also like to thank everyone who took the time to try FreeSWITCH and submit feedback. I finally thank my coauthor Giovanni Maruzzelli for working on this book.

Giovanni Maruzzelli (<[email protected]>) is heavily engaged with FreeSWITCH. In it, he wrote a couple of endpoint modules, and he is specialized in industrial grade deployments and solutions. He's the curator and coauthor of FreeSWITCH 1.6 Cookbook (Packt Publishing, 2015).

He's a consultant in the telecommunications sector, developing software and conducting training courses for FreeSWITCH, SIP, WebRTC, Kamailio, and OpenSIPS.

As an Internet technology pioneer, he was the cofounder of Italia Online in 1996, which was the most popular Italian portal and consumer ISP. Also, he was the architect of its Internet technologies (www.italiaonline.it). Back then, Giovanni was the supervisor of Internet operations and the architect of the first engine for paid access to www.ilsole24ore.com, the most-read financial newspaper in Italy, and its databases (migrated from the mainframe). After that, he was the CEO of the venture capital-funded company Matrice, developing telemail unified messaging and multiple-language phone access to e-mail (text to speech). He was also the CTO of the incubator-funded company Open4, an open source managed applications provider. For 2 years, Giovanni worked in Serbia as an Internet and telecommunications investment expert for IFC, an arm of the World Bank.

Since 2005, he has been based in Italy, and he serves ICT and telecommunication companies worldwide.

I'd like to thank all people who made writing this book a challenging journey for me, all who helped, all who supported, all who gave me obstacles to overcome. This book has been brought to you by the knowledge that was socially cumulated by humans through the centuries, let's praise them. I finally want to thank my coauthor Anthony Minessale II for being so patient and "Always See Everything."

About the Reviewers

Ayobami Adewole is a software engineer and technical consultant with experience spanning over 5 years. Ayobami has worked on mission critical systems; these include solutions for customer relationship management, land administration and geographical information systems, enterprise-level application integrations, and unified communication and software applications for the education and business sectors.

Ayobami is very passionate about VoIP technologies, and he continues to work on cutting-edge PBX solutions built on FreeSWITCH. In his spare time, he enjoys experimenting with new technologies. His blog is at http://ayobamiadewole.com.

My unending gratitude goes to my parents for instilling in me the culture of discipline and hard work.

Brian West is a founding member of the FreeSWITCH team. He has been involved in open source telephony since 2003. Brian was heavily involved in the Asterisk open source PBX Project as a Bug Marshal and developer. In 2005, Brian joined the initiative that eventually lead to the FreeSWITCH Open Source Soft-Switch. Today, Brian serves as the general manager of the FreeSWITCH project and keeps the software moving forward. Brian has countless skills as a developer, tester, manager, and technologist, and he fills a vital role in the FreeSWITCH Community.

Contributors

Moises Silva wrote the entire 6th chapter, PSTN and TDM.

The following people contributed substantially to this book:

Darren SchreiberBenjamin TietzRussell TreleavenSeven Du (Du Jinfang)Muhammad Naseer BhattiFlorent KriegMichael JerrisIwada EjaMartyn DaviesCharles BujoldChristian BergamaschiAlexandr DubovikovLorenzo ManganiDan Christian Bogos

www.PacktPub.com

eBooks, discount offers, and more

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and readPackt's entire library of books.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Preface

Real Time Communication (RTC) is a huge sector, in perennial growth. It spans from VoIP to FAXes, from VideoConferencing to CallCenters, from PBXes to WebRTC, using many interworking technologies to connect the past with the future, legacy applications to new users and markets, creating and developing new ways for saving time and money, fostering collaboration, and enjoying leisure.

FreeSWITCH covers it all; it is the most reliable, scalable, and flexible open source foundation, and is used to build services and products worldwide.

This book adopts a professional approach and attitude, making available a wealth of cumulated actual industry experience in each aspect of FreeSWITCH implementation.

Written for professionals, each chapter contains the knowledge needed to frame and understand its domain, and a thorough explanation of FreeSWITCH wheels and knobs, best practices, and real-world solutions.

What this book covers

Chapter 1, Typical Voice Uses for FreeSWITCH, gives an overview and analyzes each sector where FreeSWITCH is in production.

Chapter 2, Deploying FreeSWITCH, shows best practices in FreeSWITCH installation and management.

Chapter 3, ITSP and Voice Codecs Optimization, suggests what to look for when choosing an Internet Telephony Service Provider, and how to get the best from DIDs, terminations, T38, and voice traffic.

Chapter 4, VoIP Security, exposes specific measures and tools used to keep FreeSWITCH protected from unwanted attention and hostile behavior.

Chapter 5, Audio File and Streaming Formats, Music on Hold, Recording Calls, covers all that is related to audio manipulation with FreeSWITCH, from prompts optimization to call center barge in, from playing live streams to HD codecs.

Chapter 6, PSTN and TDM, happens to be the first published, thorough explanation of all possible interactions between FreeSWITCH and Sangoma, Digium, and other compatible hardware for interfacing traditional and legacy telephony networks.

Chapter 7, WebRTC and Mod_Verto, provides a detailed overview of what WebRTC is and what techniques it entails, and then follows the development of a complete FreeSWITCH implementation.

Chapter 8, Audio and Video Conferencing, delves into the intricacies of setting and managing FreeSWITCH multiuser conferences both via SIP and WebRTC, with chatting, screen sharing, moderation, and advanced techniques for videocomposing the screen.

Chapter 9, Faxing and T38, explores all facsimile transmission aspects, and how to reliably fax via VoIP, send office documents, and integrate with mail.

Chapter 10, Advanced IVR with Lua, proves that it is not your average code snippet or more of the same example. Starting from the thoroughly described script techniques, it will be possible to build your industry-grade applications.

Chapter 11, Write Your FreeSWITCH Module in C, describes exactly what is needed to add or modify FreeSWITCH functionalities at the most fundamental level: interfacing your custom hardware, or your legacy OSS, or whatever.

Chapter 12, Tracing and Debugging VoIP, shows the art of SIP packet tracing, using the latest open source tools.

Chapter 13, Homer, Monitoring and Troubleshooting Your Communication Platform, walks through the operation of the most advanced VoIP/WebRTC monitoring and data warehousing solution: Homer. Once implemented, your support staff will reach Nirvana!

What you need for this book

For implementing the same solutions described in this book, you will need a (virtual) machine with Debian 8 (Jessie) 64 bit, and some Linux admin and networking knowledge.

Who this book is for

This book is for skilled professionals who want to jump right into the depths of FreeSWITCH, such as system administrators, programmers, and telephony technicians who want to augment their ability to create real-world VoIP and WebRTC products and services.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Several built-in modules exist to assist in this, such as mod_lcr and mod_nibblebill, but the real beauty of FreeSWITCH's handling of calls in a wholesale scenario is due to four core building blocks."

A block of code is set as follows:

<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> <scenario name="FreeSWITCH: call extension 1001"> <!-- we send the intial INVITE --> <send retrans="500" start_rtd="mer"> <![CDATA[

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> <scenario name="FreeSWITCH: call extension 1001"> <!-- we send the intial INVITE --> <send retrans="500" start_rtd="mer"> <![CDATA[

New terms and important words are shown in bold.

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

Log in or register to our website using your e-mail address and password.Hover the mouse pointer on the SUPPORT tab at the top.Click on Code Downloads & Errata.Enter the name of the book in the Search box.Select the book for which you're looking to download the code files.Choose from the drop-down menu where you purchased this book from.Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR / 7-Zip for WindowsZipeg / iZip / UnRarX for Mac7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Mastering-FreeSWITCH. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Typical Voice Uses for FreeSWITCH

FreeSWITCH (FS) is one of the world's most robust Real Time Communication (RTC) switching tools. It packs a rich feature set, and its modular approach allows it to stay ahead of the curve as new technologies emerge in the marketplace.

With this strong foundation, FreeSWITCH has matured into a product which is in use in a multitude of environments. However, FreeSWITCH can also be complex and overwhelming because of its rich feature set.

This book unravels some of the ways FreeSWITCH can be utilized.

In this chapter, we will cover "traditional" Voice over IP usage. See other chapters for video, conferences, RTC, and so on. We will also cover the following:

Routing callsProducts and servicesDevelopmentBilling

Understanding routing calls in FreeSWITCH

Routing calls is the very essence of FreeSWITCH. Moving calls around can assume very different meanings and use very different techniques, depending on the scenario and with which aims it is done. You don't use the same tools and interaction level for an enterprise PBX, a telemarketing dialer, and a provider-to-providers minutes exchange.

FreeSWITCH's remote console at startup

Wholesale (provider to providers)

FreeSWITCH supports a multitude of useful features for call routing services. When we describe call routing, we are referring to connecting Party A with Party B. These routing scenarios are generally heavy on logic regarding cost analysis, interconnections with other carriers, and user permissions. These routing scenarios also typically exclude features the user directly interacts with (such as voicemail or auto attendants).

FreeSWITCH can be utilized as a powerful wholesale routing engine. Several built-in modules exist to assist in this, such as mod_lcr or mod_nibblebill, but the real beauty of FreeSWITCH's handling of calls in a wholesale scenario is due to four core building blocks:

The ability to remain in the audio path or get out of the audio path, as neededThe ability to transcode, which helps correct problems between pieces of VoIP equipment which aren't compatibleThe ability to maintain information about caller and callee in variables, and to manipulate those values as the call is progressing (such as tracking how much money someone has left in their account, or what the per-minute rate of the call is)The ability to bridge calls and handle failures and retries when calls don't connect, using a variety of call progress monitoring and failure handling routines which are built-in to FreeSWITCH

FreeSWITCH's flexible design aids in providing a tremendous amount of customization and capabilities as well. Examples include the ability to add transcoding support for codecs at any moment during the call in a way that will automatically and inherently work with any other codecs which are installed, and the ability to add custom handling for failures in a way that suits your environment.

Wholesale services typically represent high-volume customers who want to:

Configure a client for making calls and associate monetary value with each individual client ("current balance" or "amount spent" are examples)Allow a client to attach phones, PBXs, other switches, or ancillary equipmentTrack a client's usage of said service based on what they connected, where they called, and how long they talked, and potentially apply discounts or premium fees based on time-of-day, destination, or other variablesDetect fraud, abuse, or lack of funds automatically, both at call start and mid-callAllow for prompts and menus to automatically add funds or "top-up" servicesAllow for reporting

FreeSWITCH is capable, out of the box, of providing all of these services with simple dial plan configuration. Additionally, FreeSWITCH can be attached to a web, mobile, or legacy user interface to allow for users to manage their account, services, and monetary assets.

Residential uses of FreeSWITCH

FreeSWITCH stands as one of the best open source class 4 (and class 5) switch options, and is often the undisputed champ in many different roles because of the number of features offered by the many ready-made modules. It is definitely an excellent choice for the Internet Telephony Service Provider (ITSP), but let's not forget one of its simplest use cases: Residential service.

Some residential options include things like Network Address Translation (NAT) when configuring end-user devices like Analog Telephone Adapters (ATA). This can be challenging when working with disparate networks and client devices residing on LANs behind residential gateways and firewalls.

FreeSWITCH has configurable options for its Session Initiation Protocol (SIP) stack (called Sofia) especially designed to overcome these hurdles and provide a viable solution for residential service.

Some reasons why FreeSWITCH makes a good choice for residential service are:

It is easily embeddable in low power devicesIt has easy configuration of end-user devices for home networksIt had standard voicemail services via mod_voicemailIt has advanced voicemail options using an Interactive Voice Response (IVR) enabled audio navigation systemIt has custom scripting options for things like Unified Communications

Routing with federated VoIP

Federated VoIP is a distributed Voice over IP network composed of autonomous systems.

Federated VoIP is to telephony what internet e-mail is to messaging. Particularly, it allows for the free flow of traffic without depending on a central exchange (or exchanges), just like e-mail does not depend on a central post office. It works by exchanging mail messages directly between organizations' (or even personal) Mail Servers that have the authority and capability of managing their own traffic.

Let's continue with the example of e-mail (of note, SIP was based on SMTP and HTTP protocols, that is, the protocols that orchestrate mail and the Web). So, here's the trick: no central authority is involved, it's all peer-to-peer exchange of messages in a worldwide network that works with extreme overall reliability day in and day out for billions of people and trillions of communication exchanges.

Exactly the same criteria can be applied to Voice over IP (SIP) and Instant Messaging (SIMPLE or XMPP), basing all communication exchanges around the concept of a personal address like an e-mail address, which is used both by SIP and IM, and often exactly the same for both clients. The example address [email protected] could be used for all unified communications with Joe.

Initially, VoIP had been popularized as a better and cheaper way to manage traditional telephony traffic and to connect to traditional voice carriers. Then it was adopted by the carriers themselves because of its better suitability to modern digital networks and compatibility between hardware providers. So, today's approach to VoIP often brings an unnecessary prejudice about dependency from carriers.

Federated VoIP gets rid of this, having autonomous servers exchanging their communications, finding each other via DNS (queries about destination address) without the need for central authority and/or carriers, just like the e-mail system. Around this core concept has grown an ecosystem of encryption, mapping, and resolving traditional telephone numbers via DNS (ENUM) and other additional services. It should be noted that there is no technical requirement for encryption in Federated VoIP.

FreeSWITCH has all the features needed by Federated VoIP:

Full encryption support: TLS and STCP for signaling, SRTP and ZRTP for mediaDNS SRV query supportENUM mapping supportNAT traversal supportFull codec support and transcodingIM support via SIP's SIMPLE (can be gatewayed by an XMPP server like Jabberd)Presence support via SIMPLE (can be gatewayed by an XMPP server like Jabberd)FreeSWITCH can act as an inbound and outbound gateway with PSTN and cellular networks (for example, GSM, etc), offering ENUM termination service to calling parties

FreeSWITCH is able to work as a complete, self-sufficient autonomous system or as a part of a bigger composite system with one or more SIP proxies, like Kamailio or OpenSIPS, taking care of routing, proxying, load balancing, and so on.

Dialers/telemarketing

The subject of dialers and telemarketing often makes system administrators and telephony switch operators queasy with anxiety when they are considering the limitations of their networks, hardware capability, and other system resource implications with the onslaught of marketing campaigns directed to their customers. This certainly does not stop FreeSWITCH from being a great choice when writing dialer and telemarketing applications, and not all dialer and telemarketing systems should have negative connotations.

FreeSWITCH is a natural front-runner when choosing a softswitch for writing dialer and telemarketing applications because of the small learning curve needed to develop applications in a variety of programming languages, and the excellent community support.

A developer can create a custom dialer application in FreeSWITCH utilizing a core switch database data in real-time to drive the logic. They can utilize modules like mod_event_socket to connect to the switch and perform API functions like initiating calls and managing IVRs for things like credit card payment, billing and collection, or opt-in and opt-out campaign functionality.

Not all telemarketing and dialer applications are used for marketing. Some ways FreeSWITCH is currently being utilized for dialers and telemarketing are:

Delivering inclement weather school-closing notification recordings to telephone listsAuto-dialing church congregation members to connect them to IVR applications for surveys and volunteeringNotifying political constituents of party meetings and gatheringsLive agent outbound calling for fundraising or event coordination

Some rows from FreeSWITCH's remote console help

FreeSWITCH Products and Services

Another way to see what FreeSWITCH can do is to think in terms of what services it will give its users. Here, too, different technologies and techniques are deployed to cater to different kinds of users, looking for a different set of features.

Business PBX services (hosted and on-premises)

FreeSWITCH's scalability and feature set lends itself naturally to being used as the basis of an extremely powerful business PBX phone system. Successfully deployed in both on-premises environments for small SOHO businesses while scalable to hundreds of users, or utilized as the foundation for hosted PBX services hosting hundreds of thousands of users, the system lends itself naturally to powering these types of solutions.

Out of the box, FreeSWITCH includes basic PBX modules which provide powerful functionalities. These modules include features such as:

Ring groups (simultaneous and sequential)Call forwardingPresenceText to speechCall queuesCaller ID blacklistsCaller ID name deliveryPrivacy features / anonymous callingCDRs / Call logsEavesdrop / whisperVoicemailMusic on hold (w/ streaming sources)Usage limitingCall pickup / group pickup / call intercept

We could go on further, but this is a good general idea of the building blocks that are provided. Most of these modules can be activated by adding four to six lines of XML to a dial plan configuration file. The power of dial plan combined with modules should not be underestimated - this is powerful stuff with very little work to get it going!

Additional components exist for expanding into:

ChatMessaging / SMSHTTP services

Customer demands will sometimes lead to more complex requirements that might not be handled by default modules. However, ready-made building blocks combined with the ability to run your own custom scripts within FreeSWITCH allows for providing quick time to market services even for the most demanding customer base.

Call centers

Any company doing substantial business in any market segment will attest that support is a cornerstone of a business's success. A robust and comprehensive telephony platform is crucial, and FreeSWITCH allows for a configurable, scalable and maintainable solution suitable for call centers of any size.

There is no shortage of flexibility with FreeSWITCH. If your solution requires a custom application, FreeSWITCH provides a host of development options for your call control and routing. Although you are free to use any supported language to "roll your own" solution, FreeSWITCH comes complete with robust call center modules that are being utilized in production environments in literally thousands of deployments all over the world.

Mod call center includes features like:

Multi-tenant capabilityMultiple agent call-distribution strategies, such as :
Longest idle agentRound robin agentsAgent with least talk timeAgent with fewest callsTop-down tier position escalation
Time-based scoring escalation strategies like:
Total time in systemTime in current queue
Caller configuration options:
Maximum wait timeMaximum wait time with no agent
Tier rule configuration options:
Wait timeSkip tiers with no agentsDiscarded abandoned callersResumed abandoned callers
Recurring announcements with time frequency interval settings

With IVR trees easily integrated into your call center solution and full access to databases for CRM and Knowledge Basis, your ability to create call center applications is almost limitless.

If your requirements do not dictate the granularity of complex configuration options, then there are other options available with an alternative FreeSWITCH module called Mod FIFO. As the name implies, it serves as a first in, first out call-queuing mechanism, with many features and strategies, music on hold, and announcements, that's easy to integrate in custom or third-party applications.

Value added services and games, prizes, and polls

Value Added Services (VAS) are services that offer something on top of pure voice transport.

Some examples include:

Real time translations (for example, three-way calls with an interpreter)Party lines (for example, multiple-way calls)Virtual meetings (for example, conferences with or without moderator)Cooperative Environments (for example, audio-video-screensharing-whiteboarding)Fax-on-demandCall screening-whitelisting-blacklistingSMS feed subscriptions (news, traffic, special interests, and so on)

Interactive entertainment and polling is a business that fits perfectly with the ease of programming and integrated messaging capability of FreeSWITCH.

Here are some examples of what has been realized in this field:

Radio and TV live talk shows that allow for the public to ask questions and vote on issues, both through voice calls and via SMSsVoice menu trees that ask questions to customers, giving them prizes after a number of correct answers (for example, product awareness and loyalty)Redeem-the-code types of campaigns, where customers or the public can enter a code they found on your documentation or advertising to be awarded a bonus, both via SMSs and voice calls with DTMFIncoming calls statistics (comparative ROI analysis on multiple channel advertising campaigns, for example, what they call the most, the number advertised on radio, TV, Internet, or the one in the press?)

"Class 4" vs "Class 5" operations (and SBCs)

FreeSWITCH is a softswitch. That is, it is a software that handles and interconnects calls, like the manual switchboards where operators answered and distributed calls by moving jacks and cables in old black and white movies.

Softswitches in telco jargon are often categorized as pertaining to a "class," and "Class 4" and "Class 5" are the only two classes you will hear about.

Because those are fuzzy terms, almost marketing terms, you will never find the exact demarcation between Class 4 and Class 5 features and capabilities; a lot of them overlap (anyway, it's mostly the same technology).

An arbitrary rule of thumb can be to use Class 4 when talking about large volume, wholesale switching of call minutes between different carriers, ITSPs, CLECs, with minimal meddling in the audio streams (apart from transcoding, if needed). The term "Class 5" applies to audio or text-based services where end user interaction is in focus and where sophisticated logic is required.

FreeSWITCH is widely used in both contexts.

A typical Class 4 usage would be to interconnect many providers of international voice routes and sell voice minutes based on algorithms about least cost route and/or route quality. Here, the sheer volume of signaling that can be managed per second and the availability of very efficient ways to lookup which route to connect to is of paramount importance. FreeSWITCH with "bypass media", mod_lcr, mod_easyroute, some Lua scripting or custom C code is a perfect platform, easy to use and modify on the fly, without service interruption.

Typical Class 5 usages would be an enterprise or SOHO PBX, a call center system, a fax server with mail2fax and fax2mail, an airport IVR to query flights' arrival times, and so on. Here, FreeSWITCH offers prized features like audio quality (that is, no glitches, distortions, and so on), programmability (how easy it is to implement complex services and business logic), capability of interfacing different media (PSTN to WebRTC, SIP to Skinny, TDM to Skype, SMS to XMPP, and so on) and different audio formats (alaw, ulaw, High Definition Audio, Silk, Siren, G729, Opus, mp3, wav, raw, and so on). Easy integration of Text To Speech and Automatic Speech Recognition, manipulation of audio prompt libraries, and easy ways to gather and interact with user pressed DTMFs are the highlights in FS Class 5 operation.

"SBC" is another very vague marketing buzzword. A Session Border Controller (SBC) is a softswitch that sits on the edge of your own telecommunication network and acts as a point of demarcation and interconnection with the external world. Let's say an SBC is a softswitch with an emphasis on security, NAT traversal, media proxying, network connectivity, manageability, audio transcoding, protocol gatewaying (connecting with different protocols), and protocol adaptation (being the compatibility layer between different "interpretations" of the same protocol). FreeSWITCH excels in those areas, as we have seen before in the two "Classes", while it sports specific SBC features like the most advanced NAT traversal, so smart that it can connect endpoint (that is, user phones) behind residential ADSLs and firewalls, or form a federation between the many international offices of a company, each SBC sitting on different NATed LANs. Also, as security goes, FreeSWITCH is one of the reference implementations for ZRTP media encryption, as well as TLS and SIPS.

WebRTC / web services / Internet-only services

FreeSWITCH's unique modular approach made it an easy choice for extending integration into WebRTC and other web-based services which need a bridge between different types of technologies. As an example, web-based communications are useful but are often hindered by their inability to connect to the rest of the established world, causing adoption to be slow. As an example, users will be reluctant to get rid of their desk phone when their browser-based replacement can't call phone numbers but only other browsers. Best of all, WebRTC support follows the same ease-of-installation and global compatibility standards that FreeSWITCH has become known for in the VoIP world. Users can make calls where one side of the conversation is WebRTC and the other is the PSTN, or WebRTC to SIP and so on. FreeSWITCH does all the hard work of normalizing the audio and signaling services between the two services and bridging any gaps that may exist when connecting from one type of service to another.

Mobile "over-the-top" SIP

As mobile services become more pervasive in the telecommunications industry, mobile network operators have responded by increasing data speeds. In this process, many service providers are now investigating "over-the-top" services which utilize data communication services to transmit and receive voice and video. These services often link to messaging or social applications and provide both real-time, semi real-time, and recorded communication services via data connections. In many cases, the user experience simulates phone technology even though it is not using traditional telephony services provided by the underlying communications service provider. In these cases, there is added complexity for handling such services.

Over-the-top services face a number of challenges, which include:

The ability to adapt to rapidly changing network performance characteristicsThe ability to "hand off" calls as different networks which have better qualities come into range (that is, moving from 3G to 4G or 3G to WiFi)Selecting appropriate codecs which match available capacity and bandwidthHaving sufficient buffering and audio stream management strategies to allow for quality communication while being resilient to issues in network consistencyProviding feedback to the user to allow her to understand what is happening during these complex shiftsThe ability to track device configuration and usage information as customers roam to various locations, change devices, and so on.The ability to adapt to networks which block or restrict some kind of trafficIntegrating with various types of physical hardware on the user's deviceBeing able to debug issues when it's unclear if they're caused by the device, the mobile network, or the softswitch