EAGI()

Ruft eine AGI-konforme Anwendung auf

EAGI(Programm[,Argumente])

(Analog auch AGI(), FastAGI(), DeadAGI())

Führt ein Asterisk-Gateway-Interface-kompatibles Programm Programm auf dem aktuellen Channel aus. Solche externen Programme (die in fast jeder beliebigen Sprache vorliegen können - z.B. Perl, PHP, ...), können den Telefonkanal steuern, Audiodateien abspielen, DTMF-Ziffern auslesen und so weiter. Asterisk kommuniziert dabei mit dem AGI-Program über STDIN und STDOUT. Die spezifizierten Argumente werden an das AGI-Programm durchgereicht.

Das Programm muss im zugrundeliegenden Dateisystem als executable (ausführbar) gekennzeichnet sein. Der Pfad zum Programm ist relativ zum Asterisk-AGI-Verzeichnis, standardmäßig /var/lib/asterisk/agi-bin/.

EAGI() bietet im Gegensatz zu den anderen AGI() Befehlen Zugriff auf den eingehenden Audiostream. Das eingehende Audio-Signal kann dann unter File Descriptor 3[55] eingelesen werden.

Liefert -1 mit dem Auflegen oder falls ein Auflegen durch das Programm verlangt wurde oder 0, falls nicht aufgelegt werden soll.

; mein AGI-Skript aufrufen:
exten => 123,1,AGI(agi-skript)
exten => 123,n,EAGI(eagi-skript)
[Anmerkung]Anmerkung

Interner Hilfetext zu dieser Applikation in Asterisk 1.4: 

  -= Info about application 'EAGI' =- 

[Synopsis]
Executes an EAGI compliant application

[Description]
  [E|Dead]AGI(command|args): Executes an Asterisk Gateway Interface compliant
program on a channel. AGI allows Asterisk to launch external programs
written in any language to control a telephony channel, play audio,
read DTMF digits, etc. by communicating with the AGI protocol on stdin
and stdout.
  This channel will stop dialplan execution on hangup inside of this
application, except when using DeadAGI.  Otherwise, dialplan execution
will continue normally.
  A locally executed AGI script will receive SIGHUP on hangup from the channel
except when using DeadAGI. This can be disabled by setting the AGISIGHUP channel
variable to "no" before executing the AGI application.
  Using 'EAGI' provides enhanced AGI, with incoming audio available out of band
on file descriptor 3

  Use the CLI command 'agi show' to list available agi commands
  This application sets the following channel variable upon completion:
     AGISTATUS      The status of the attempt to the run the AGI script
                    text string, one of SUCCESS | FAILED | HANGUP

Differenz zum internen Hilfetext in Asterisk 1.2: 

13,19c13,15
<   This channel will stop dialplan execution on hangup inside of this
< application, except when using DeadAGI.  Otherwise, dialplan execution
< will continue normally.
<   A locally executed AGI script will receive SIGHUP on hangup from the channel
< except when using DeadAGI. This can be disabled by setting the AGISIGHUP channel
< variable to "no" before executing the AGI application.
<   Using 'EAGI' provides enhanced AGI, with incoming audio available out of band
---
> Returns -1 on hangup (except for DeadAGI) or if application requested
>  hangup, or 0 on non-hangup exit. 
> Using 'EAGI' provides enhanced AGI, with incoming audio available out of band
22,25c18
<   Use the CLI command 'agi show' to list available agi commands
<   This application sets the following channel variable upon completion:
<      AGISTATUS      The status of the attempt to the run the AGI script
<                     text string, one of SUCCESS | FAILED | HANGUP
---
> Use the CLI command 'show agi' to list available agi commands

Siehe. AGI().



[55] zu Erinnerung: 0: stdin, 1: stdout, 2:stderr. 3 ist ein frei definierter File descriptor


Version 1.2, November 2002

Neue Version verfügbar

Sie betrachten gerade die alte Version des Buches (Version 1.0). Wir empfehlen Ihnen für Asterisk 1.4 und 1.6 die neue Version des Buches.

Asterisk-Tag 2008

Lernen Sie Mark Spencer (den Erfinder von Asterisk) kennen! Viele Vorträge, Case-Studies und Workshops rund um das Thema VoIP. Asterisk-Tag.org

Das gedruckte Buch