coverpage
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
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
Downloading the color images of this book
Errata
Piracy
Questions
Architecture of FreeSWITCH
Real-time communication without mysteries
The FreeSWITCH design - modular scalable and stable
Important modules - Endpoint and Dialplan
Complex applications made simple
Voicemail
Multi-party audio/video conferencing
FreeSWITCH API commands (FSAPI)
The XML registry
Scripting language modules
The demo configuration
Summary
Building and Installation
Where to Install FreeSWITCH
Choice of Operating System
Linux
Windows
OS X (Mac)
*BSD
Packages or Source?
Installing FreeSWITCH
Debian 8 Jessie
From Packages
From Source
Windows
Summary
Test Driving the Example Configuration
Important concepts to understand
XML Configuration
Regular Expressions
Call Legs
IVRs Interactive Voice Response (Systems)
Extensions Contexts and Profiles
Variables
Caller profile Variables
"Normal" Variables
"Preprocessor" Variables
FS_CLI and Console Controlling FreeSWITCH
Exiting from Console kills FreeSWITCH
Some useful CLI commands
Configure SIP and make the first calls in demo dialplan
Change demo example password
Configure Linphone on a Desktop
Configure a SNOM SIP "real" phone
Configure Linphone on Android
And now... Fun fun fun with the Demo Dialplan
9386 Funny Prompts
1000...1019 Phone to Phone Local Call
5000 Calling the Demo Example IVR
3000 Conference Call
Example Dialplan quick reference
Summary
User Directory SIP and Verto
User Directory concepts
AAA: Authentication Authorization Accounting
Exploring and Using the Demo Example User Directory
Domains and groups
Users
Adding a user to the demo example directory and dialplan
Adding a new user to the directory
Modifying the dialplan for the new user
Call to a Group
Voicemail
Communicate with the World via SIP Gateways and DIDs
SIP Gateway from Us to the ITSP to the World
SIP DID from World to the ITSP to Us
SIP and Verto Profiles Dialplan Contexts ITSPs
SIP Profiles
Dialplan Contexts
Verto Profiles and Dialplan Contexts
ITSPs
Summary
WebRTC SIP and Verto
WebRTC concepts
Encryption Everywhere
WebRTC in FreeSWITCH
WebRTC Signaling in FS: SIP and Verto
Why SIP and why Verto?
WebRTC Media Streaming in FS: SRTP
Installing and Configuring WebRTC in FS
Certificates
Installing and Configuring Apache or NginX for HTTPS serving
Apache
NginX
Configuring VERTO
Configuring SIP on WebRTC (WSS)
Writing WebRTC Clients
SIP and JavaScript
Verto and JavaScript
Verto Communicator an Advanced WebRTC Client
WebRTC Rooms both SIP and Verto Clients
Conference chat in WebRTC Rooms
FreeSWITCH Conferences
mod_sms and chatplan
Dialplan "chat_proto" extension
HTML
JavaScript
TODO
Summary
XML Dialplan
Forget all you know
Contexts
Default context
Public context
Features
Extensions
Conditions (and "patterns")
Call legs (channels)
Channel Variables
Regular Expressions
Actions and anti-actions
How dialplan processing works
Important dialplan applications
answer
bridge
hangup
ivr
play_and_get_digits
playback
set
sleep
transfer
Dialstring formats
SIP (sofia)
VERTO
Other dialstring formats
Originate Command
Summary
Phrase Macros and XML IVRs
Phrase Macros and Voice Prompts
Voice Prompts history
Sound files in FreeSWITCH
Sound files locations sampling rate and fallbacks
Phrase Macros: Concatenating Sound files
macro name (pause)
input pattern
match - nomatch
action
Phrase Macros: Invocation Patterns and Registers
Phrase Macro Invocation
Input Pattern and Registers
XML IVRs
IVR in demo config
XML voice menu fields
name
greet-long
greet-short
invalid-sound
exit-sound
timeout
inter-digit-timeout
max-failures
max-timeouts
digit-len
tts-engine
tts-voice
confirm-key
XML voice menu entries and actions
menu-exec-app
menu-play-sound
menu-sub
menu-back
menu-top
menu-exit
Nesting XML IVRs
Summary
Lua FreeSWITCH Scripting
Many scripting languages
Why Lua?
Basic Lua syntax
Lua and FreeSWITCH
freeswitch
freeswitch.Session and session
freeswitch.API
freeswitch.Dbh
freeswitch.Event
freeswitch.EventConsumer
freeswitch.IVRMenu
Lua scripting IVR Applications
playAndGetDigits
Syntax
Arguments
Behavior
XML demo IVR in Lua
Always checking session:ready()
Summary
Dialplan in Deep
Where are the previous Dialplan seasons?
XML Dialplan Recap
More about conditions
regex operator (multiple variables and/or expressions)
nested conditions
Pitfalls to avoid
Variables
Global variables
Time of Day Day of Week Holidays
Channel Variables
Channel Variables and Field shortcuts
Channel Variables and Caller Profile fields
Channel Variables and call setup
setting channel variables in dialstrings
setting channel variables on B-legs: export and nolocal
exporting variables to SIP custom (X-) Headers
API commands from Dialplan
FreeSWITCH string interpreter functions
cond C-like "expr ? truevalue : falsevalue"
variables' substrings
db and hash: simple key/value stores
"Hotkeys" Listening Barging
bind_meta_* DTMFs to actions outside menus
eavesdrop (call barge)
eavesdrop DTMF commands
Dialplan Cookbook
Match by IP address and call a number
Match an IP address and Caller ID
Match a number and strip digits
Match a number strip digits and add a prefix
Call a registered device
Try party A then party B
Route DIDs to extensions
Alternate outbound gateways
Multiple endpoints with enterprise originate
Summary
Dialplan Directory and ALL via XML_CURL and Scripts
mod_xml_curl rationale
mod_xml_curl configuration
mod_xml_curl: Caveats and Pitfalls
php/mysql setup for mod_xml_curl
Create and populate the Database
Setup NGINX and xmlhandler.php
mod_xml_curl configuration
Testing php/mysql setup for mod_xml_curl
Lua XML handler
lua xmlhandler script
lua.conf.xml
Lua xml_handler.lua testing
Summary
ESL - FreeSWITCH Controlled by Events
Event System Fundamentals
Event format - Headers and Body
Event Handling modules
mod_event_socket
mod_event_socket configuration
Reading and sending events via telnet
fs_cli
Event System Commands
api
bgapi
event
filter
filter delete
sendevent
exit
auth
log
nolog
nixevent
noevents
sendmsg
call-command
execute
hangup
Outbound Socket - call connects to you
ESL - Event Socket Library
ESL supported languages
ESL Reference
eslSetLogLevel
ESLevent Object
new
serialize
setPriority
getHeader
getBody
getType
addBody
addHeader
delHeader
firstHeader
nextHeader
ESLconnection Object
new
socketDescriptor
connected
getInfo
send
sendRecv
api
bgapi
sendEvent
recvEvent
recvEventTimed
filter
events
execute
executeAsync
setAsyncExecute
setEventLock
disconnect
ESL installation
ESL: Examples in Perl
Display Filtered Events
Use "api" and "bgapi"
Use "sendEvent"
Summary
HTTAPI - FreeSWITCH Asks Webserver Next Action
HTTAPI Rationale
HTTAPI dialplan
data
httapi_profile
url
method
HTTAPI document syntax
Work actions
playback
record
pause
speak
say
execute
sms
dial
recordCall
conference
hangup
break
log
continue
getVar
voicemail
vmname
exiting (param)
storing data across successive requests
mod_httapi configuration file
params
gateway-url
method
permissions
set-params
set-vars
get-vars
extended-data
extended-data longer than max CGI length
execute-apps
expand-vars
dial
dial-set-dialplan
dial-set-context
dial-set-cid-name
dial-set-cid-number
dial-full-originate
conference
conference-set-profile
HTTPAPI libraries for PHP and Python
The demo-ivr in PHP-HTTAPI
Summary
Conferencing and WebRTC Video-Conferencing
Conferencing Concepts
Conferencing Support in FreeSWITCH
Audio conferencing
Video conferencing
Audio Conferencing setup in FreeSWITCH
profiles
rate
caller-controls
auto-record
interval
energy-level
member-flags
conference-flags
tts-engine
tts-voice
pin
max-members
caller-id-name
caller-id-number
comfort-noise
announce-count
suppress-events
sound-prefix
sounds
caller-controls
advertise
Video-WebRTC conferencing setup in FreeSWITCH
profiles additional video parameters
video-mode
video-layout-name
video-canvas-size
video-no-video-avatar
video-mute-banner
caller-controls additional video actions
member-flags additional video options
conference-flags additional video options
screen estate layouts
layout groups
FreeSWITCH conferencing operation
Conference Application (dialplan)
Controlling active conferences
Calling outbound into the conference
Verto Communicator and Video-WebRTC Conferencing
settings
participants list
participant GUI commands and chat
moderator GUI commands
screen sharing
Summary
Handling NAT
A brief introduction to NAT
Understanding the evolution of NAT
The four pitfalls of NAT
Demystifying NAT settings in FreeSWITCH
Making media flow
Advanced options and settings
FreeSWITCH behind NAT
FreeSWITCH speaks to the router
FreeSWITCH behind NAT leaving the router alone
Additional ways to set the external addresses
Other creative uses of FreeSWITCH in a NAT situation
NAT and WebRTC (SOLVED)
Conclusion
Summary
VoIP Security
Network level protection
Separating interfaces and restricting traffic
Sample setup - simple
Sample setup - complex
VLANs
Intrusion detection
Registration and call attempts monitoring
Fail2Ban
Filter configurations
Jail configurations
Do not lock the good guys out!
Encryption in non-WebRTC SIP: Signaling and Media
Choosing between encryption options
Disabling SSLv3 and SSLv2
Certificates
"Real" certificates from "real" CAs
Protecting signaling
Encryption with TLS
Protecting media
Encryption with SRTP
Enabling SRTP
Debugging SRTP
Encryption with ZRTP
Enabling ZRTP
Testing media SIP encryption
Protecting WebRTC SIP and VERTO Signaling and Media
Protecting passwords
Registration passwords as hashes
Voicemail passwords
Summary
Troubleshooting Asking for Help and Reporting Bugs
Troubleshooting FreeSWITCH
firewall rules and network issues
checking FreeSWITCH configuration and operation
fsctl loglevel 7
sofia global siptrace on
verto debug=10
sngrep: SIP dialogs visualization
tcpdump for saving net traffic in pcap files
Asking for Help
Read the documentation first!
confluence
books
mailing list archives
google
How to ask for Community Help
IRC
HipChat
mailing lists
Official Commercial Support and Consulting
Reporting Problems
don't report a bug on mailing list !
how to file a bug on Jira
ClueCon
Summary
更新时间:2021-07-02 19:44:16