miércoles, 25 de febrero de 2009

FastAGI


Implementa el Asterisk Gateway Interface (AGI) over TCP sockets. Ayuda a aliviar la carga del CPU del server Asterisk redireccionando recursos a otro server en la Red. Para indicar al server Asterisk a realizar una coneccion de red se deberá indicar el hostname or IP address of the server donde el FastAGI service is hosted and preface it with agi://:
exten => 5551212,1,AGI(agi://192.168.0.2)
Asterisk intenta conectarse al especificado server sobre el port 4573. El port tambien puede ser especificado si se escoge el servicio AGI en otro port :

exten => 5551212,1,AGI(agi://192.168.0.2:8675)

Un request puede tambien ser especificado en la llamada FastAGI , tal que podemos tener multiples AGIs en una unica locacion de red.
This request allows the FastAGI service to differentiate between different locations in the dialplan. For example:

exten => 5551212,1,AGI(agi://192.168.0.2/GetCallerRecord)

and:

exten => 5551212,1,AGI(agi://192.168.0.2/CallerWantsCustomerService)
The request portion of these calls will be received by the FastAGI service as the agi_network_script AGI variable. Asterisk will also include the agi_network AGI variable. For example, the FastAGI in the previous example would receive something like this when called by Asterisk:

agi_network: yes
agi_network_script: /CallerWantsCustomerService

Passing Arguments to FastAGI


Asterisk 1.2 & 1.4

With Asterisk 1.2 through 1.4, when using standard AGI, you can pass variables on the command line to your local scripts. This is not possible with FastAGI, however, but can be simulated using agi_network_script and a query syntax similar to that used by HTTP. For example:

exten => 5551212,1,AGI(agi://192.168.0.2/GetCallerRecord?extension=${EXTEN})

It is the responsibility of your FastAGI framework to parse this information out of the agi_network_script variable. Some FastAGI implementations already do this for you, so be sure to check the documentation for your particular framework.

Error Handling

Asterisk 1.4 & 1.6.x

As of Asterisk 1.4 a new channel variable, AGISTATUS, is set to SUCCESS upon successful execution of an AGI. If there was a problem connecting to the FastAGI service, the channel variable is set to FAILURE, allowing the dialplan to perform alternate steps as not to interrupt the call flow. If the calling channel hangs up during execution of the AGI, AGISTATUS is set to HANGUP.

FastAGI Servers


Java


AGI enhancements

asterisk-agi-audiotx

This is an extension module for the Asterisk Gateway Interface (AGI) that adds commands to allow the transfer of audio files to and from Asterisk via the AGI session. This is useful when using FastAGI from a remote host; sounds recorded by Asterisk may be retrieved by remote FastAGI-providing service, for example, or sound files required by the remote service may be dynamically added to the Asterisk server.
This module adds the following AGI commands:
  • PUT SOUNDFILE
  • GET SOUNDFILE
  • ISEXISTING SOUNDFILE

No hay comentarios: