The XAGI feature.
[asterisk-bristuff.git] / include / asterisk / agi.h
blobc0849aff6f9a00f9a8463bf2035b12d05a42ab65
1 /*
2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
19 /*! \file
20 * \brief AGI Extension interfaces - Asterisk Gateway Interface
23 #ifndef _ASTERISK_AGI_H
24 #define _ASTERISK_AGI_H
26 #if defined(__cplusplus) || defined(c_plusplus)
27 extern "C" {
28 #endif
30 typedef struct agi_state {
31 int fd; /* FD for general output */
32 int audio; /* FD for audio output */
33 int audio_in; /* FD for audio output */
34 int ctrl; /* FD for input control */
35 unsigned int fast:1; /* flag for fast agi or not */
36 } AGI;
38 typedef struct agi_command {
39 /* Null terminated list of the words of the command */
40 char *cmda[AST_MAX_CMD_LEN];
41 /* Handler for the command (channel, AGI state, # of arguments, argument list).
42 Returns RESULT_SHOWUSAGE for improper arguments */
43 int (*handler)(struct ast_channel *chan, AGI *agi, int argc, char *argv[]);
44 /* Summary of the command (< 60 characters) */
45 char *summary;
46 /* Detailed usage information */
47 char *usage;
48 struct agi_command *next;
49 } agi_command;
51 int ast_agi_register(agi_command *cmd);
52 void ast_agi_unregister(agi_command *cmd);
54 #if defined(__cplusplus) || defined(c_plusplus)
56 #endif
58 #endif /* _ASTERISK_AGI_H */