Wed Jan 27 20:02:17 2016

Asterisk developer's documentation


agi.h File Reference

AGI Extension interfaces - Asterisk Gateway Interface. More...

#include "asterisk/cli.h"
#include "asterisk/xmldoc.h"
#include "asterisk/optional_api.h"

Go to the source code of this file.

Data Structures

struct  agi_command
struct  agi_state

Typedefs

typedef struct agi_state AGI

Functions

 AST_OPTIONAL_API (int, ast_agi_unregister_multiple,(struct ast_module *mod, struct agi_command *cmd, unsigned int len),{return AST_OPTIONAL_API_UNAVAILABLE;})
 Unregisters a group of AGI commands, provided as an array of struct agi_command entries.
 AST_OPTIONAL_API (int, ast_agi_register_multiple,(struct ast_module *mod, struct agi_command *cmd, unsigned int len),{return AST_OPTIONAL_API_UNAVAILABLE;})
 Registers a group of AGI commands, provided as an array of struct agi_command entries.
 AST_OPTIONAL_API (int, ast_agi_unregister,(struct ast_module *mod, agi_command *cmd),{return AST_OPTIONAL_API_UNAVAILABLE;})
 Unregisters an AGI command.
 AST_OPTIONAL_API (int, ast_agi_register,(struct ast_module *mod, agi_command *cmd),{return AST_OPTIONAL_API_UNAVAILABLE;})
 Registers an AGI command.
 AST_OPTIONAL_API_ATTR (int, format(printf, 3, 4), ast_agi_send,(int fd, struct ast_channel *chan, char *fmt,...),{return AST_OPTIONAL_API_UNAVAILABLE;})
 Sends a string of text to an application connected via AGI.

Detailed Description

AGI Extension interfaces - Asterisk Gateway Interface.

Definition in file agi.h.


Typedef Documentation

typedef struct agi_state AGI

Function Documentation

AST_OPTIONAL_API ( int  ,
ast_agi_unregister_multiple  ,
(struct ast_module *mod, struct agi_command *cmd, unsigned int len)   
)

Unregisters a group of AGI commands, provided as an array of struct agi_command entries.

Parameters:
mod Pointer to the module_info structure for the module that is unregistering the commands
cmd Pointer to the first entry in the array of command descriptors
len Length of the array (use the ARRAY_LEN macro to determine this easily)
Returns:
0 on success, -1 on failure, AST_OPTIONAL_API_UNAVAILABLE if res_agi is not loaded
Note:
If any command fails to unregister, this function will continue to unregister the remaining commands in the array; it will not reregister the already-unregistered commands.
AST_OPTIONAL_API ( int  ,
ast_agi_register_multiple  ,
(struct ast_module *mod, struct agi_command *cmd, unsigned int len)   
)

Registers a group of AGI commands, provided as an array of struct agi_command entries.

Parameters:
mod Pointer to the module_info structure for the module that is registering the commands
cmd Pointer to the first entry in the array of command descriptors
len Length of the array (use the ARRAY_LEN macro to determine this easily)
Returns:
0 on success, -1 on failure, AST_OPTIONAL_API_UNAVAILABLE if res_agi is not loaded
Note:
If any command fails to register, all commands previously registered during the operation will be unregistered. In other words, this function registers all the provided commands, or none of them.
AST_OPTIONAL_API ( int  ,
ast_agi_unregister  ,
(struct ast_module *mod, agi_command *cmd)   
)

Unregisters an AGI command.

Parameters:
mod Pointer to the module_info structure for the module that is unregistering the command
cmd Pointer to the descriptor for the command
Returns:
1 on success, 0 if the command was not already registered
AST_OPTIONAL_API ( int  ,
ast_agi_register  ,
(struct ast_module *mod, agi_command *cmd)   
)

Registers an AGI command.

Parameters:
mod Pointer to the module_info structure for the module that is registering the command
cmd Pointer to the descriptor for the command
Return values:
1 on success
0 the command is already registered
AST_OPTIONAL_API_UNAVAILABLE the module is not loaded.
AST_OPTIONAL_API_ATTR ( int  ,
format(printf, 3, 4)  ,
ast_agi_send  ,
(int fd, struct ast_channel *chan, char *fmt,...)   
)

Sends a string of text to an application connected via AGI.

Parameters:
fd The file descriptor for the AGI session (from struct agi_state)
chan Pointer to an associated Asterisk channel, if any
fmt printf-style format string
Returns:
0 for success, -1 for failure, AST_OPTIONAL_API_UNAVAILABLE if res_agi is not loaded

Generated on 27 Jan 2016 for Asterisk - The Open Source Telephony Project by  doxygen 1.6.1