Wed Jan 8 2020 09:49:53

Asterisk developer's documentation


app_celgenuserevent.c File Reference

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

static void __reg_module (void)
 
static void __unreg_module (void)
 
static int celgenuserevent_exec (struct ast_channel *chan, const char *data)
 
static int load_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Generate an User-Defined CEL event" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, }
 
static char * app = "CELGenUserEvent"
 
static struct ast_module_infoast_module_info = &__mod_info
 

Detailed Description

Generate User-Defined CEL event.

Author
Steve Murphy

Definition in file app_celgenuserevent.c.

Function Documentation

static void __reg_module ( void  )
static

Definition at line 100 of file app_celgenuserevent.c.

static void __unreg_module ( void  )
static

Definition at line 100 of file app_celgenuserevent.c.

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().

62 {
63  int res = 0;
64  char *parse;
66  AST_APP_ARG(event);
67  AST_APP_ARG(extra);
68  );
69 
70  if (ast_strlen_zero(data)) {
71  return 0;
72  }
73 
74  parse = ast_strdupa(data);
76 
77  ast_cel_report_event(chan, AST_CEL_USER_DEFINED, args.event, args.extra, NULL);
78  return res;
79 }
int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event_type, const char *userdefevname, const char *extra, struct ast_channel *peer2)
Report a channel event.
Definition: cel.c:645
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Definition: app.h:572
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:63
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: utils.h:663
static struct @350 args
static void parse(struct mgcp_request *req)
Definition: chan_mgcp.c:1858
a user-defined event, the event name field should be set
Definition: cel.h:90
#define AST_APP_ARG(name)
Define an application argument.
Definition: app.h:555
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Definition: app.h:604
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().

88 {
90  if (res) {
92  } else {
94  }
95 }
static int celgenuserevent_exec(struct ast_channel *chan, const char *data)
static char * app
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Definition: module.h:437
static int unload_module ( void  )
static

Definition at line 81 of file app_celgenuserevent.c.

References ast_unregister_application().

82 {
84  return 0;
85 }
int ast_unregister_application(const char *app)
Unregister an application.
Definition: pbx.c:7705
static char * app

Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Generate an User-Defined CEL event" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, }
static

Definition at line 100 of file app_celgenuserevent.c.

char* app = "CELGenUserEvent"
static

Definition at line 59 of file app_celgenuserevent.c.

Definition at line 100 of file app_celgenuserevent.c.