
- •Table of Contents
- •Introduction
- •What This Book Covers
- •Conventions
- •Reader Feedback
- •Customer Support
- •Errata
- •Questions
- •What is Asterisk?
- •Asterisk is a PBX
- •Station-To-Station Calls
- •Line Trunking
- •Telco Features
- •Advanced Call Distribution
- •Call Detail Records
- •Call Recording
- •Asterisk is an IVR System
- •Asterisk is a Voicemail System
- •Asterisk is a Voice over IP (VoIP) System
- •What Asterisk Isn't
- •Asterisk is Not an Off-the-Shelf Phone System
- •Asterisk is Not a SIP Proxy
- •Asterisk Does Not Run on Windows
- •Is Asterisk a Good Fit for Me?
- •Trade-Offs
- •Flexibility versus Ease of Use
- •Graphical versus Configuration File Management
- •Calculating Total Cost of Ownership
- •Return on Investment
- •Summary
- •The Public Switched Telephony Network (PSTN)
- •Connection Methods
- •Plain Old Telephone Service (POTS) Line
- •Integrated Services Digital Network (ISDN)
- •Voice over IP Connections
- •Determining Our Needs
- •Terminal Equipment
- •Types of Terminal Devices
- •Hard Phones
- •Soft Phones
- •Communications Devices
- •Another PBX
- •Choosing a Device
- •Features, Features, and More Features…
- •Determining True Cost
- •Compatibility with Asterisk
- •Sound Quality Analysis
- •Usability Issues
- •Recording Decisions
- •How Much Hardware do I Need?
- •Choosing the Extension Length
- •Summary
- •Preparing to Install Asterisk
- •Obtaining the Source Files
- •Installing Zaptel
- •Installing libpri
- •Installing Asterisk
- •Getting to Know Asterisk
- •Summary
- •Zaptel Interfaces
- •zaptel.conf
- •Lines
- •Terminals
- •zapata.conf
- •Lines
- •Terminals
- •SIP Interfaces
- •IAX Interfaces
- •Voicemail
- •Music On Hold
- •Queues
- •Conference Rooms
- •Summary
- •Creating a Context
- •Creating an Extension
- •Creating Outgoing Extensions
- •Advanced Call Distribution
- •Call Queues
- •Call Parking
- •Direct Inward Dialing (DID)
- •Automated Attendants
- •System Services
- •Summary
- •Call Detail Records
- •Flat-File CDR Logging
- •Database CDR Logging
- •Monitoring Calls
- •Recording Calls
- •Legal Concerns
- •Summary
- •CentOS
- •Preparation and Installation
- •The Asterisk Management Portal (AMP)
- •Maintenance
- •Setup
- •Flash Operator Panel (FOP)
- •Flash Operator Configuration Files
- •Web MeetMe
- •Flexibility When Needed
- •A Simple One-to-One PBX
- •Extensions
- •Trunks
- •Routes
- •Customer Relationship Management/SugarCRM
- •Adding Contacts
- •Call Scheduling
- •Administration of SugarCRM
- •Configure Settings
- •User Management
- •User Roles
- •Summary
- •Small Office/Home Office
- •The Scenario
- •The Discussion
- •The Configuration
- •zaptel.conf
- •zapata.conf
- •musiconhold.conf
- •voicemail.conf
- •modules.conf
- •extensions.conf
- •Conclusions
- •Small Business
- •The Scenario
- •The Discussion
- •The Configuration
- •zaptel.conf
- •zapata.conf
- •musiconhold.conf
- •agents.conf
- •queues.conf
- •sip.conf
- •meetme.conf
- •voicemail.conf
- •extensions.conf
- •Conclusions
- •Hosted PBX
- •The Scenario
- •The Discussion
- •The Configuration
- •zaptel.conf
- •zapata.conf
- •musiconhold.conf
- •sip.conf
- •voicemail.conf
- •extensions.conf
- •Conclusions
- •Summary
- •Backup and System Maintenance
- •Backing Up Configurations
- •Backing Up Log Files
- •Backup Scripts
- •Time Synchronization
- •Adding It All to cron
- •Rebuilding and Restoring the Asterisk Server
- •Disaster Recovery Plan (DRP)
- •Asterisk Server Security
- •Internal Access Control
- •Host Security Hardening for Asterisk
- •Integrity Checker
- •Root-Kit Detection
- •Automated Hardening
- •Role Based Access Control (RBAC)
- •Network Security for Asterisk
- •Firewalling the Asterisk Protocols
- •SIP (Session Initiation Protocol)
- •RTP—The Real-Time Transport Protocol
- •Controlling Administration of Asterisk
- •Asterisk Scalability
- •Load Balancing with DNS
- •Support Channels for Asterisk
- •Mailing Lists
- •Forums
- •IRC (Internet Relay Chat)
- •Digium
- •Summary
- •Index

Creating a Dialplan
If we have employees who have other work to do as well as answer calls, or have to call other employees to consult, or simply have a low call volume, we may wish to use AgentCallbackLogin. When we do so, our agents' phones are rung when a call comes in. We do this by using:
exten => 8001,1,AgentCallbackLogin
When our users arrive at work and wish to login, they call extension 8001, where they are prompted for their agent ID, password, and then an extension number at which they will take calls. This is how Asterisk knows how to reach them. Our agents can log out when using AgentCallbackLogin by going through the same procedure as for login, except when they are prompted for their extension, they press the # key.
It may be a good idea for us to review agents.conf. If we defined autologoff, then after the specified number of seconds ringing, the agent will be automatically logged off. If we set ackcall to yes, then agents must press the # key to accept calls. If we created a wrapuptime (defined in milliseconds), the Asterisk will wait that many milliseconds before sending another call to the agent. These options can help us make our phone system as user-friendly as we want it to be.
Through the use of call queues, we can distribute our incoming calls efficiently and effectively. We have plenty of options, and can mix-and-match these three ways of joining users to queues.
Call Parking
In many businesses across the United States, an operator can be heard announcing "John, you have a call on line 3. John, line 3." In Asterisk, we don't really have lines in the way that analog PBXs have them. Our users are accustomed to not having to transfer calls, especially when they may not know exactly where John is.
Asterisk uses a feature known as Call Parking to accomplish this same goal. Our users will transfer calls to a special extension, which will then tell them what extension to call to retrieve the call. Then our users can direct the intended recipient to dial that extension and connect to the call.
In order to be able to use this feature, we must define our parking lot. This is done in the /etc/asterisk/parking.conf file. In this file, there are only have a few options that we will need to configure. First, we must create the extension people are to dial to park calls. This can be whatever extension is convenient for us. Then we will define a list of extensions on which to place parked calls. These extensions will be what users dial to retrieve a parked call. Next, we will define what context we want our parked calls to be in. Finally, we will define how many seconds a call remains parked before ringing back to the user who parked it. Here is an example:
82

Chapter 5
[general] parkext => 8100
parkpos => 8101-8199 context => parkedcalls parkingtime => 120
These settings would mean that we can park calls by dialing 8100, and the call will be placed in extensions 8101 through 8199, giving us the ability to have up to 99 parked calls at any given time. The calls will be in the context called parkedcalls, which means we should be careful to include it in any context where users should be able to park and retrieve calls.
When our users transfer a call to extension 8100, they will hear Asterisk read out the extension that the call has been placed on. They can now make a note of it and notify the appropriate coworker of the extension to reach the calling customer on. If the call is not picked up within the given parkingtime, then the call will ring back to the user who parked the call.
By using call parking, we can help our users by providing a feature similar to that of previous generations of PBXs. This also allows users to collaborate and redirect callers to other users who are better equipped to handle our customers' needs.
Direct Inward Dialing (DID)
Suppose we work at a healthcare company with over 100 employees. We have two PRI lines coming in, and only three switchboard agents to handle incoming calls. As a healthcare company, we schedule many appointments, answer questions about prescriptions, and help patients with billing questions. These three agents are always busy.
Now suppose the IT guy's wife calls in to ask if he wants sprouts or mash with his dinner. Do we want our switchboard agents to have to answer the call, find out who it is and what they want, and then transfer the call, or would we rather the IT guy's wife can call her husband directly?
This is where Direct Inward Dialing comes in handy. DID is a service provided by phone companies where they send an agreed-upon set of digits, depending on the number the customer dialed. For most phone companies, the sent digits will be the full 10-digit number (in the United States). But this can be as small as the last digit.
All right, so the phone company is sending digits. What are we going to do with them? Imagine you have a PRI coming in to your office, and only ten phone numbers, a block from (850) 555-5550 to 5559. Your phone company has agreed to send you only the last digit dialed, which will be from 0 to 9, because you are guaranteed for this to be unique. Asterisk can route calls based on this DID information.
83