Free Sample
+ Collection

Asterisk Gateway Interface 1.4 and 1.6 Programming

Nir Simionovich

Design and develop Asterisk-based VoIP telephony platforms and services using PHP and PHPAGI
RRP $23.99
RRP $39.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781847194466
Paperback220 pages

About This Book

  • Develop voice-enabled applications utilizing the collective power of Asterisk, PHP, and the PHPAGI class library
  • Learn basic elements of a FastAGI server utilizing PHP and PHPAGI
  • Develop new Voice 2.0 mash ups using the Asterisk Manager
  • Add Asterisk application development skills to your development arsenal, enriching your market offering and experience
  • Up to date for Asterisk version 1.6 and covers all previous versions

Who This Book Is For

This book is intended for developers wishing to utilize Asterisk, system administrators wishing to gain better control over their Asterisk installation, and telephony service providers wishing to deploy Asterisk-based solutions to their infrastructure. You are expected to have some experience with Asterisk and a basic understanding of programming. No knowledge of Asterisk programming is required.

Table of Contents

Chapter 1: Installing a 'Vanilla' Asterisk
Downloading Asterisk
Zaptel—Zapata Telephony Driver
DAHDI—Digium Asterisk Hardware Device Interface
Libpri—ISDN PRI Library
Asterisk—the open source PBX
Asterisk-addons—the open source PBX
Asterisk—SVN source packages
Compiling the source code
Chapter 2: Basic IVR Development: Using the Asterisk DialPlan
The dialplan is a set of "finite state machines"
The dialplan syntax
Chapter 3: More IVR Development: Input, Recordings, and Call Control
Grabbing and processing user input
Chapter 4: A Primer to AGI: Asterisk Gateway Interface
How does AGI work?
The ten rules of AGI development
A preface to what's coming ahead
Chapter 5: AGI Scripting with PHP
The php.ini configuration file
AGI script permissions
The structure of a PHP based AGI script
Communication between Asterisk and AGI
The AGI Hello-World program
AGI debugging
Chapter 6: PHPAGI: An AGI Class Library in PHP
Obtaining PHPAGI
The file structure of PHPAGI
A very simple PHPAGI example
The AGI/Dialplan high-wire act
A slightly more complex PHPAGI example
AGI Scripts in popular Asterisk applications
Chapter 7: FastAGI: AGI as a TCP Server
FastAGI argument handling
FastAGI error handling
FastAGI with PHPAGI and xinetd
FastAGI with PHPAGI and Google
FastAGI with other tool kits
Chapter 8: AMI: The Asterisk Manager Interface
AMI—the history
AMI—understanding basics
PHPAGI and the AMI Interface
Click-2-Call and Web-Callback
Chapter 9: Final Programming Project
ACRG—Asterisk Call Recording Gateway
Project implementation guide
Additional programming projects
Chapter 10: Scaling Asterisk Applications
Scaling Asterisk platforms

What You Will Learn

  • Create AGI applications with Asterisk easily using PHPAGI, a PHP class library
  • Avoid going through the normal pitfalls of novice developers when developing Asterisk-based applications and services for the first time
  • Develop AGI scripts and FastAGI servers using Asterisk-PERL modules
  • Configure your AMI login information in the phpagi.conf file in order to utilize the AMI interface with PHPAGI
  • Understand the Asterisk Manager Interface and its utilization in Asterisk applications
  • Develop full web-based call-back platforms and highly interactive IVR applications using PHP and PHPAGI
  • Learn proper development paradigms to easily scale your services and applications
  • Get ideas for various Asterisk-based services and applications that you can create

In Detail

Asterisk is the world's leading open-source PBX, telephony engine, and telephony applications toolkit with immense flexibility.

This book will give you a firm understanding of Asterisk Gateway Interface (AGI) development and proper AGI development practices. You will learn how to formulate Atomic AGI-enabled scripts, enabling rapid development within a well-defined Asterisk execution and runtime environment.

This book builds from the simplest form of an Asterisk application, the dialplan-based application, gradually building a full understanding of AGI scripting. The book also introduces a new concept of AGI development named "Atomic AGI" or "Particle Programming". It will introduce you to various techniques of interacting with the user, where user interaction isn't limited to keypad-based input, but also includes recording messages from the user, sending output to the user, and controlling the call flow.

The book takes a pragmatic approach with clear and complete examples, and a service development project — allowing you to understand the project cycle of developing an Asterisk-based service or application.


Read More