Asterisk.org: Developer Documentation (28 Oct 2009)

Wed Oct 28 15:47:47 2009

## Asterisk developer's documentation

# agi.h

Go to the documentation of this file.

    00001 /*
    00002  * Asterisk -- An open source telephony toolkit.
    00003  *
    00004  * Copyright (C) 1999 - 2005, Digium, Inc.
    00005  *
    00006  * Mark Spencer <markster@digium.com>
    00007  *
    00008  * See http://www.asterisk.org for more information about
    00009  * the Asterisk project. Please do not directly contact
    00010  * any of the maintainers of this project for assistance;
    00011  * the project provides a web site, mailing lists and IRC
    00012  * channels for your use.
    00013  *
    00014  * This program is free software, distributed under the terms of
    00015  * the GNU General Public License Version 2. See the LICENSE file
    00016  * at the top of the source tree.
    00017  */
    00018
    00019 /*! \file
    00020  * \brief AGI Extension interfaces - Asterisk Gateway Interface
    00021  */
    00022
    00023 #ifndef _ASTERISK_AGI_H
    00024 #define _ASTERISK_AGI_H
    00025
    00026 #if defined(__cplusplus) || defined(c_plusplus)
    00027 extern "C" {
    00028 #endif
    00029
    00030 typedef struct agi_state {
    00031    int fd;     /* FD for general output */
    00032    int audio;  /* FD for audio output */
    00033    int ctrl;   /* FD for input control */
    00034 } AGI;
    00035
    00036 typedef struct agi_command {
    00037    /* Null terminated list of the words of the command */
    00038    char *cmda[AST_MAX_CMD_LEN];
    00039    /* Handler for the command (channel, AGI state, # of arguments, argument list).
    00040        Returns RESULT_SHOWUSAGE for improper arguments */
    00041    int (*handler)(struct ast_channel *chan, AGI *agi, int argc, char *argv[]);
    00042    /* Summary of the command (< 60 characters) */
    00043    char *summary;
    00044    /* Detailed usage information */
    00045    char *usage;
    00046    struct agi_command *next;
    00047 } agi_command;
    00048
    00049 int agi_register(agi_command *cmd);
    00050 void agi_unregister(agi_command *cmd);
    00051
    00052 #if defined(__cplusplus) || defined(c_plusplus)
    00053 }
    00054 #endif
    00055
    00056 #endif /* _ASTERISK_AGI_H */