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 등에서 설정한다.
|
True happiness will be found only in true love. |