You are previewing FreeSWITCH 1.6 Cookbook.
O'Reilly logo
FreeSWITCH 1.6 Cookbook

Book Description

Over 45 practical recipes to empower you with the latest FreeSWITCH 1.6 features

In Detail

FreeSWITCH is an open source carrier-grade telephony platform designed to facilitate the creation of voice, chat, and video applications, via phones and web browsers. It is scalable, carrier-ready, and easy-to-program for converged communication and VoIP. The technology serves SIP, WebRTC, PSTN, FAX, PBX, VERTO, and all the relevant channels essential to stay connected in today's world.

In the FreeSWITCH 1.6 Cookbook, members of the FreeSWITCH development team share some of their hard-earned knowledge with you. Use this knowledge to improve and expand your FreeSWITCH installations.

What You Will Learn

  • Configure users and phones as well as connections to VoIP providers

  • Control FreeSWITCH remotely with the powerful event socket interface

  • Route inbound and outbound calls

  • Insert CDRs into a database

  • Enable text-to-speech in your voice applications

  • Set up SSL certificates and release services to WebRTC

  • Write JavaScript WebRTC clients for real time data/video/audio in browsers

  • Grasp the FreeSWITCH security best practices and Lua application programming knowledge

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased 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.

    Table of Contents

    1. FreeSWITCH 1.6 Cookbook
      1. Table of Contents
      2. FreeSWITCH 1.6 Cookbook
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Routing Calls
        1. Introduction
          1. Regular expressions
          2. Important dialplan contexts in the default configuration
            1. The default context
            2. The public context
            3. The features context
        2. Internal calls
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Incoming DID (also known as DDI) calls
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Outgoing calls
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Ringing multiple endpoints simultaneously
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Ringing multiple endpoints sequentially (simple failover)
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Handling busy and other failure conditions
            2. Handling no-answer conditions
            3. Using individual bridge calls
          5. See also
        7. Advanced multiple endpoint calling with enterprise originate
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Setting variables in enterprise originate
            2. Ringback
          5. See also
        8. Time-of-day routing
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Manipulating SIP To: headers on registered endpoints to reflect DID numbers
          1. Getting ready
          2. How to do it...
          3. How it works...
      9. 2. Connecting Telephones and Service Providers
        1. Introduction
        2. Configuring an SIP phone to register with FreeSWITCH
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Context
            2. Customizing caller ID
          5. See also
        3. Connecting to Skype
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Incoming Skype calls connected to an SIP softphone
            2. Incoming SIP calls connected to Skype destinations
        4. Configuring an SIP gateway
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Adding prefixes to dial strings
            2. Monitoring gateways
        5. Codec configuration
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Avoiding codec negotiation altogether
      10. 3. Processing Call Detail Records
        1. Introduction
        2. Using CSV CDRs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. File names and locations
            2. Other options
            3. CDR CSV templates
          5. See also
        3. Using XML CDRs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. File names and locations
            2. Logging the B leg
          5. See also
        4. Inserting CDRs into a backend database
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Using a web server to handle XML CDRs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Using the event socket to handle CDRs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. ESL considerations
          5. Receiving XML CDRs
          6. See also
        7. Directly inputting CDRs into various databases in real time
          1. How to do it...
          2. There's more...
      11. 4. External Control
        1. Introduction
        2. Getting familiar with the fs_cli interface
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Important commands for listing information
            2. Useful command-line options
            3. Viewing events
          5. See also
        3. Setting up the event socket library
          1. Getting ready
            1. Debian/Ubuntu
            2. Red Hat/CentOS
          2. How to do it...
          3. How it works...
        4. Establishing an inbound event socket connection
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Establishing an outbound event socket connection
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Using fs_ivrd to manage outbound connections
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Filtering events
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Launching a call with an inbound event socket connection
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Using the ESL connection object for call control
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        10. Using the built-in web interface
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      12. 5. PBX Functionality
        1. Introduction
        2. Creating users
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Accessing voicemail
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. The company directory
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        5. Using phrase macros to build sound prompts
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Creating XML IVR menus
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. See also
        7. Music on hold
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        8. Creating conferences
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Caller controls
            2. Conference moderator and PIN
        9. Sending faxes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Diagnosing fax issues
            2. Helpful software
          5. See also
        10. Receiving faxes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Detecting inbound faxes
            2. Processing a received fax
          5. See also
        11. Basic text-to-speech with mod_flite
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        12. Advanced text-to-speech with mod_tts_commandline
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Modifying the audio stream
            2. Other TTS engines
            3. Configuration file examples
          5. See also
        13. Recording calls
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      13. 6. WebRTC and Mod_Verto
        1. Introduction
        2. Configuring FreeSWITCH for WebRTC
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. SIP signaling in JavaScript with SIP.js (WebRTC client)
          1. Getting ready
          2. How to do it...
            1. Minimal click-to-call caller client
            2. Minimal callee
          3. How it works...
          4. See also
        4. Verto installation and setup
          1. How to do it...
          2. How it works...
        5. Verto signaling in JavaScript using Verto.js (Verto client)
          1. How to do it...
          2. How it works...
          3. See also
      14. 7. Dialplan Scripting with Lua
        1. Introduction
        2. Creating a basic Lua script
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. User interaction and DTMF gathering
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Using conditionals, loops, web calls, and regular expressions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Connecting to an external database
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      15. Index