Asterisk™: The Future of Telephony

Jim Van Meggelen

Leif Madsen

Jared Smith

Tolman Creek Design

Joe Wizda

Karen Montgomery

David Futato

Robert Romano

Jessamyn Read

Printed in the United States of America.

[M]

O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or .

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Asterisk: The Future of Telephony, the image of starfish, and related trade dress are trademarks of O’Reilly Media, Inc. Asterisk™ is a trademark of Digium, Inc. Asterisk: The Future of Telephony is published under the Creative Commons “Commons Deed” license (http://creativecommons.org/licenses/by-nc-nd/2.5/ca/).

While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

This book uses RepKover™, a durable and flexible lay-flat binding.


Dedication

This book is dedicated to Rich Adamson (1947–2006).

Thanks for showing us the meaning of community.

Table of Contents

Foreword
Preface
Audience
Organization
Software
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
Jim Van Meggelen
Leif Madsen
Jared Smith
1. A Telephony Revolution
VoIP: Bridging the Gap Between Traditional and Network Telephony
The Zapata Telephony Project
Massive Change Requires Flexible Technology
Asterisk: The Hacker’s PBX
Asterisk: The Professional’s PBX
The Asterisk Community
The Asterisk Mailing Lists
The Asterisk Wiki
The IRC Channels
Asterisk User Groups
The Asterisk Documentation Project
The Business Case
This Book
2. Preparing a System for Asterisk
Server Hardware Selection
Performance Issues
Choosing a Processor
Small systems
Medium systems
Large systems
Choosing a Motherboard
Power Supply Requirements
Computer power supplies
Redundant power supplies
Environment
Power Conditioning and Uninterruptible Power Supplies
Power-conditioned UPSes
Grounding
Electrical Circuits
The Equipment Room
Humidity
Temperature
Dust
Security
Telephony Hardware
Connecting to the PSTN
Analog interface cards
Digital interface cards
Channel banks
Other types of PSTN interfaces
Connecting Exclusively to a Packet-Based Telephone Network
Echo Cancellation
Types of Phones
Physical Telephones
Analog telephones
Proprietary digital telephones
ISDN telephones
IP telephones
Softphones
Telephony Adaptors
Communications Terminals
Linux Considerations
Conclusion
3. Installing Asterisk
What Packages Do I Need?
Linux Package Requirements
Obtaining the Source Code
Obtaining Asterisk Source Code
Extracting the Source Code
Menuselect
Compiling Zaptel
The ztdummy Driver
The Zapata Telephony Drivers
Using ztcfg and zttool
Compiling libpri
Compiling Asterisk
Standard Installation
Alternative make Arguments
make clean
make distclean
make update
make webvmail
make progdocs
make config
Using Precompiled Binaries
Installing Additional Prompts
Common Compiling Issues
Asterisk
configure: error: no acceptable C compiler found in $PATH
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
configure: error: *** termcap support not found
Zaptel
make: cc: Command not found
FATAL: Module wctdm/fxs/fxo not found
Unresolved symbol link when loading ztdummy
Depmod errors during compilation
Loading Asterisk and Zaptel Quickly
Loading Zaptel Modules Without Scripts
Systems Running udevd
Loading Zaptel
Loading ztdummy
Loading libpri Without Script
Starting Asterisk Without Scripts
Console Commands
Directories Used by Asterisk
/etc/asterisk/
/usr/lib/asterisk/modules/
/var/lib/asterisk
/var/spool/asterisk/
/var/run/
/var/log/asterisk/
/var/log/asterisk/cdr-csv
AsteriskNOW
What Is AsteriskNOW?
Before You Begin
What You Will Need
Installation
Quick installation
Extended procedure
Accessing the GUI
Alternate Installations
For More Information
Conclusion
4. Initial Configuration of Asterisk
What Do I Really Need?
Working with Interface Configuration Files
Setting Up the Dialplan for Some Test Calls
FXO and FXS Channels
Determining the FXO and FXS Ports on Your TDM400P
Configuring an FXO Channel for a PSTN Connection
Zaptel Hardware Configuration
Zapata Hardware Configuration
Dialplan Configuration
Dialing In
Configuring an FXS Channel for an Analog Telephone
Zaptel Hardware Configuration
Zapata Hardware Configuration
Dialplan Configuration
Configuring SIP Telephones
Basic SIP Telephone Configuration in Asterisk
Defining the SIP device in Asterisk
Configuring the Device Itself
Essential Server Components
DHCP server
FTP server
CounterPath’s X-Lite Softphone
Polycom’s IP 430
DHCP server
Protocol to use for downloading
FTP
The Polycom configuration files
Cisco 7960 Telephone
Linksys SPA-942
Logging in to the phone
Registering your phone to Asterisk
Configuring the Dialplan for Testing
Connecting to a SIP Service Provider
Connecting Two Asterisk Boxes Together via SIP
Configuring Our Asterisk Boxes
SIP Phone Configuration
Configuring the Dialplan
Configuring an IAX Softphone
Configuring the Channel Configuration File (iax.conf)
Configure the Softphone
Configuring the Dialplan for Testing
Connecting to an IAX Service Provider
Connecting Two Asterisk Boxes Together via IAX
Configuring Our Asterisk Boxes
IAX Phone Configuration
Configuring the Dialplan
Using Templates in Your Configuration Files
Debugging
Connecting to the Console
Enabling Verbosity and Debugging
Conclusion
5. Dialplan Basics
Dialplan Syntax
Contexts
Extensions
Priorities
Unnumbered priorities
Priority labels
Applications
A Simple Dialplan
The s Extension
The Answer(), Playback(), and Hangup() Applications
Our First Dialplan
Building an Interactive Dialplan
The Background(), WaitExten(), and Goto() Applications
Handling Invalid Entries and Timeouts
Using the Dial() Application
Adding a Context for Internal Calls
Using Variables
Global variables
Channel variables
Environment variables
Adding variables to our dialplan
Pattern Matching
Pattern-matching syntax
Pattern-matching examples
Using the ${EXTEN} channel variable
Enabling Outbound Dialing
Includes
Conclusion
6. More Dialplan Concepts
Expressions and Variable Manipulation
Basic Expressions
Operators
Dialplan Functions
Syntax
Examples of Dialplan Functions
Conditional Branching
The GotoIf() Application
Time-Based Conditional Branching with GotoIfTime()
Voicemail
Creating Mailboxes
Adding Voicemail to the Dialplan
Accessing Voicemail
Creating a Dial-by-Name Directory
Macros
Defining Macros
Calling Macros from the Dialplan
Using Arguments in Macros
Using the Asterisk Database (AstDB)
Storing Data in the AstDB
Retrieving Data from the AstDB
Deleting Data from the AstDB
Using the AstDB in the Dialplan
Handy Asterisk Features
Zapateller()
Call Parking
Conferencing with MeetMe()
Conclusion
7. Understanding Telephony
Analog Telephony
Parts of an Analog Telephone
Ringer
Dial pad
Hybrid (or network)
Tip and Ring
Digital Telephony
Pulse-Code Modulation
Digitally encoding an analog waveform
Increasing the sampling resolution and rate
Nyquist’s Theorem
Logarithmic companding
Aliasing
The Digital Circuit-Switched Telephone Network
Circuit Types
The humble DS-0―the foundation of it all
T-carrier circuits
SONET and OC circuits
Digital Signaling Protocols
Channel Associated Signaling (CAS)
ISDN
Signaling System 7
Packet-Switched Networks
Conclusion
8. Protocols for VoIP
The Need for VoIP Protocols
VoIP Protocols
IAX (The “Inter-Asterisk eXchange” Protocol)
History
Future
Security considerations
IAX and NAT
SIP
History
Future
Security considerations
SIP and NAT
H.323
History
Future
Security considerations
H.323 and NAT
MGCP
Proprietary Protocols
Skinny/SCCP
UNISTIM
Codecs
G.711
G.726
G.729A
GSM
iLBC
Speex
MP3
Quality of Service
TCP, UDP, and SCTP
Transmission Control Protocol
User Datagram Protocol
Stream Control Transmission Protocol
Differentiated Service
Guaranteed Service
MPLS
RSVP
Best Effort
Echo
Why Echo Occurs
Managing Echo on Zaptel Channels
Hardware Echo Cancellation
Asterisk and VoIP
Users and Peers and Friends—Oh My!
Users
Peers
Friends
register Statements
VoIP Security
Spam over Internet Telephony (SPIT)
Encrypting Audio with Secure RTP
Spoofing
What Can Be Done?
Basic network security
Encryption
Physical security
Conclusion
9. The Asterisk Gateway Interface (AGI)
Fundamentals of AGI Communication
What Are STDIN, STDOUT, and STDERR?
The Standard Pattern of AGI Communication
Calling an AGI Script from the Dialplan
Writing AGI Scripts in Perl
The Perl AGI Library
Creating AGI Scripts in PHP
The PHP AGI Library
Writing AGI Scripts in Python
The Python AGI Library
Debugging in AGI
Debugging from the Operating System
Using Asterisk’s agi debug Command
Conclusion
10. Asterisk Manager Interface (AMI) and Adhearsion
The Manager Interface
Connecting to the Manager Interface
Sending Commands
Transferring a call
Reading a configuration file
Updating configuration files
The Flash Operator Panel
Asterisk Development with Adhearsion
A New Approach to Dialplans
Asterisk Development with Adhearsion
Installing Adhearsion
Installing Ruby/RubyGems on AsteriskNOW
Installing Ruby/RubyGems on Linux
Installing Ruby/RubyGems on Mac OS X
Ruby/RubyGems on Windows
Installing Adhearsion from RubyGems
Exploring a New Adhearsion Project
Adhearsion dialplan writing
Database integration
Distributing and reusing code
Integrate with Your Desk Phone Using Micromenus
Integrating with a Web Application
Using Java
More Information
11. The Asterisk GUI Framework
Why a GUI for Asterisk?
What Is the GUI?
Mark Spencer Talks About the GUI
Using the GUI
GUI elements
Architecture of the Asterisk GUI
Components of the Asterisk GUI
Asterisk Manager Interface
Manager over HTTP and the Asterisk web server
AJAM and JavaScript
Installing the Asterisk GUI
Setting up httpd.conf and manager.conf
Developing for the Asterisk GUI
Issuing Manager Commands over HTTP
LOGIN
Transferring a call
Reading a configuration file
Updating configuration files using UPDATECONFIG
Error response
Ajax, AJAM, and Asterisk
Form processing in a traditional web application
Form processing in an Ajax application
The Prototype framework
Customization of the GUI
Adding a new tab to the GUI
Exposing configuration settings in the GUI
For More Information
12. Relational Database Integration
Introduction
Installing the Database
Installing and Configuring ODBC
Configuring res_odbc for Access to Our Database
Using Realtime
Static Realtime
Dynamic Realtime
Storing Call Detail Records
Getting Funky with func_odbc: Hot-Desking
ODBC Voicemail
Creating the Large Object Type
Configuring voicemail.conf for ODBC Storage
Testing ODBC Voicemail
Conclusion
13. Managing Your Asterisk System
Call Detail Recording
Managing Logs
Running Asterisk As a Non-root User
Customizing System Prompts
Music on Hold
Conclusion
14. Potpourri
Festival
Getting Festival Set Up and Ready for Asterisk
Configuring Asterisk for Festival
Starting the Festival Server
Calling Festival from the Dialplan
Call Files
DUNDi
How Does DUNDi Work?
Configuring Asterisk for Use with DUNDi
The General Peering Agreement
General configuration
Creating mapping contexts
Defining DUNDi peers
Allowing remote connections
Configuring the dialplan
Alternative Voicemail Storage Methods
Storing Voicemail in an IMAP Server
Storing Voicemail in an ODBC Database
Asterisk and Jabber (XMPP)
Conclusion
15. Asterisk: The Future of Telephony
The Problems with Traditional Telephony
Closed Thinking
Limited Standards Compliancy
Slow Release Cycles
Refusing to Let Go of the Past and Embrace the Future
Paradigm Shift
The Promise of Open Source Telephony
The Itch That Asterisk Scratches
Open Architecture
Standards Compliance
Lightning-Fast Response to New Technologies
Passionate Community
Some Things That Are Now Possible
Legacy PBX migration gateway
Low-barrier IVR
Conference rooms
Home automation
The Future of Asterisk
Speech Processing
Festival
Speech recognition
High-Fidelity Voice
Video
The challenge of video-conferencing
Why we love video-conferencing
Why video-conferencing may never totally replace voice
Wireless
Wi-Fi
Wi-MAX
Unified Messaging
Peering
E.164
ENUM
e164.org
DUNDi
Challenges
Too much change, too few standards
VoIP spam
Fear, uncertainty, and doubt
Bottleneck engineering
Regulatory wars
Quality of service
Complexity
Opportunities
Tailor-made private telecommunications networks
Low barrier to entry
Hosted solutions of similar complexity to corporate web sites
Proper integration of communications technologies
A. VoIP Channels
IAX
General IAX Settings
Registering to Other Servers with register Statements
IAX Channel Definitions
Channel-specific parameters
SIP
General SIP Parameters
SIP Channel Definitions
B. Application Reference
AddQueueMember()
ADSIProg()
AgentCallbackLogin()
AgentLogin()
AgentMonitorOutgoing()
AGI()
AlarmReceiver()
AMD()
Answer()
AppendCDRUserField()
Authenticate()
Background()
BackgroundDetect()
Busy()
ChangeMonitor()
ChanIsAvail()
ChannelRedirect()
ChanSpy()
Congestion()
ContinueWhile()
ControlPlayback()
DateTime()
DBdel()
DBdeltree()
DeadAGI()
Dial()
Dictate()
Directory()
DISA()
DumpChan()
EAGI()
Echo()
EndWhile()
Exec()
ExecIf()
ExitWhile()
ExtenSpy()
ExternalIVR()
FastAGI()
Festival()
Flash()
FollowMe()
ForkCDR()
GetCPEID()
Gosub()
GosubIf()
Goto()
GotoIf()
GotoIfTime()
Hangup()
HasNewVoicemail()
HasVoicemail()
IAX2Provision()
ICES()
ImportVar()
Log()
LookupBlacklist()
LookupCIDName()
Macro()
MacroExclusive()
MacroExit()
MacroIf()
MailboxExists()
MeetMe()
MeetMeAdmin()
MeetMeCount()
Milliwatt()
MixMonitor()
Monitor()
MorseCode()
MP3Player()
MusicOnHold()
NBScat()
NoCDR()
NoOp()
Page()
Park()
ParkAndAnnounce()
ParkedCall()
PauseMonitor()
PauseQueueMember()
Pickup()
Playback()
Playtones()
PrivacyManager()
Progress()
Queue()
QueueLog()
Random()
Read()
ReadFile()
RealTime
RealTimeUpdate()
Record()
RemoveQueueMember()
ResetCDR()
RetryDial()
Return()
Ringing()
SayAlpha()
SayDigits()
SayNumber()
SayPhonetic()
SayUnixTime()
SendDTMF()
SendImage()
SendText()
SendURL()
Set()
SetAMAFlags()
SetCallerID()
SetCallerPres()
SetCDRUserField()
SetGlobalVar()
SetMusicOnHold()
SetTransferCapability()
SIPAddHeader()
SIPDtmfMode()
SLAStation()
SLATrunk()
SoftHangup()
StackPop()
StartMusicOnHold()
StopMixMonitor()
StopMonitor()
StopPlaytones()
StopMusicOnHold()
System()
Transfer()
TryExec()
TrySystem()
UnpauseMonitor()
UnpauseQueueMember()
UserEvent()
Verbose()
VMAuthenticate()
VoiceMail()
VoiceMailMain()
Wait()
WaitExten()
WaitForRing()
WaitForSilence()
WaitMusicOnHold()
While()
Zapateller()
ZapBarge()
ZapRAS()
ZapScan()
AddQueueMember()
ADSIProg()
AgentCallbackLogin()
AgentLogin()
AgentMonitorOutgoing()
AGI()
AlarmReceiver()
AMD()
Answer()
AppendCDRUserField()
Authenticate()
Background()
BackgroundDetect()
Busy()
ChangeMonitor()
ChanIsAvail()
ChannelRedirect()
ChanSpy()
Congestion()
ContinueWhile()
ControlPlayback()
DateTime()
DBdel()
DBdeltree()
DeadAGI()
Dial()
Dictate()
Directory()
DISA()
DumpChan()
EAGI()
Echo()
EndWhile()
Exec()
ExecIf()
ExitWhile()
ExtenSpy()
ExternalIVR()
FastAGI()
Festival()
Flash()
FollowMe()
ForkCDR()
GetCPEID()
Gosub()
GosubIf()
Goto()
GotoIf()
GotoIfTime()
Hangup()
HasNewVoicemail()
HasVoicemail()
IAX2Provision()
ICES()
ImportVar()
Log()
LookupBlacklist()
LookupCIDName()
Macro()
MacroExclusive()
MacroExit()
MacroIf()
MailboxExists()
MeetMe()
MeetMeAdmin()
MeetMeCount()
Milliwatt()
MixMonitor()
Monitor()
MorseCode()
MP3Player()
MusicOnHold()
NBScat()
NoCDR()
NoOp()
Page()
Park()
ParkAndAnnounce()
ParkedCall()
PauseMonitor()
PauseQueueMember()
Pickup()
Playback()
Playtones()
PrivacyManager()
Progress()
Queue()
QueueLog()
Random()
Read()
ReadFile()
RealTime
RealTimeUpdate()
Record()
RemoveQueueMember()
ResetCDR()
RetryDial()
Return()
Ringing()
SayAlpha()
SayDigits()
SayNumber()
SayPhonetic()
SayUnixTime()
SendDTMF()
SendImage()
SendText()
SendURL()
Set()
SetAMAFlags()
SetCallerID()
SetCallerPres()
SetCDRUserField()
SetGlobalVar()
SetMusicOnHold()
SetTransferCapability()
SIPAddHeader()
SIPDtmfMode()
SLAStation()
SLATrunk()
SoftHangup()
StackPop()
StartMusicOnHold()
StopMixMonitor()
StopMonitor()
StopPlaytones()
StopMusicOnHold()
System()
Transfer()
TryExec()
TrySystem()
UnpauseMonitor()
UnpauseQueueMember()
UserEvent()
Verbose()
VMAuthenticate()
VoiceMail()
VoiceMailMain()
Wait()
WaitExten()
WaitForRing()
WaitForSilence()
WaitMusicOnHold()
While()
Zapateller()
ZapBarge()
ZapRAS()
ZapScan()
C. AGI Reference
ANSWER
CHANNEL STATUS
DATABASE DEL
DATABASE DELTREE
DATABASE GET
DATABASE PUT
EXEC
GET DATA
GET FULL VARIABLE
GET OPTION
GET VARIABLE
HANGUP
NoOp
RECEIVE CHAR
RECORD FILE
SAY ALPHA
SAY DATE
SAY DATETIME
SAY DIGITS
SAY NUMBER
SAY PHONETIC
SAY TIME
SEND IMAGE
SEND TEXT
SET AUTOHANGUP
SET CALLERID
SET CONTEXT
SET EXTENSION
SET MUSIC ON
SET PRIORITY
SET VARIABLE
STREAM FILE
TDD MODE
VERBOSE
WAIT FOR DIGIT
ANSWER
CHANNEL STATUS
DATABASE DEL
DATABASE DELTREE
DATABASE GET
DATABASE PUT
EXEC
GET DATA
GET FULL VARIABLE
GET OPTION
GET VARIABLE
HANGUP
NoOp
RECEIVE CHAR
RECORD FILE
SAY ALPHA
SAY DATE
SAY DATETIME
SAY DIGITS
SAY NUMBER
SAY PHONETIC
SAY TIME
SEND IMAGE
SEND TEXT
SET AUTOHANGUP
SET CALLERID
SET CONTEXT
SET EXTENSION
SET MUSIC ON
SET PRIORITY
SET VARIABLE
STREAM FILE
TDD MODE
VERBOSE
WAIT FOR DIGIT
D. Configuration Files
modules.conf
adsi.conf
adtranvofr.conf
agents.conf
alarmreceiver.conf
alsa.conf
amd.conf
asterisk.conf
cdr.conf
cdr_manager.conf
cdr_odbc.conf
cdr_pgsql.conf
cdr_tds.conf
codecs.conf
dnsmgr.conf
dundi.conf
enum.conf
extconfig.conf
extensions.conf
extensions.ael
features.conf
festival.conf
followme.conf
func_odbc.conf
gtalk.conf
http.conf
iax.conf
iaxprov.conf
indications.conf
jabber.conf
logger.conf
[general]
[logfiles]
manager.conf
meetme.conf
mgcp.conf
modem.conf
musiconhold.conf
osp.conf
oss.conf
phone.conf
privacy.conf
queues.conf
res_odbc.conf
res_snmp.conf
rpt.conf
rtp.conf
say.conf
sip.conf
sip_notify.conf
skinny.conf
sla.conf
smdi.conf
udptl.conf
users.conf
voicemail.conf
General Voicemail Settings
Voicemail Zones
Defining Voicemail Contexts and Mailboxes
vpb.conf
zapata.conf
zaptel.conf
E. Asterisk Dialplan Functions
AGENT
ARRAY
BASE64_DECODE
BASE64_ENCODE
BLACKLIST
CALLERID
CDR
CHANNEL
CHECK_MD5
CHECKSIPDOMAIN
CURL
CUT
DB
DB_DELETE
DB_EXISTS
DUNDILOOKUP
ENUMLOOKUP
ENV
EVAL
EXISTS
FIELDQTY
FILTER
GLOBAL
GROUP
GROUP_COUNT
GROUP_LIST
GROUP_MATCH_COUNT
IAXPEER
IF
IFTIME
ISNULL
KEYPADHASH
LANGUAGE
LEN
MATH
MD5
MUSICCLASS
QUEUE_MEMBER_COUNT
QUEUE_MEMBER_LIST
QUEUE_WAITING_COUNT
QUEUEAGENTCOUNT
QUOTE
RAND
REALTIME
REGEX
SET
SHA1
SIP_HEADER
SIPCHANINFO
SIPPEER
SORT
SPEECH
SPEECH_ENGINE
SPEECH_GRAMMAR
SPEECH_SCORE
SPEECH_TEXT
SPRINTF
STAT
STRFTIME
STRPTIME
TIMEOUT
TXTCIDNAME
URIDECODE
URIENCODE
VMCOUNT
AGENT
ARRAY
BASE64_DECODE
BASE64_ENCODE
BLACKLIST
CALLERID
CDR
CHANNEL
CHECK_MD5
CHECKSIPDOMAIN
CURL
CUT
DB
DB_DELETE
DB_EXISTS
DUNDILOOKUP
ENUMLOOKUP
ENV
EVAL
EXISTS
FIELDQTY
FILTER
GLOBAL
GROUP
GROUP_COUNT
GROUP_LIST
GROUP_MATCH_COUNT
IAXPEER
IF
IFTIME
ISNULL
KEYPADHASH
LANGUAGE
LEN
MATH
MD5
MUSICCLASS
QUEUE_MEMBER_COUNT
QUEUE_MEMBER_LIST
QUEUE_WAITING_COUNT
QUEUEAGENTCOUNT
QUOTE
RAND
REALTIME
REGEX
SET
SHA1
SIP_HEADER
SIPCHANINFO
SIPPEER
SORT
SPEECH
SPEECH_ENGINE
SPEECH_GRAMMAR
SPEECH_SCORE
SPEECH_TEXT
SPRINTF
STAT
STRFTIME
STRPTIME
TIMEOUT
TXTCIDNAME
URIDECODE
URIENCODE
VMCOUNT
F. Asterisk Manager Interface Actions
AbsoluteTimeout
AgentCallbackLogin
AgentLogoff
Agents
ChangeMonitor
Command
DBGet
DBPut
Events
ExtensionState
GetConfig
GetVar
Hangup
IAXNetstats
IAXPeers
ListCommands
Logoff
MailboxCount
MailboxStatus
MeetmeMute
MeetMeUnmute
Monitor
Originate
Park
ParkedCalls
PauseMonitor
Ping
PlayDTMF
QueueAdd
QueuePause
QueueRemove
QueueStatus
Queues
Redirect
SIPpeers
SIPShowPeer
SetCDRUserField
SetVar
Status
StopMonitor
UnpauseMonitor
UpdateConfig
UserEvent
WaitEvent
ZapDNDoff
ZapDNDon
ZapDialOffhook
ZapHangup
ZapRestart
ZapShowChannels
ZapTransfer
AbsoluteTimeout
AgentCallbackLogin
AgentLogoff
Agents
ChangeMonitor
Command
DBGet
DBPut
Events
ExtensionState
GetConfig
GetVar
Hangup
IAXNetstats
IAXPeers
ListCommands
Logoff
MailboxCount
MailboxStatus
MeetmeMute
MeetMeUnmute
Monitor
Originate
Park
ParkedCalls
PauseMonitor
Ping
PlayDTMF
QueueAdd
QueuePause
QueueRemove
QueueStatus
Queues
Redirect
SIPpeers
SIPShowPeer
SetCDRUserField
SetVar
Status
StopMonitor
UnpauseMonitor
UpdateConfig
UserEvent
WaitEvent
ZapDNDoff
ZapDNDon
ZapDialOffhook
ZapHangup
ZapRestart
ZapShowChannels
ZapTransfer
G. An Example of func_odbc
Hot-Desking (extensions.conf)
Hot-Desking (func_odbc.conf)
Hot-Desking (sip.conf)
Hot-Desking (extensions.conf)
Hot-Desking (func_odbc.conf)
Hot-Desking (sip.conf)
Index

List of Figures

2.1. Visual identification of PCI slots
2.2. One way you might connect a channel bank
3.1. Sample menuselect screen
3.2. List of modules to be built
3.3. Layers of device interaction with Asterisk
3.4. /var/spool/asterisk/ directory structure
4.1. A TDM400P with an FXS module (1 across) and an FXO module (2 across)
4.2. X-Lite configuration
4.3. X-Lite user configuration
4.4. SPA-942 keypad
4.5. SIP trunking topology
4.6. idefisk
4.7. idefisk Account Options screen
7.1. Tip and Ring
7.2. A simple sinusoidal (sine) wave
7.3. Sampling our sine wave using four bits
7.4. PCM encoded waveform
7.5. Plotted PCM signal
7.6. Delineated signal
7.7. The same waveform, on a higher-resolution overlay
7.8. The same waveform at double the resolution
7.9. Five-bit plotted PCM signal
7.10. Waveform delineated from five-bit PCM
7.11. Five-bit companding
7.12. Quantized and companded at 5-bit resolution
8.1. The SIP trapezoid
8.2. Call origination relationships of users, peers, and friends to Asterisk
10.1. The Flash Operator Panel management interface
11.1. A screenshot of the Asterisk GUI
12.1. Relationships between func_odbc.conf, res_odbc.conf, /etc/odbc.ini (unixODBC), and the database connection
15.1. Asterisk as a PBX gateway
15.2. Find-me-follow-me
15.3. VoIP-enabling a legacy PBX
A.1. Trunking disabled
A.2. Trunking enabled

List of Tables

2.1. System requirement guidelines
2.2. Sample test results for SIPp default scenario using simple Wait() and Playback() application; SIPp echoed media back to Asterisk
3.1. List of packages required to compile libpri, zaptel, and asterisk
3.2. Asterisk initialization script options
3.3. Zaptel initialization script options
7.1. DTMF digits
7.2. T-carrier circuits
7.3. OC circuits
8.1. Codec quick reference