Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Building Telephony Systems With Asterisk (2005).pdf
Скачиваний:
45
Добавлен:
17.08.2013
Размер:
1.82 Mб
Скачать

Building Telephony Systems with Asterisk

An easy introduction to using and configuring Asterisk to build feature-rich telephony systems for small and medium businesses

David Gomillion

Barrie Dempster

BIRMINGHAM - MUMBAI

Building Telephony Systems with Asterisk

Copyright © 2005 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 authors, Packt Publishing, nor its dealers or 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 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: September 2005

First reprint: February 2006

Production Reference: 1010206

Published by Packt Publishing Ltd. 32 Lincoln Road

Olton

Birmingham, B27 6PA, UK. ISBN 1-904811-15-9

www.packtpub.com

Cover Design by www.visionwt.com

Credits

Authors

Development Editor

David Gomillion

Louay Fatoohi

Barrie Dempster

 

 

Indexer

Reviewers

Niranjan Jahagirdar

Rob Clews

 

Barrie Dempster

Proofreader

Alex Epshteyn

Chris Smith

David Gomillion

 

Jan Kolasinski

Production Coordinator

 

Manjiri Nadkarni

Technical Editors

 

Richard Deeson

Cover Designer

Niranjan Jahagirdar

Helen Wood

Editorial Manager

 

Dipali Chittar

 

About the Reviewers

Alex Epshteyn is the developer of Asterisk PBX Manager (a Webmin module for Asterisk) and the founding principal of Third Lane Technologies, LLC, a company specializing in VoIP software development and Asterisk consulting.

Rob Clews' first affair with a computer was with a Dragon 64. Since then he has become an avid developer and supporter of open-source software. Meeting Jan, he has founded Bluetel Solutions where he can stretch technologies to their limits and find the most efficient way to write and architect code to achieve the best results.

In what seems like a past life, Jan Kolasinski was a publisher for Wrox Press leading its Professional team. Since then he has been helping a number of small and medium sized companies apply technologies. In order to formalize this he has founded, with Rob, Bluetel Solutions where he tries to find new ways to help clients achieve better return on investments. Rob is the second reviewer.

About the Authors

Barrie Dempster was a Network Administrator/IT Manager for a growing call center when he saw the convergence and dependence of telephony and IT-related fields on each other. He focused on integration of telephony with IT infrastructure, and took on security as a career. The increase of voice-over-IP communications has now led to high demand for these skills, which he now utilizes in his current position as a Scotland-based Infrastructure and Security consultant for a variety of clients primarily within the financial sector.

He has been involved in varied projects, from building and deploying web and database servers to creating custom communication and conferencing systems, most of which are secured highly in order to survive public networks. He has deployed and used a variety of PBX systems and, as a strong supporter and user of free and open-source software, has a serious interest in Asterisk as it combines all of these interests into one extremely powerful package.

David Gomillion currently serves as Director of Information Technology for the Eye Center of North Florida. There, he orchestrates all of the technological undertakings of this four-location medical practice, including computers, software (off-the-shelf and custom development), server systems, telephony, networking, as well as specialized diagnostic and treatment systems.

David received a Bachelor's of Science in Computer Science from Brigham Young University in August, 2005. There he learned the theory behind his computer experience, and became a much more efficient programmer.

David has worked actively in the Information Technology sector since his freshman year at BYU. He has been a Networking Assistant, an Assistant Network Administrator, a Supervisor of a large Network and Server Operations unit, a Network Administrator, and finally a Director of Information Technology.

Through his increasing responsibilities, he has learned to prioritize needs and wants, and applies this ability to his Asterisk installations.

Table of Contents

Introduction

1

Chapter 1: Introduction to Asterisk

5

What is Asterisk?

5

Asterisk is a PBX

5

Station-To-Station Calls

6

Line Trunking

6

Telco Features

7

Advanced Call Distribution

7

Call Detail Records

7

Call Recording

8

Asterisk is an IVR System

8

Asterisk is a Voicemail System

8

Asterisk is a Voice over IP (VoIP) System

9

What Asterisk Isn't

11

Asterisk is Not an Off-the-Shelf Phone System

11

Asterisk is Not a SIP Proxy

11

Asterisk Does Not Run on Windows

12

Is Asterisk a Good Fit for Me?

12

Trade-Offs

12

Flexibility versus Ease of Use

12

Graphical versus Configuration File Management

13

Calculating Total Cost of Ownership

14

Return on Investment

15

Summary

15

Chapter 2: Making a Plan for Deployment

17

The Public Switched Telephony Network (PSTN)

17

Connection Methods

17

Plain Old Telephone Service (POTS) Line

17

Integrated Services Digital Network (ISDN)

18

T1 or E1

18

Voice over IP Connections

19

Determining Our Needs

20

Table of Contents

Terminal Equipment

21

Types of Terminal Devices

21

Hard Phones

21

Soft Phones

23

Communications Devices

24

Another PBX

25

Choosing a Device

25

Features, Features, and More Features…

25

Determining True Cost

26

Compatibility with Asterisk

27

Sound Quality Analysis

27

Usability Issues

28

Recording Decisions

28

How Much Hardware do I Need?

28

Choosing the Extension Length

29

Summary

32

Chapter 3: Installing Asterisk

33

Preparing to Install Asterisk

33

Obtaining the Source Files

34

Installing Zaptel

35

Installing libpri

35

Installing Asterisk

36

Getting to Know Asterisk

39

Summary

41

Chapter 4: Configuring Asterisk

43

Zaptel Interfaces

44

zaptel.conf

44

Lines

45

Terminals

48

zapata.conf

48

Lines

52

Terminals

53

SIP Interfaces

54

IAX Interfaces

59

Voicemail

61

Music On Hold

63

Queues

64

ii

 

 

Table of Contents

 

Conference Rooms

66

 

 

Summary

67

 

 

Chapter 5: Creating a Dialplan

69

 

Creating a Context

69

 

 

Creating an Extension

71

 

Creating Outgoing Extensions

75

 

Advanced Call Distribution

78

 

 

Call Queues

78

 

 

Call Parking

82

 

 

Direct Inward Dialing (DID)

83

 

 

Automated Attendants

84

 

 

System Services

87

 

 

Summary

89

 

 

Chapter 6: Quality Assurance

91

 

Call Detail Records

91

 

 

Flat-File CDR Logging

92

 

 

Database CDR Logging

93

 

 

Monitoring Calls

95

 

 

Recording Calls

96

 

 

Legal Concerns

97

 

 

Summary

98

 

 

Chapter 7: Asterisk@Home

99

 

 

CentOS

99

 

 

Preparation and Installation

100

 

The Asterisk Management Portal (AMP)

101

 

Maintenance

103

 

Setup

104

 

Flash Operator Panel (FOP)

105

 

Flash Operator Configuration Files

106

 

 

Web MeetMe

106

 

 

Flexibility When Needed

106

 

 

A Simple One-to-One PBX

107

 

Extensions

107

 

 

Trunks

108

 

 

Routes

108

 

iii

Table of Contents

Customer Relationship Management/SugarCRM

110

Adding Contacts

111

Call Scheduling

111

Administration of SugarCRM

112

Configure Settings

112

User Management

112

User Roles

113

Summary

114

Chapter 8: Case Studies

115

Small Office/Home Office

115

The Scenario

115

The Discussion

116

The Configuration

116

zaptel.conf

116

zapata.conf

117

musiconhold.conf

117

voicemail.conf

118

modules.conf

118

extensions.conf

119

Conclusions

119

Small Business

120

The Scenario

120

The Discussion

120

The Configuration

121

zaptel.conf

121

zapata.conf

121

musiconhold.conf

122

agents.conf

122

queues.conf

122

sip.conf

123

meetme.conf

124

voicemail.conf

124

extensions.conf

125

Conclusions

128

Hosted PBX

128

The Scenario

129

The Discussion

129

iv

 

 

Table of Contents

 

The Configuration

129

 

 

zaptel.conf

129

 

 

zapata.conf

130

 

 

musiconhold.conf

130

 

 

sip.conf

130

 

 

voicemail.conf

131

 

 

extensions.conf

131

 

 

Conclusions

134

 

 

Summary

134

 

 

Chapter 9: Maintenance and Security

135

 

Backup and System Maintenance

135

 

 

Backing Up Configurations

136

 

 

Backing Up Voice Data

138

 

 

Backing Up Log Files

139

 

 

Backup Scripts

139

 

 

Time Synchronization

142

 

 

Adding It All to cron

142

 

 

Rebuilding and Restoring the Asterisk Server

143

 

 

Disaster Recovery Plan (DRP)

143

 

Asterisk Server Security

144

 

 

Internal Access Control

144

 

 

Host Security Hardening for Asterisk

147

 

 

Integrity Checker

147

 

 

Root-Kit Detection

147

 

 

Automated Hardening

148

 

 

Role Based Access Control (RBAC)

148

 

Network Security for Asterisk

149

 

 

Firewalling the Asterisk Protocols

149

 

 

SIP (Session Initiation Protocol)

150

 

 

H.323

150

 

 

IAX

151

 

 

RTP—The Real-Time Transport Protocol

151

 

Controlling Administration of Asterisk

151

 

 

Asterisk Scalability

152

 

 

Load Balancing with DNS

153

 

v

Table of Contents

Support Channels for Asterisk

154

Mailing Lists

155

Forums

155

IRC (Internet Relay Chat)

155

Digium

156

Summary

156

Index

157

vi