AGI,
also known as Asterisk Gateway Interface is an Asterisk-based
language-independent scripting that can be utilized to develop an API
for call processing. It provides a standard interface that enables
external programs to control the Asterisk dialplan. It permits
programmers to write simple programs to manipulate and route calls on
Asterisk servers in a simple and lucid manner.
AGI
script communicates with Asterisk with the file handles like STDIN
(Standard Input), STDOUT (Standard Output),and STDERR (Standard
Error). As per AGI script, any input coming in from Asterisk would be
considered STDIN, while output to Asterisk would be considered as
STDOUT.
As
the AGI scripting service is language independent, it enables
programming with any programming language of your choice namely PERL,
PHP, Pascal, Bourne Shell or even C/C++ scripting.
Depending
upon their usage, AGI has 4 variants that are different from each
other. They are listed as:
-
Standard AGI: It is the simplest and widely used form of AGI that runs on local PBX and communicate with Asterisk through socket descriptors. It allows usage of all simplex AGI commands.
-
Enhanced AGI: EAGI is an advanced version of AGI scripting that allows the file descriptors on the local machine using STDIN and STDOUT. However, the function is seldom used but it gives the developer the way to analyze raw data. It enables the developer to access audio channels directly for calls being processed. Substantially, EAGI can be used to create applications that can tap into an inbound audio stream, analyze it, and perform tasks in accordance with that stream of data.
-
Dead AGI: Another simplified version of AGI that enables Asterisk to run after the call is known as the Dead AGI. The invocation is similar to the regular AGI script that works to reduce the hangup error.
-
Fast AGI: AGI developed over TCP protocol is provided as a solution to developers who need to run resource-intensive AGI programs. Technically, the resources necessary for the AGI script to run are devoured by a completely different process, and not Asterisk. The Asterisk server itself can process calls deploying the TCP socket, which were previously based on standard input/ output communications.
Once
an AGI script has been invoked, a preset information flow is swiftly
performed between the AGI script and Asterisk. AGI scripting is one
of the most compelling reasons to choose Asterisk over a closed,
proprietary PBX. You can get the premium AGI scripting services at
AsteriskService
to
meet your business communication requirements.
Source: https://ivrsystemdesign.wordpress.com/2017/12/29/types-of-asterisk-based-agi-scripting-service/









