Book Image

Asterisk Gateway Interface 1.4 and 1.6 Programming

By : Nir Simionovich
Book Image

Asterisk Gateway Interface 1.4 and 1.6 Programming

By: Nir Simionovich

Overview of this book

<p>Asterisk is the world's leading open-source PBX, telephony engine, and telephony applications toolkit with immense flexibility.<br /><br />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.<br /><br />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.<br /><br />The book takes a pragmatic approach with clear and complete examples, and a service development project &acirc;&euro;&rdquo; allowing you to understand the project cycle of developing an Asterisk-based service or application.</p>
Table of Contents (16 chapters)
Asterisk Gateway Interface 1.4 and 1.6 Programming
Credits
About the author
Acknowledgement
About the reviewers
Preface

FastAGI argument handling


Similar to AGI, FastAGI provides the ability to pass variables directly from the dialplan to the FastAGI server. However, when doing so, we must pay attention to the version of Asterisk that we are using, as variations exist between the different branches of the Asterisk project.

Asterisk 1.2.X and 1.4.X

Versions 1.2.X and 1.4.X of Asterisk handle argument passing to FastAGI server by using an HTTP GET format. Consider the following:

[callingcard-platform]
; CallingCard application
exten => _X.,1,Answer
exten => _X.,n,AGI(agi://192.168.0.1/callingcard&exten=${EXTEN}&c=12)
exten => _X.,n,Hangup

It is the responsibility of your FastAGI server to parse the information from the request, and pass the arguments to your application accordingly. Asterisk 1.2.X and 1.4.X do not provide a standard facility for passing arguments to a FastAGI server.

Asterisk 1.6.X

Asterisk 1.6.X introduced a means of passing arguments to FastAGI servers. Consider the following...