Generate User-Defined CEL event. More...
#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
#include "asterisk/channel.h"
#include "asterisk/cel.h"
Go to the source code of this file.
Functions | |
AST_MODULE_INFO (ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT,"Generate an User-Defined CEL event",.load=load_module,.unload=unload_module,) | |
static int | celgenuserevent_exec (struct ast_channel *chan, const char *data) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static char * | app = "CELGenUserEvent" |
Generate User-Defined CEL event.
Definition in file app_celgenuserevent.c.
AST_MODULE_INFO | ( | ASTERISK_GPL_KEY | , | |
AST_MODFLAG_DEFAULT | , | |||
"Generate an User-Defined CEL event" | , | |||
. | load = load_module , |
|||
. | unload = unload_module | |||
) |
static int celgenuserevent_exec | ( | struct ast_channel * | chan, | |
const char * | data | |||
) | [static] |
Definition at line 61 of file app_celgenuserevent.c.
References args, AST_APP_ARG, ast_cel_report_event(), AST_CEL_USER_DEFINED, AST_DECLARE_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), and parse().
Referenced by load_module().
00062 { 00063 int res = 0; 00064 char *parse; 00065 AST_DECLARE_APP_ARGS(args, 00066 AST_APP_ARG(event); 00067 AST_APP_ARG(extra); 00068 ); 00069 00070 if (ast_strlen_zero(data)) { 00071 return 0; 00072 } 00073 00074 parse = ast_strdupa(data); 00075 AST_STANDARD_APP_ARGS(args, parse); 00076 00077 ast_cel_report_event(chan, AST_CEL_USER_DEFINED, args.event, args.extra, NULL); 00078 return res; 00079 }
static int load_module | ( | void | ) | [static] |
Definition at line 87 of file app_celgenuserevent.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_application_xml, and celgenuserevent_exec().
00088 { 00089 int res = ast_register_application_xml(app, celgenuserevent_exec); 00090 if (res) { 00091 return AST_MODULE_LOAD_DECLINE; 00092 } else { 00093 return AST_MODULE_LOAD_SUCCESS; 00094 } 00095 }
static int unload_module | ( | void | ) | [static] |
Definition at line 81 of file app_celgenuserevent.c.
References ast_unregister_application().
00082 { 00083 ast_unregister_application(app); 00084 return 0; 00085 }
char* app = "CELGenUserEvent" [static] |
Definition at line 59 of file app_celgenuserevent.c.