31,19 €
FreePBX is an easy-to-use GUI that controls and manages Asterisk. It gives you pre-programmed functionality accessible through user-friendly web interfaces that allows you to have a fully functional PBX pretty much straight away with no programming. With this book it's easy to master the many features of FreePBX, which will help you to save time and money as you set up your enterprise-class network.
This book will guide you through these features to install, configure, and maintain a professional PBX with plenty of examples and screenshots. By the end of this book, you will have learned to create an enterprise-class VoIP PBX that features the stability and feature set of traditional telephony systems without the hefty price tag.
This book will help its readers to roll out a robust, web-based, and inexpensive yet powerful telephony solution through the GUI. By following the practical examples in this book, you will learn how to install, configure, and manage an enterprise-class PBX using open source telephony tools Asterisk and FreePBX. From here on, this book takes a closer look at the open source telephony engine software, discussing a broad range of topics from how to build and deploy an enterprise-class VoIP PBX to creating VoIP trunks using SIP, IAX2, and ZAP technologies and setting up user extensions with voicemail. FreePBX 2.5 Powerful Telephony Solutions will introduce you to advanced options such as call routing, voicemail, and other calling features. Finally, this book will provide you with the relevant information to help you personalize and secure your PBX.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 346
Veröffentlichungsjahr: 2009
Copyright © 2009 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: August 2009
Production Reference: 1200809
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847194-72-5
www.packtpub.com
Cover Image by Vinayak Chittar (<[email protected]>)
Author
Alex Robar
Reviewer
Justin Zimmer
Acquisition Editor
Sarah Cullington
Development Editor
Darshana D. Shinde
Technical Editors
Conrad Sardinha
Charumathi Sankaran
Copy Editor
Sanchari Mukherjee
Indexer
Rekha Nair
Editorial Team Leader
Gagandeep Singh
Project Team Leader
Priya Mukherji
Project Coordinator
Leena Purkait
Proofreader
Lynda Sliwoski
Drawing Coordinator
Nilesh Mohite
Production Coordinator
Shantanu Zagade
Cover Work
Shantanu Zagade
Alex Robar is a strong supporter of Open Source Software and has worked in the IT industry for seven years. He has worked with Digium's Asterisk software since version 1.2, and typically uses Asterisk to replace existing closed source PBX systems for SMBs. As the Technical Services Manager for GearyTech (a Canadian Managed Services Provider), he develops IT automation solutions for SMBs. He has worked with open source telephony solutions for the past four years, and has collaborated on the development and growth of an international Asterisk-based VoIP peering network.
In 2005, Alex co-authored Secure Your E-mail Server on IBM eServer i5 with Linux, an IBM Redpaper on using OSS solutions on the iSeries server platform to create an integrated security appliance for a small business. Alex has also authored several freely available short tutorials for Asterisk and FreePBX.
I would like to thank my parents for always supporting my inner geek, no matter what, my sister Amanda for always giving me her time even when I was unable to give her mine, and my fiancée Eveline who has always pushed her own interests aside to help support mine when I needed it.
I would also like to thank Leena Purkait and Darshana Shinde of Packt Publishing for keeping me on track throughout this entire process, and helping me solve whatever difficulties I had.
Justin Zimmer has worked in the contact center technology field for over ten years. During that time he has performed extensive software and computer telephony integrations using both PSTN and IP telephony. His current projects include system designs utilizing open source soft switches over more traditional proprietary hardware based telephony, and the integration of these technologies into market specific CRM products.
As CTO of Unicore Technologies out of Phoenix, AZ, Justin is developing hosted contact center solutions for the low-end market. Unicore's solutions present contact centers with low startup costs in a turbulent economy, and allows those centers to scale their business while maintaining a consistent and familiar user interface.
Justin has worked on countless software user manuals and instructional guides for both internal and customer usage.
He also worked on the Hopewell Blogs: a science fiction adventure novel that will be released chapter by chapter online and available in print once the final chapter has been released.
I'd like to thank the countless community contributors that have provided enough online documentation to make this book as accurate and helpful as possible. And I'd like to thank my wife Nicole for putting up with the extra hours spent reviewing this book, as well as my boys Micah and Caden and my daughter Keira for giving up some of their daddy-time for this project.
FreePBX 2.5 Powerful Telephony Solutions was written to help system administrators build, configure, and maintain an enterprise class PBX using the Asterisk and FreePBX open source software packages. This book covers the complete process of going from a bare metal server to a completely configured PBX with extensions, voicemail, least cost routing, digital receptionists, and dozens of other features.
Each chapter of the book discusses a specific feature set of FreePBX. The chapters contain step-by-step set up instructions for configuring each feature alongside screenshots of the FreePBX interface. Chapters that cover the installation of Asterisk and FreePBX as well as securing the PBX once it is built, are also included.
In Chapter 1: Installing FreePBX, we discuss the base requirements for a Linux operating system that will run Asterisk and FreePBX. We step through configuring Apache and MySQL, and then proceed to download and install Asterisk and FreePBX under both CentOS and Ubuntu.
In Chapter 2: Module Maintenance, we introduce the modularized structure of FreePBX and the online FreePBX module repository. Instructions for installing, updating, and removing modules are provided.
In Chapter 3: Devices and Extensions, we cover the concept of extensions within FreePBX. We discuss both the operational modes for extensions, as well as the various types of endpoints that FreePBX makes available. Instructions are provided for configuring extensions, users and devices, as well as voicemail boxes.
In Chapter 4: Trunks, we introduce the concept of trunking as a method of connecting our PBX to the outside world. Instructions are provided for setting up each type of trunk that FreePBX supports. We also discuss methods for checking the status of configured trunks to make sure that nothing has failed.
In Chapter 5: Basic Call Targets, we explain the concept of directing inbound calls to call targets. Usage instructions are provided for sending calls to a termination target, an extension, or a voicemail box. Step-by-step instructions are provided for configuring ring groups, conferences, day night modes, and phonebook directories.
In Chapter 6: Advanced Call Targets, we provide step-by-step instructions for configuring queues, time conditions, time groups, and IVRs (digital receptionists).
In Chapter 7: Call Routing, we discuss directing inbound calls to the call targets created in Chapters 5 and 6. We also discuss routing outbound calls over specific trunks, and setting up outbound routes to achieve least cost routing.
In Chapter 8: Recording Calls, we delve into the call recording features of FreePBX. Instructions are provided for setting up permanent or selective call recording for specific extensions, conferences, or queues.
In Chapter 9: Personalizing Your PBX, we introduce some FreePBX features that allow us to make our PBX on our own. Step-by-step instructions are provided for configuring custom music on hold, voice prompts, feature codes, applications, and destinations. We discuss how to set up FreePBX to call back inbound callers and how to provide dial tone to external callers who are not calling from an extension on the PBX. We also cover how to configure FreePBX to check additional sources for caller ID information if none is provided, and how to configure PIN sets to password protect various FreePBX features.
In Chapter 10: System Protection, Backup and Restoration, we cover the concept of ensuring that our PBX is protected against failure. We discuss backing and restoring our FreePBX configuration data in case our PBX does encounter a failure.
In Chapter 11: Security and Access Control, we provide steps that should be taken to secure our PBX against malicious users and unauthorized access. Instructions for updating the operating system, updating Asterisk, securing MySQL, securing remote access, and configuring FreePBX administrator accounts are provided.
In Appendix A:FreePBX Modules, we provide a listing of all modules available for installation from the online repository and their functions.
In Appendix B:Feature Codes, we list all of the default feature codes and their actions.
In Appendix C:Voicemail.conf Options, we provide options that affect the behavior of a mailbox and the way the voicemail messages are received and processed.
In Appendix D:Common Trunk Configurations, we provide the trunk configuration settings for common VoIP providers.
This book assumes a basic knowledge of Linux and telephony, though neither is strictly required. All commands that need to be run are provided and concepts that need to be understood are explained.
This book requires a server that is capable of running Linux, Asterisk, and FreePBX. The hardware requirements for the server will depend upon how many calls the PBX will be routing, and which actions callers can perform once they reach the PBX (for example, a PBX that records every call will require more resources than one that does not). The server should not have any operating system on it to start with. Recommended installation options are provided for both CentOS and Ubuntu.
This book is written for systems administrators who want to get started with Asterisk and FreePBX. This book is perfect for administrators who want to reduce costs by replacing a proprietary PBX with a PBX that runs on open source packages, or an administrator who needs their PBX to do more than it currently does. Anyone who wants to build a stable, feature rich PBX will find this book useful.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "Replace newpassword with the password you would like to set for the MySQL root user."
A block of code is set as follows:
Any command-line input or output is written as follows:
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "In order to set up a backup, click on the Tools tab at the top of the navigation menu on the left".
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an email to <[email protected]>, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visit http://www.packtpub.com/files/code/4725_Code.zip to directly download the example code.
The downloadable files contain instructions on how to use them.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration, and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or web site name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Ubuntu Server is a popular and stable operating system based on Debian GNU/Linux. It is becoming increasingly popular for general-purpose server deployments, and is a good choice for an Asterisk/FreePBX server.
Ubuntu Server 8.10 should be installed with the following options:
Once you have a clean Ubuntu Server 8.10 install to work from, the prerequisite packages can be installed.
FreePBX requires several prerequisite packages to install and function properly. Most prerequisite packages are not included in standard Linux distribution installations, but all should be available in your distributions package management system.
The first important step is to update your system, ensuring that all security updates are installed and all installed packages are at the latest version. To update all of the installed packages on Ubuntu Server 8.10, log in as the standard user that you created during the setup, and type the following into the system console:
Enter your user account password when prompted.
The system will proceed to download and install any of the packages that have been updated since the release of your operating system. Depending on how many updates are required and the speed of your Internet connection, this process can take anything from a few minutes to several hours.
Once the system is fully up to date, it is a good idea to reboot so that the updated services can restart and newer kernels can be booted. To reboot, type the following into the console:
Now that the system is up to date, the required prerequisite libraries and packages can be installed. To install the required prerequisite packages on Ubuntu Server 8.10, log in as a standard user and type the following:
Note that all of the above is a single aptitude command, and should be typed as if it was written on a single line.
Now that all prerequisite packages are installed, we can install Asterisk.
First, switch to the /usr/src directory by typing the following into the console:
Install Asterisk from source
Many Linux distributions provide Asterisk and its dependent libraries in their package management systems. It is recommended that Asterisk, Asterisk-Addons, LibPRI, and Zaptel always be compiled and installed from source. This avoids improperly built or outdated installations.
A core Asterisk installation consists of four components—Asterisk, Asterisk-Addons, DAHDI, and LibPRI:
Type the following into the console to download the source code for Asterisk, Asterisk-Addons, DAHDI, and LibPRI:
Extract the source code:
Compile and install the DAHDI telephony hardware interface modules:
Compile and install Asterisk:
Compile and install the Asterisk-Addons modules:
Compile and install the LibPRI modules:
The PEAR DB module is installed through PEAR software by typing the following into the console:
Finally, we start Asterisk as a background process by typing:
Note that this method of starting Asterisk is only temporary. Once installed, the FreePBX startup script will be configured to run at boot.
FreePBX utilizes a MySQL database to store all of the configurations shown in the web interface it provides.
Under Ubuntu Server 8.10, MySQL must simply be started. A MySQL root password is entered during the Ubuntu install process, and Ubuntu automatically sets up the MySQL service to start at boot time. To start MySQL, type the following command:
A separate user account under which Asterisk can run should also be created. It is common for Asterisk to run as the root user on a system (and almost always an easier way to make things work), but it is a security risk. Should Asterisk or Apache be compromised by a remote exploit, the flaw cannot be used to take over the entire server when Asterisk runs as its own user. Create a user account called asterisk that Asterisk will run as, using the following command:
Note that all of the above is a single adduser command, and should be typed as if it was written on a single line.
Create a database to store Asterisk configuration and another to store call detail records:
Enter your MySQL root password when prompted.
FreePBX has created prepared SQL statements to set up the structure of each database it uses. Type the following to switch to the /usr/src directory and download the FreePBX installer archive:
The above command will download FreePBX version 2.5.1. To check for the current version of FreePBX, visit the site http://freepbx.org/download-freepbx. The current version will be listed next to the Download FreePBX button. If the listed version is newer than 2.5.1, it should be used instead.
Extract FreePBX using the following command:
Switch to the FreePBX SQL directory:
The two prepared statements provided by FreePBX are newinstall.sql and cdr_mysql_table.sql. The newinstall.sql file contains the necessary SQL statements to create the tables that store all FreePBX configuration data (extensions, call targets, call routing information, etc.). The cd_mysql_table.sql file contains one single statement that creates a CDR table for storing all call details records. To run the SQL statements contained in these files, run the following commands:
Enter your MySQL root password when prompted.
Now we must grant the Asterisk user permissions on the Asterisk and Asterisk CDR databases. FreePBX will not function without this access. To grant permissions, we must first drop to a MySQL shell:
Enter your MySQL root password when prompted.
Once at the MySQL shell, type the following commands to grant the appropriate privileges to the Asterisk user. Remember to replace freepbxdbpassword with a password of your choice and note that the password should be enclosed in single quotes.
The final installation step is to set up appropriate permissions and general configurations. To make the required configuration changes, the examples shown as follows make use of the sed command. The sed command can take a stream of input and rewrite it on the fly based on patterns listed in the command. The syntax for the following sed commands used works as follows:
The -i option tells sed to edit the input file in place, such that the listed file is changed and a new file with the requested changes is not created in its place.
The s/ tells sed that we are looking to replace a specific pattern with text of our own.
The pattern_to_find token should be replaced by the text that we are searching for. This can be a normal alphanumeric pattern, or a regular expression.
The replacement_pattern
