Asterisk - The Open Source Telephony Project GIT-master-80b953f
Loading...
Searching...
No Matches
Functions
getters_cel.c File Reference

CEL Getters. More...

#include "cdrel.h"
#include "asterisk/cel.h"
Include dependency graph for getters_cel.c:

Go to the source code of this file.

Functions

static int cel_get_event_enum (void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
 
static int cel_get_event_type (void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
 
static int cel_get_literal (void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
 
static int cel_get_string (void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
 
static int cel_get_timeval (void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
 
static int cel_get_uint32 (void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
 
static struct ast_channeldummy_chan_alloc_cel (struct cdrel_config *config, void *data)
 
int load_cel (void)
 

Detailed Description

CEL Getters.

Author
George Joseph gjose.nosp@m.ph@s.nosp@m.angom.nosp@m.a.co.nosp@m.m

Definition in file getters_cel.c.

Function Documentation

◆ cel_get_event_enum()

static int cel_get_event_enum ( void *  record,
struct cdrel_config config,
struct cdrel_field field,
struct cdrel_value value 
)
static

Definition at line 87 of file getters_cel.c.

89{
90 struct ast_event *event = record;
91 value->data_type = cdrel_type_string;
92 value->field_name = field->name;
94 return 0;
95}
@ cdrel_type_string
Definition cdrel.h:73
const char * ast_cel_get_type_name(enum ast_cel_event_type type)
Get the name of a CEL event type.
Definition cel.c:514
uint32_t ast_event_get_ie_uint(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has an integer payload.
Definition event.c:294
@ AST_EVENT_IE_CEL_EVENT_TYPE
Channel Event Type Used by: AST_EVENT_CEL Payload type: UINT.
Definition event_defs.h:133
An event.
Definition event.c:81
char * name
Definition cdrel.h:273
int value
Definition syslog.c:37

References ast_cel_get_type_name(), ast_event_get_ie_uint(), AST_EVENT_IE_CEL_EVENT_TYPE, cdrel_type_string, cdrel_field::name, and value.

Referenced by load_cel().

◆ cel_get_event_type()

static int cel_get_event_type ( void *  record,
struct cdrel_config config,
struct cdrel_field field,
struct cdrel_value value 
)
static

Definition at line 70 of file getters_cel.c.

72{
73 struct ast_event *event = record;
74 const char *val = NULL;
75 value->data_type = cdrel_type_string;
76 value->field_name = field->name;
77
80 } else {
82 }
83 value->values.string = (char *)val;
84 return 0;
85}
@ AST_CEL_USER_DEFINED
a user-defined event, the event name field should be set
Definition cel.h:70
const char * ast_event_get_ie_str(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has a string payload.
Definition event.c:303
@ AST_EVENT_IE_CEL_USEREVENT_NAME
Channel Event User Event Name Used by: AST_EVENT_CEL Payload type: STR.
Definition event_defs.h:151
#define NULL
Definition resample.c:96

References ast_cel_get_type_name(), AST_CEL_USER_DEFINED, ast_event_get_ie_str(), ast_event_get_ie_uint(), AST_EVENT_IE_CEL_EVENT_TYPE, AST_EVENT_IE_CEL_USEREVENT_NAME, cdrel_type_string, cdrel_field::name, NULL, and value.

Referenced by load_cel().

◆ cel_get_literal()

static int cel_get_literal ( void *  record,
struct cdrel_config config,
struct cdrel_field field,
struct cdrel_value value 
)
static

Definition at line 40 of file getters_cel.c.

42{
43 value->data_type = cdrel_type_string;
44 value->field_name = field->name;
45 value->values.string = field->data;
46 return 0;
47}
char data[1]
Definition cdrel.h:277

References cdrel_type_string, cdrel_field::data, cdrel_field::name, and value.

Referenced by load_cel().

◆ cel_get_string()

static int cel_get_string ( void *  record,
struct cdrel_config config,
struct cdrel_field field,
struct cdrel_value value 
)
static

Definition at line 30 of file getters_cel.c.

32{
33 struct ast_event *event = record;
34 value->data_type = cdrel_type_string;
35 value->field_name = field->name;
36 value->values.string = (char *)ast_event_get_ie_str(event, field->field_id);
37 return 0;
38}
int field_id
Definition cdrel.h:272

References ast_event_get_ie_str(), cdrel_type_string, cdrel_field::field_id, cdrel_field::name, and value.

Referenced by load_cel().

◆ cel_get_timeval()

static int cel_get_timeval ( void *  record,
struct cdrel_config config,
struct cdrel_field field,
struct cdrel_value value 
)
static

Definition at line 49 of file getters_cel.c.

51{
52 struct ast_event *event = record;
53 value->data_type = cdrel_type_timeval;
54 value->field_name = field->name;
57 return 0;
58}
@ cdrel_type_timeval
Definition cdrel.h:74
@ AST_EVENT_IE_CEL_EVENT_TIME
Channel Event Time (seconds) Used by: AST_EVENT_CEL Payload type: UINT.
Definition event_defs.h:139
@ AST_EVENT_IE_CEL_EVENT_TIME_USEC
Channel Event Time (micro-seconds) Used by: AST_EVENT_CEL Payload type: UINT.
Definition event_defs.h:145

References ast_event_get_ie_uint(), AST_EVENT_IE_CEL_EVENT_TIME, AST_EVENT_IE_CEL_EVENT_TIME_USEC, cdrel_type_timeval, cdrel_field::name, and value.

Referenced by load_cel().

◆ cel_get_uint32()

static int cel_get_uint32 ( void *  record,
struct cdrel_config config,
struct cdrel_field field,
struct cdrel_value value 
)
static

Definition at line 60 of file getters_cel.c.

62{
63 struct ast_event *event = record;
64 value->data_type = cdrel_type_uint32;
65 value->field_name = field->name;
66 value->values.uint32 = ast_event_get_ie_uint(event, field->field_id);
67 return 0;
68}
@ cdrel_type_uint32
Definition cdrel.h:84

References ast_event_get_ie_uint(), cdrel_type_uint32, cdrel_field::field_id, cdrel_field::name, and value.

Referenced by load_cel().

◆ dummy_chan_alloc_cel()

static struct ast_channel * dummy_chan_alloc_cel ( struct cdrel_config config,
void *  data 
)
static

Definition at line 97 of file getters_cel.c.

98{
99 struct ast_event *event = data;
100
102}
struct ast_channel * ast_cel_fabricate_channel_from_event(const struct ast_event *event)
Create a fake channel from data in a CEL event.
Definition cel.c:717

References ast_cel_fabricate_channel_from_event().

Referenced by load_cel().

◆ load_cel()

int load_cel ( void  )

Definition at line 104 of file getters_cel.c.

105{
106 ast_debug(1, "Loading CEL getters\n");
114
115 return 0;
116}
@ cdrel_type_event_type
Definition cdrel.h:79
@ cdrel_type_event_enum
Definition cdrel.h:80
@ cdrel_type_literal
Definition cdrel.h:75
cdrel_dummy_channel_alloc cdrel_dummy_channel_allocators[cdrel_format_type_end]
cdrel_field_getter cdrel_field_getters[cdrel_record_type_end][cdrel_data_type_end]
static int cel_get_event_type(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
Definition getters_cel.c:70
static int cel_get_event_enum(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
Definition getters_cel.c:87
static struct ast_channel * dummy_chan_alloc_cel(struct cdrel_config *config, void *data)
Definition getters_cel.c:97
static int cel_get_literal(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
Definition getters_cel.c:40
static int cel_get_uint32(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
Definition getters_cel.c:60
static int cel_get_string(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
Definition getters_cel.c:30
static int cel_get_timeval(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
Definition getters_cel.c:49
#define ast_debug(level,...)
Log a DEBUG message.
@ cdrel_record_cel

References ast_debug, cdrel_dummy_channel_allocators, cdrel_field_getters, cdrel_record_cel, cdrel_type_event_enum, cdrel_type_event_type, cdrel_type_literal, cdrel_type_string, cdrel_type_timeval, cdrel_type_uint32, cel_get_event_enum(), cel_get_event_type(), cel_get_literal(), cel_get_string(), cel_get_timeval(), cel_get_uint32(), and dummy_chan_alloc_cel().

Referenced by load_module().