Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Mastering FreeSWITCH
Mastering FreeSWITCH

Mastering FreeSWITCH: Advanced tips and tricks for advanced multimedia communication

Arrow left icon
Profile Icon Charles Bujold Profile Icon Kalyani Kulkarni Profile Icon Florent Krieg Profile Icon Mike Jerris Profile Icon Ken Rice Profile Icon Schreiber Profile Icon Seven Du Profile Icon Russell Treleaven +4 more Show less
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.1 (7 Ratings)
Paperback Jul 2016 300 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Charles Bujold Profile Icon Kalyani Kulkarni Profile Icon Florent Krieg Profile Icon Mike Jerris Profile Icon Ken Rice Profile Icon Schreiber Profile Icon Seven Du Profile Icon Russell Treleaven +4 more Show less
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.1 (7 Ratings)
Paperback Jul 2016 300 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Mastering FreeSWITCH

Chapter 2. Deploying FreeSWITCH

FreeSWITCH is deployed in production on a range of hardware platforms from BeagleBoards and RaspBerryPIs, to big iron, telecom-grade servers. FS will happily work as a little appliance on a customer's premises and will merrily chug millions of calls in the datacenter. The trade-off between hardware cost, power consumption and form factor depends on use case. Obviously, the more cores and CPUs you throw at it, the more the RAM, and the faster the hard disks; the more concurrent calls you can get.

Here we focus on best deployment practices to obtain the most reliable service from your FreeSWITCH server. In this chapter, we will cover:

  • Network requirements
  • Testing
  • Logging
  • Monitoring
  • HA (High Availability) Deployment

Network requirements

Quality of audio perceived by the user will first and foremost be affected by the network performance. Delays, jitter, and loss of packets can severely degrade end user experience, to an unacceptable level. There are several key components that can enable FreeSWITCH to operate more securely and efficiently: MPLS or dedicated peering connections can greatly enhance the network reliability, while Quality of Service (QoS) packet tagging and differentiating settings between your local LAN and the public WAN infrastructures will let you find the sweet point between infrastructure costs and audio quality.

Understanding QoS

QoS is a mechanism for guaranteeing that certain types of communication can be ranked for importance of delivery to ensure quality. There are multiple types of QoS that can be achieved in most network environments. Generally, QoS can be done on the physical layer (for example, guaranteeing that all phones are connected on a network that has its own cables...

Testing with SIPp

Testing is an important task when you are working on a new service and you want to check everything before deploying it in a production environment. For Session Initiation Protocol (SIP) one key testing tool is definitely SIPp, open source software that can be used for testing purposes. It is able to behave as SIP User Agent Client (UAC) as well as User Agent Server (UAS) hence you can use it these ways:

  • SIPp is used as UAC and calls FreeSWITCH (IVR, voice applications, and more)
  • SIPp is used as UAS and is the endpoint being called (by another FreeSWITCH extension for instance)
  • SIPp is used on both sides of a single call (the caller and the callee) to build completely automated tests

Running scenarios

One of the strengths of SIPp is that it is highly customizable: the user writes scenario files in XML format that details all communication steps. An XML scenario file basically describes every SIP message the tool has to send and every response it is supposed to get. Some variables...

Logging with FreeSWITCH

Logging is an integral part of any properly managed communication operation. The capability of tracing the minimal details of protocol exchanges and the paths through the internal software mechanisms can be invaluable for pinpointing the intermittent problem of a customer.

There are two main media for logging in FreeSWITCH: the console, for example the fs_cli application, and the log file. Both options use the same mechanism to show or save information.

By default, FreeSWITCH logs all information into one log file at the DEBUG level (the highest detail, producing the most quantity of information). The log file is created and managed by module mod_logfile, configured through logfile.conf.xml. By default, that single log file is called freeswitch.log and is located in freeswitch/log/.

The general format for the log lines is: call-uuid YYYY-MM-DD hh:mm:ss:nnnnnn [LEVEL] source_file_name:line_numberfunction_name() <log data>.

Log levels go from EMERG (Level 0) to DEBUG...

Call Detail Records

Each call will generate one or more Call Detail Record (CDR). CDRs are written after the call ends, and contains all information needed for accounting and billing that call. As an example, an outbound call (outbound is most critical for accounting and billing) the CDR would contain information such as date/time, caller account, caller device, destination, and duration. As an added bonus it can contain all kinds of details about the call itself, such as codec used, outbound route or gateway, and/or the status of the system.

So, in CDRs you can store and gather any kind of info you deem useful on a per-call basis. A complete call is often composed of an A leg (caller) bridged to a B leg (callee). In the FS console, the show calls command shows that each call is composed of two channels (A leg and B leg). You can choose to write a CDR for A leg, B leg, or both.

There are two main kinds of CDRs FreeSWITCH is able to generate: Comma Separated Value (CSV) files, and XML files...

Monitoring

When deploying one or more FreeSWITCH servers in a production environment, it is essential to set up some monitoring mechanisms. Monitoring is more than a best-practice, it is a must-have to maintain a reliable, highly-available, powerful VoIP softswitch. It is necessary in order to be quick to react in case of critical issues and various emergencies. Setting up monitoring mechanisms is easy to say, but a good question would be 'what should we monitor, and how?' You would probably want to keep an eye on several aspects of a running server, for instance:

  • Check if everything is fine at a system level, for example:
    • Is the FreeSWITCH service up and running?
    • Are all the IP ports that are supposed to be listening actually listening?
    • Is my host too loaded or is it just fine?
  • Check more specifically if the FreeSWITCH service is sane
  • Check very specific aspects of the operation, for example:
    • Does my IVR behave like it should?
    • Are the conference rooms working?
    • Is the voicemail service...

Network requirements


Quality of audio perceived by the user will first and foremost be affected by the network performance. Delays, jitter, and loss of packets can severely degrade end user experience, to an unacceptable level. There are several key components that can enable FreeSWITCH to operate more securely and efficiently: MPLS or dedicated peering connections can greatly enhance the network reliability, while Quality of Service (QoS) packet tagging and differentiating settings between your local LAN and the public WAN infrastructures will let you find the sweet point between infrastructure costs and audio quality.

Understanding QoS

QoS is a mechanism for guaranteeing that certain types of communication can be ranked for importance of delivery to ensure quality. There are multiple types of QoS that can be achieved in most network environments. Generally, QoS can be done on the physical layer (for example, guaranteeing that all phones are connected on a network that has its own cables...

Testing with SIPp


Testing is an important task when you are working on a new service and you want to check everything before deploying it in a production environment. For Session Initiation Protocol (SIP) one key testing tool is definitely SIPp, open source software that can be used for testing purposes. It is able to behave as SIP User Agent Client (UAC) as well as User Agent Server (UAS) hence you can use it these ways:

  • SIPp is used as UAC and calls FreeSWITCH (IVR, voice applications, and more)

  • SIPp is used as UAS and is the endpoint being called (by another FreeSWITCH extension for instance)

  • SIPp is used on both sides of a single call (the caller and the callee) to build completely automated tests

Running scenarios

One of the strengths of SIPp is that it is highly customizable: the user writes scenario files in XML format that details all communication steps. An XML scenario file basically describes every SIP message the tool has to send and every response it is supposed to get. Some variables...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • 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

Description

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.

Who is this book 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

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 29, 2016
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781784398880
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jul 29, 2016
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781784398880
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 106.97
Freeswitch 1.6 Cookbook
€32.99
Mastering FreeSWITCH
€36.99
FreeSWITCH 1.8
€36.99
Total 106.97 Stars icon

Table of Contents

14 Chapters
1. Typical Voice Uses for FreeSWITCH Chevron down icon Chevron up icon
2. Deploying FreeSWITCH Chevron down icon Chevron up icon
3. ITSP and Voice Codecs Optimization Chevron down icon Chevron up icon
4. VoIP Security Chevron down icon Chevron up icon
5. Audio File and Streaming Formats, Music on Hold, Recording Calls Chevron down icon Chevron up icon
6. PSTN and TDM Chevron down icon Chevron up icon
7. WebRTC and Mod_Verto Chevron down icon Chevron up icon
8. Audio and Video Conferencing Chevron down icon Chevron up icon
9. Faxing and T38 Chevron down icon Chevron up icon
10. Advanced IVR with Lua Chevron down icon Chevron up icon
11. Write Your FreeSWITCH Module in C Chevron down icon Chevron up icon
12. Tracing and Debugging VoIP Chevron down icon Chevron up icon
13. Homer, Monitoring and Troubleshooting Your Communication Platform Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.1
(7 Ratings)
5 star 42.9%
4 star 28.6%
3 star 28.6%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Sep 20, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book will take you through years of experience of real uses cases without having to wait. The authors have really done a wonderful job. This book is for those who are already familiar with freeSWITCH and is not for the beginner.
Amazon Verified review Amazon
Sudar Vendan Jun 02, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Nice to have for Voice Engineers, Spoon feeding tutorial
Amazon Verified review Amazon
Jurijs Sep 15, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I used Freeswitch during last several years and this book helped me to fill some of my blind spots. I would recommend this book for beginners and advanced users.
Amazon Verified review Amazon
James Ungar Mar 13, 2024
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Feefo Verified review Feefo
Ishmael Apr 13, 2017
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I agree with the reviewer who termed this book a good 1000 foot view. I purchased Mastering FreeSWITCH hoping to find out out how to diagnose and solve problems with my freeswitch installation and this book was too introductory to be really helpful. The chapter on Verto, for example, is not as useful or informative as the official tutorial available online. I couldn't read the code sample images on my tablet and the kindle edition contained several blank pages. Despite the title, this book is not a path to Freeswitch mastery. However, it's definitely something to read if you're considering adopting Freeswitch. Four stars because Anthony Minessale is a hero who has made an significant contribution to the world of open source.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.