Book description
This bestselling book is now the standard guide to building phone systems with Asterisk, the open source IP PBX that has traditional telephony providers running scared! Revised for the 1.4 release of the software, the new edition of Asterisk: The Future of Telephony reveals how you can save money on equipment and support, and finally be in control of your telephone system.
If you've worked with telephony in the past, you're familiar with the problem: expensive and inflexible systems that are tuned to the vendor's needs, not yours. Asterisk isn't just a candle in the darkness, it's a whole fireworks show. Because Asterisk is so powerful, configuring it can seem tricky and difficult. This book steps you through the process of installing, configuring, and integrating Asterisk with your existing phone system.
You'll learn how to write dialplans, set up applications including speech synthesis and voice recognition, how to script Asterisk, and much more -- everything you need to design a simple but complete system with little or no Asterisk experience, and no more than rudimentary telecommunications knowledge. The book includes:
- A new chapter on managing/administering your Asterisk system
- A new chapter on using Asterisk with databases
- Coverage of features in Asterisk 1.4
- A new appendix on dialplan functions
- A simplified installation chapter
- New simplified SIP configuration, including examples for several popular SIP clients (soft phones and IP telephones)
- Revised chapters and appendicies reviewed and updated for the latest in features, applications, trends and best-practices
Publisher resources
Table of contents
- Dedication
- Foreword
- Preface
- 1. A Telephony Revolution
- 2. Preparing a System for Asterisk
-
3. Installing Asterisk
- What Packages Do I Need?
- Obtaining the Source Code
- Menuselect
- Compiling Zaptel
- Compiling libpri
- Compiling Asterisk
- Installing Additional Prompts
- Common Compiling Issues
- Loading Asterisk and Zaptel Quickly
- Loading Zaptel Modules Without Scripts
- Loading libpri Without Script
- Starting Asterisk Without Scripts
- Directories Used by Asterisk
- AsteriskNOW™
- 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
- Configuring an FXO Channel for a PSTN Connection
- Configuring an FXS Channel for an Analog Telephone
- Configuring SIP Telephones
- Connecting to a SIP Service Provider
- Connecting Two Asterisk Boxes Together via SIP
- Configuring an IAX Softphone
- Connecting to an IAX Service Provider
- Connecting Two Asterisk Boxes Together via IAX
- Using Templates in Your Configuration Files
- Debugging
- Conclusion
-
5. Dialplan Basics
- Dialplan Syntax
- A Simple Dialplan
- Building an Interactive Dialplan
- Conclusion
- 6. More Dialplan Concepts
- 7. Understanding Telephony
- 8. Protocols for VoIP
- 9. The Asterisk Gateway Interface (AGI)
-
10. Asterisk Manager Interface (AMI) and Adhearsion
- The Manager Interface
- The Flash Operator Panel
- Asterisk Development with Adhearsion
- 11. The Asterisk GUI Framework
- 12. Relational Database Integration
- 13. Managing Your Asterisk System
- 14. Potpourri
- 15. Asterisk: The Future of Telephony
- A. VoIP Channels
-
B. Application Reference
- AddQueueMember() — Dynamically adds queue members to the specified call queue
- ADSIProg() — Loads an ADSI script into an ADSI-capable phone
- AgentCallbackLogin() — Enables agent login with callback
- AgentLogin() — Allows a call agent to log in to the system
- AgentMonitorOutgoing() — Records an agent’s outgoing calls
- AGI() — Executes an AGI-compliant application
- AlarmReceiver() — Provides support for receiving alarm reports from a burglar or fire alarm panel
- AMD() — Answering machine detection
- Answer() — Answers a channel, if it is ringing
- AppendCDRUserField() — Appends a value to the user field of the Call Detail Record
- Authenticate() — Requires that the caller enter a correct password before continuing
- Background() — Plays a file while accepting touch-tone (DTMF) digits
- BackgroundDetect() — Plays a file in the background and detects talking
- Busy() — Indicates a busy condition to the channel
- ChangeMonitor() — Changes the monitoring filename of a channel
- ChanIsAvail() — Finds out if a specified channel is currently available
- ChannelRedirect() — Redirects a channel to a new location in the dialplan
- ChanSpy() — Listens to the audio on a channel, and optionally whisper to the calling channel
- Congestion() — Indicates congestion on the channel
- ContinueWhile() — Restart a While() loop
- ControlPlayback() — Plays a file, with the ability to fast forward and rewind the file
- DateTime() — Says the date and/or time in the user-specified format
- DBdel() — Deletes a key from the AstDB
- DBdeltree() — Deletes a family or key tree from the AstDB
- DeadAGI() — Executes an AGI-compliant script on a dead (hung-up) channel
- Dial() — Attempts to connect channels
- Dictate() — Virtual dictation machine
- Directory() — Provides a dialable directory of extensions
- DISA() — Direct Inward System Access: allows inbound callers to make outbound calls
- DumpChan() — Dumps information about the calling channel to the console
- EAGI()
- Echo() — Echoes inbound audio back to the caller
- EndWhile() — Ends a while loop
- Exec() — Executes an Asterisk application dynamically
- ExecIf() — Conditionally executes an Asterisk application
- ExitWhile() — Exit from a While() loop, whether or not the conditional has been satisfied
- ExtenSpy() — Listen to the audio on an extension, and optionally whisper to the calling channel
- ExternalIVR() — Interfaces with an external IVR application
- FastAGI() — Executes an AGI-compliant script across a network connection
- Festival() — Uses the Festival text-to-speech engine to read text to the caller
- Flash() — Flashes a Zap trunk
- FollowMe() — Find me/follow me functionality
- ForkCDR() — Creates an additional CDR from the current call
- GetCPEID() — Gets the CPE ID from an ADSI-capable telephone
- Gosub() — Branches to a new location, saving the return address
- GosubIf() — Conditionally branches to a new location, saving the return address
- Goto() — Sends the call to the specified priority, extension, and context
- GotoIf() — Conditionally goes to the specified priority
- GotoIfTime() — Conditionally branches, depending on the time and day
- Hangup() — Unconditionally hangs up the current channel
- HasNewVoicemail() — Checks to see if there is new voicemail in the indicated voicemail box
- HasVoicemail() — Indicates whether there is voicemail in the indicated voicemail box
- IAX2Provision() — Provisions a calling IAXy device
- ICES() — Streams audio to an Icecast server
- ImportVar() — Sets a variable based on a channel variable from a different channel
- Log() — Logs a custom message from the dialplan
- LookupBlacklist() — Performs a lookup of a Caller ID name/number from the blacklist database
- LookupCIDName() — Performs a lookup of a Caller ID name from the AstDB
- Macro() — Calls a previously defined dialplan macro
- MacroExclusive() — Runs a macro, exclusive of any other channel
- MacroExit() — Explicitly returns from a macro
- MacroIf() — Conditionally calls a previously defined macro
- MailboxExists() — Conditionally branches if the specified voicemail box exists
- MeetMe() — Puts the caller in to a MeetMe conference bridge
- MeetMeAdmin() — Performs MeetMe conference administration
- MeetMeCount() — Counts the number of participants in a MeetMe conference
- Milliwatt() — Generates a 1,000 Hz tone
- MixMonitor() — Records a channel in the background, mixing both directions synchronously
- Monitor() — Monitors (records) the audio on the current channel
- MorseCode() — Plays Morse code
- MP3Player() — Plays an MP3 file or stream
- MusicOnHold() — Plays music on hold indefinitely
- NBScat() — Plays an NBS local stream
- NoCDR() — Disables Call Detail Records for the current call
- NoOp() — Does nothing
- Page() — Opens one-way audio to multiple phones
- Park() — Parks the current call
- ParkAndAnnounce() — Parks the current call and announces the call over the specified channel
- ParkedCall() — Answers a parked call
- PauseMonitor() — Suspends monitoring of a channel
- PauseQueueMember() — Temporarily blocks a queue member from receiving calls
- Pickup() — Answers a ringing call from another phone
- Playback() — Plays the specified audio file to the caller
- Playtones() — Plays a tone list
- PrivacyManager() — Requires a caller to enter his phone number, if no Caller ID information is received
- Progress() — Indicates progress
- Queue() — Places the current call in to the specified call queue
- QueueLog() — Writes arbitrary queue events to the queue log
- Random() — Conditionally branches, based upon a probability
- Read() — Reads DTMF digits from the caller and assigns the result to a variable
- ReadFile() — Reads the contents of a file in to a variable
- RealTime — Looks up information from the RealTime configuration handler
- RealTimeUpdate() — Updates a value via the RealTime configuration handler
- Record() — Records channel audio to a file
- RemoveQueueMember() — Dynamically removes queue members
- ResetCDR() — Resets the Call Detail Record
- RetryDial() — Attempts to place a call, and retries on failure
- Return() — Returns from a Gosub() or GosubIf()
- Ringing() — Indicates ringing tone
- SayAlpha() — Spells a string
- SayDigits() — Says the specified digits
- SayNumber() — Says the specified number
- SayPhonetic() — Spells the specified string phonetically
- SayUnixTime() — Says the specified time in a custom format
- SendDTMF() — Sends arbitrary DTMF digits to the channel
- SendImage() — Sends an image file
- SendText() — Sends text to the channel
- SendURL() — Sends the specified URL to the channel (if supported)
- Set() — Sets a variable to the specified value
- SetAMAFlags() — Sets AMA flags in the Call Detail Record
- SetCallerID() — Sets the Caller ID for the channel
- SetCallerPres() — Sets Caller ID presentation flags
- SetCDRUserField() — Sets the Call Detail Record user field
- SetGlobalVar() — Sets a global variable to the specified value
- SetMusicOnHold() — Sets the default music-on-hold class for the current channel
- SetTransferCapability() — Sets the ISDN transfer capability of a channel
- SIPAddHeader() — Adds a SIP header to the outbound call
- SIPDtmfMode() — Changes the DTMF method for a SIP call
- SLAStation() — Shared line appearance station
- SLATrunk() — Shared line appearance trunk
- SoftHangup() — Performs a soft hangup of the requested channel
- StackPop() — Removes last address from Gosub() stack
- StartMusicOnHold() — Starts music on hold
- StopMixMonitor() — Stops monitoring a channel
- StopMonitor() — Stops monitoring a channel
- StopPlaytones() — Stops playing a tone list
- StopMusicOnHold() — Stops music on hold
- System() — Executes an operating system command
- Transfer() — Transfers the caller to a remote extension
- TryExec() — Tries to execute an Asterisk application
- TrySystem() — Tries to execute an operating system command
- UnpauseMonitor() — Resumes monitoring of a channel
- UnpauseQueueMember() — Unpauses a queue member
- UserEvent() — Sends an arbitrary event to the Manager Interface
- Verbose() — Sends arbitrary text to verbose output
- VMAuthenticate() — Authenticates the caller from voicemail passwords
- VoiceMail() — Leaves a voicemail message in the specified mailbox
- VoiceMailMain() — Enters the voicemail system
- Wait() — Waits for a specified number of seconds
- WaitExten() — Waits for an extension to be entered
- WaitForRing() — Waits the specified number of seconds for a ring
- WaitForSilence() — Waits for a specified amount of silence
- WaitMusicOnHold() — Waits the specified number of seconds, playing music on hold
- While() — Starts a while loop
- Zapateller() — Uses a special information tone to block telemarketers
- ZapBarge() — Barges in on (monitors) a Zap channel
- ZapRAS() — Executes the Zaptel ISDN Remote Access Server
- ZapScan() — Scans Zap channels to monitor calls
-
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
-
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
- 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
- vpb.conf
- zapata.conf
- zaptel.conf
-
E. Asterisk Dialplan Functions
- AGENT — Returns information about an agent
- ARRAY — Allows one to define several variables at one time
- BASE64_DECODE — Decodes a BASE64 encoded string
- BASE64_ENCODE — Encodes a string in BASE64
- BLACKLIST — Checks if the Caller ID is on the blacklist
- CALLERID — Gets or sets Caller ID data on the channel
- CDR — Gets or sets CDR information for this call (which will be written to the CDR log)
- CHANNEL — Gets or sets various channel parameters
- CHECK_MD5 — Validate an MD5 digest
- CHECKSIPDOMAIN — Checks if a domain is local
- CURL — Returns the data resulting from a GET or POST to a URI
- CUT — Cuts a string based on a given delimiter
- DB — Read or write to AstDB
- DB_DELETE — Deletes a key or key family from the AstDB database
- DB_EXISTS — Checks AstDB for specified key
- DUNDILOOKUP — Queries DUNDi peers for a particular number
- ENUMLOOKUP — Queries the ENUM database for a particular number
- ENV — References environment variables
- EVAL — Evaluates stored variables
- EXISTS — Checks if value is non-blank
- FIELDQTY — Counts fields
- FILTER — Strips string of illegal characters
- GLOBAL — References global namespace
- GROUP — Associates the channel into a set group
- GROUP_COUNT — Counts the number of channels in the specified group.
- GROUP_LIST — Lists channel groups
- GROUP_MATCH_COUNT — Counts channels in a matching group name
- IAXPEER — Obtains IAX channel information
- IF — Conditional value selection
- IFTIME — Compares the current system time to a time specification
- ISNULL — Checks if a value is blank
- KEYPADHASH — Converts letters into numbers
- LANGUAGE — Accesses the channel language
- LEN — Calculates the string length
- MATH — Mathematical calculations
- MD5 — Calculates MD5 digest
- MUSICCLASS — Access a channel’s music-on-hold setting
- QUEUE_MEMBER_COUNT — Counts queue members
- QUEUE_MEMBER_LIST — Lists queue members
- QUEUE_WAITING_COUNT — Count waiting calls
- QUEUEAGENTCOUNT
- QUOTE — Escapes a string
- RAND — Random number
- REALTIME — Retrieves real-time data
- REGEX — Compares based upon a regular expression
- SET — Sets a variable
- SHA1 — SHA-1 digest
- SIP_HEADER — Retrieves a SIP header
- SIPCHANINFO — Retrieves info on a SIP channel
- SIPPEER — Retrieves info about a SIP peer
- SORT — Sorts a list
- SPEECH — Retrieves info on speech recognition results
- SPEECH_ENGINE — Modifies speech engine property
- SPEECH_GRAMMAR — Retrieves speech grammar information
- SPEECH_SCORE — Retrieves speech recognition confidence score
- SPEECH_TEXT — Retrieves recognized text
- SPRINTF — Formats a string
- STAT — Evaluates filesystem attributes
- STRFTIME — Formats the date and time
- STRPTIME — Converts a string into a date and time
- TIMEOUT — Accesses channel timeout values
- TXTCIDNAME — DNS lookup
- URIDECODE — Decodes a URI
- URIENCODE — Encodes a URI
- VMCOUNT — Counts voicemail messages
-
F. Asterisk Manager Interface Actions
- AbsoluteTimeout — Sets the sAbsoluteTimeout on a channel
- AgentCallbackLogin — Sets an agent as logged in to the queue system in callback mode
- AgentLogoff — Sets an agent as no longer logged in
- Agents — Lists agents and their status
- ChangeMonitor — Changes monitoring filename of a channel
- Command — Executes an Asterisk CLI command
- DBGet — Gets AstDB entry
- DBPut — Puts DB entry
- Events — Controls event flow
- ExtensionState — Checks extension status
- GetConfig — Retrieves configuration
- GetVar — Retrieves the value of a variable
- Hangup — Hangs up channel
- IAXNetstats — Shows IAX statistics
- IAXPeers — Lists IAX peers
- ListCommands — Lists the manager commands
- Logoff — Logs off manager session
- MailboxCount — Checks mailbox message count
- MailboxStatus — Checks mailbox status
- MeetmeMute — Mutes a MeetMe user
- MeetMeUnmute — Unmutes a MeetMe user
- Monitor — Monitors a channel
- Originate — Originates call
- Park — Parks a channel
- ParkedCalls — Lists parked calls
- PauseMonitor — Pauses the recording of a channel
- Ping — Keeps connection alive
- PlayDTMF — Plays DTMF on a channel
- QueueAdd — Adds a member to the specified queue
- QueuePause — Pauses or unpauses a member in a call queue
- QueueRemove — Removes interface from queue
- QueueStatus — Checks queue status
- Queues — Shows basic queue information
- Redirect — Redirects (transfers) a channel
- SIPpeers — Lists all SIP peers
- SIPShowPeer — Shows information about a SIP peer
- SetCDRUserField — Sets the CDR UserField
- SetVar — Sets channel variable
- Status — Lists channel status
- StopMonitor — Stops the recording of a channel
- UnpauseMonitor — Unpauses monitoring
- UpdateConfig — Updates a config file
- UserEvent — Sends an arbitrary event
- WaitEvent — Waits for an event to occur
- ZapDNDoff — Sets a Zap channel’s do not disturb status to off
- ZapDNDon — Sets a Zap channel’s do not disturb status to on
- ZapDialOffhook — Dials over Zap channel while off-hook
- ZapHangup — Hangs up Zap channel
- ZapRestart — Fully restarts Zaptel channels
- ZapShowChannels — Shows status Zapata channels
- ZapTransfer — Transfers Zap channel
- G. An Example of func_odbc
- Index
- About the Authors
- Colophon
- Copyright
Product information
- Title: Asterisk: The Future of Telephony, 2nd Edition
- Author(s):
- Release date: August 2007
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596510480
You might also like
book
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
book
Generative Deep Learning, 2nd Edition
Generative AI is the hottest topic in tech. This practical book teaches machine learning engineers and …
book
Robust Python
Does it seem like your Python projects are getting bigger and bigger? Are you feeling the …
book
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 3rd Edition
Through a recent series of breakthroughs, deep learning has boosted the entire field of machine learning. …