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 1731 of file res_agi.c.
References ast_log(), agi_command::cmda, commands, LOG_WARNING, and MAX_COMMANDS.
01732 { 01733 int x; 01734 for (x=0; x<MAX_COMMANDS - 1; x++) { 01735 if (commands[x].cmda[0] == agi->cmda[0]) { 01736 ast_log(LOG_WARNING, "Command already registered!\n"); 01737 return -1; 01738 } 01739 } 01740 for (x=0; x<MAX_COMMANDS - 1; x++) { 01741 if (!commands[x].cmda[0]) { 01742 commands[x] = *agi; 01743 return 0; 01744 } 01745 } 01746 ast_log(LOG_WARNING, "No more room for new commands!\n"); 01747 return -1; 01748 }
void ast_agi_unregister | ( | agi_command * | cmd | ) |
Definition at line 1750 of file res_agi.c.
References agi_command::cmda, commands, and MAX_COMMANDS.
01751 { 01752 int x; 01753 for (x=0; x<MAX_COMMANDS - 1; x++) { 01754 if (commands[x].cmda[0] == agi->cmda[0]) { 01755 memset(&commands[x], 0, sizeof(agi_command)); 01756 } 01757 } 01758 }