40#define DEFINE_CDR_GETTER(_sname, _ename, _type) \
41static int cdr_get_ ## _ename (void *record, struct cdrel_config *config, \
42 struct cdrel_field *field, struct cdrel_value *value) \
44 struct ast_cdr *cdr = record; \
45 value->data_type = field->input_data_type; \
46 value->field_name = field->name; \
47 value->values._sname = *(_type *)CDR_FIELD(cdr, field->field_id); \
62 value->field_name = field->name;
63 value->values.string = field->data;
72 const char *rtn =
NULL;
82 value->values.string = (
char *)
S_OR(rtn,
"");
struct ast_cdr * ast_cdr_dup(struct ast_cdr *cdr)
Duplicate a public CDR.
Private header for res_cdrel_custom.
#define CDR_FIELD(__cdr, __offset)
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 const char config[]
static void dummy(char *unused,...)
void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
#define ast_dummy_channel_alloc()
Create a fake channel structure.
const char * ast_var_name(const struct ast_var_t *var)
const char * ast_var_value(const struct ast_var_t *var)
static struct ast_channel * dummy_chan_alloc_cdr(struct cdrel_config *config, void *data)
static int cdr_get_string(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
#define DEFINE_CDR_GETTER(_sname, _ename, _type)
static int cdr_get_literal(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
static int cdr_get_uservar(void *record, struct cdrel_config *config, struct cdrel_field *field, struct cdrel_value *value)
#define ast_debug(level,...)
Log a DEBUG message.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Responsible for call detail data.
Main Channel structure associated with a channel.
struct ast_var_t::@220 entries
enum cdrel_data_type input_data_type