This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | agi_command |
struct | agi_state |
Typedefs | |
typedef agi_state | AGI |
Functions | |
int | ast_agi_register (agi_command *cmd) |
void | ast_agi_unregister (agi_command *cmd) |
Definition in file agi.h.
int ast_agi_register | ( | agi_command * | cmd | ) |
Definition at line 1685 of file res_agi.c.
References ast_log(), agi_command::cmda, commands, LOG_WARNING, and MAX_COMMANDS.
01686 { 01687 int x; 01688 for (x=0; x<MAX_COMMANDS - 1; x++) { 01689 if (commands[x].cmda[0] == agi->cmda[0]) { 01690 ast_log(LOG_WARNING, "Command already registered!\n"); 01691 return -1; 01692 } 01693 } 01694 for (x=0; x<MAX_COMMANDS - 1; x++) { 01695 if (!commands[x].cmda[0]) { 01696 commands[x] = *agi; 01697 return 0; 01698 } 01699 } 01700 ast_log(LOG_WARNING, "No more room for new commands!\n"); 01701 return -1; 01702 }
void ast_agi_unregister | ( | agi_command * | cmd | ) |
Definition at line 1704 of file res_agi.c.
References agi_command::cmda, and commands.
01705 { 01706 int x; 01707 for (x=0; x<MAX_COMMANDS - 1; x++) { 01708 if (commands[x].cmda[0] == agi->cmda[0]) { 01709 memset(&commands[x], 0, sizeof(agi_command)); 01710 } 01711 } 01712 }