login | register
Tue 02 of Dec, 2008 [02:56 UTC]

voip-info.org

Discuss [0] History

Asterisk EAGI

Created by: dantheman,Last modification on Thu 01 of Nov, 2007 [18:59 UTC] by balsamcn

Synopsis:

 Executes an AGI compliant application, with file descriptors

Description:

 EAGI(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.

Variables Passed

  • AST_CONFIG_DIR
  • AST_CONFIG_FILE
  • AST_MODULE_DIR
  • AST_SPOOL_DIR
  • AST_MONITOR_DIR
  • AST_VAR_DIR
  • AST_DATA_DIR
  • AST_LOG_DIR
  • AST_AGI_DIR
  • AST_KEY_DIR
  • AST_RUN_DIR

Return codes

Returns -1 on hangup or if application requested hangup, or 0 on non-hangup exit.

Requirements for applications

  • must be executable
  • must be located in /var/lib/asterisk/agi-bin
  • must be specified in the dialplan complete with an extension

EAGI File descriptors

  • 1 (STDIN) = fromast pipe: sends data out of asterisk
  • 1 (STDOUT) = toast pipe: sends data into asterisk
  • 3 (STDERR+1) = audio pipe: Linear pcm audio pipe


See Also



Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ


Comments