Assembla home | Assembla project page
 

FastAGI Server

Build, Configure and Run

For instructions on how to build, configure and running fast_agi see

BuildConfigRun

Usage

Asterisk callplan, exten.conf

Fast_agi is used in the Asterisk call-plan by the AGI application.

exten => 123,1 Agi(agi://Host:Port/Path)

Where Host is the Hostname or IP address of the fast_agi server Port is the port the fast_agi server is listening on The interpretation of path is not defined by Asterisk but is open to the fast_agi server to interpret as it wishes.

Erlang agi script

In the erlang fast_agi server the Path has to be given in the format Module/Function. This function must be of arity 2.

exten => 123,1 Agi(agi://Host:Port/myMod/myFun)

will lead to a call to the erlang function

myMod:myFun(Params,Connection)

Params = Variables passed by Asterisk, accessed by fast_agi:get_var(Var,Params) Connection = #connection record, see include/fast_agi.hrl

When calling a fast_agi script Asterisk sends the values of all variables defined in the call context, plus some fast_agi specific variables.

The erlang fast_agi script can control the call processing in Asterisk by calling the functions in fast_agi.