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 1671 of file res_agi.c.
References ast_log(), agi_command::cmda, commands, LOG_WARNING, and MAX_COMMANDS.
01672 { 01673 int x; 01674 for (x=0; x<MAX_COMMANDS - 1; x++) { 01675 if (commands[x].cmda[0] == agi->cmda[0]) { 01676 ast_log(LOG_WARNING, "Command already registered!\n"); 01677 return -1; 01678 } 01679 } 01680 for (x=0; x<MAX_COMMANDS - 1; x++) { 01681 if (!commands[x].cmda[0]) { 01682 commands[x] = *agi; 01683 return 0; 01684 } 01685 } 01686 ast_log(LOG_WARNING, "No more room for new commands!\n"); 01687 return -1; 01688 }
void ast_agi_unregister | ( | agi_command * | cmd | ) |
Definition at line 1690 of file res_agi.c.
References agi_command::cmda, and commands.
01691 { 01692 int x; 01693 for (x=0; x<MAX_COMMANDS - 1; x++) { 01694 if (commands[x].cmda[0] == agi->cmda[0]) { 01695 memset(&commands[x], 0, sizeof(agi_command)); 01696 } 01697 } 01698 }