Asterisk Source/Command Line Interface
AsteriskSource/CommandLineInterface ¶* version 0.2.0
struct ast_cli_entry {
/*! Null terminated list of the words of the command */
char *cmda[AST_MAX_CMD_LEN];
/*! Handler for the command (fd for output, # of arguments, argument list). Returns RESULT_SHOWUSAGE for improper arguments */
int (*handler)(int fd, int argc, char *argv[]);
/*! Summary of the command (< 60 characters) */
char *summary;
/*! Detailed usage information */
char *usage;
/*! Generate a list of possible completions for a given word */
char *(*generator)(char *line, char *word, int pos, int state);
/*! For linking */
struct ast_cli_entry *next;
/*! For keeping track of usage */
int inuse;
};
* int main(int argc, char *argv[])
* static void consolehandler(char *s)
static struct ast_cli_entry aborthalt = { { "abort", "halt", NULL }, handle_abort_halt, "Cancel a running halt", abort_halt_help };
* ast_cli_register ¿¡ ÀÇÇØ static À¸·Î ¼³Á¤µÈ ast_cli_entry ¸¦ linked list ¿¡ ³Ö´Â´Ù.
* linked list ¿¡¼ ÇØ´çÇÏ´Â ast_cli_entry ¸¦ ã¾Æ handler ¸¦ ¼öÇàÇÑ´Ù.
* handler ´Â Çʿ信 µû¶ó °¢ channel, °¢ application µî¿¡¼ ¼³Á¤ÇÑ´Ù.
|











