34#include RADIUS_HEADER_STR
44#define DATE_FORMAT "%Y-%m-%d %T %z"
46#define VENDOR_CODE 22736
78#ifdef FREERADIUS_CLIENT
88#define RADIUS_BACKEND_NAME "CEL Radius Logging"
90#define ADD_VENDOR_CODE(x,y) (rc_avpair_add(rh, send, x, (void *)y, strlen(y), VENDOR_CODE))
94 int recordtype = PW_STATUS_STOP;
99 if (!rc_avpair_add(
rh, send, PW_ACCT_STATUS_TYPE, &recordtype, 0, 0)) {
171 if (!rc_avpair_add(
rh, send, PW_USER_NAME, (
void *)record->
channel_name,
181 VALUE_PAIR *send =
NULL;
191 ast_debug(1,
"Unable to create RADIUS record. CEL not recorded!\n");
202 rc_avpair_free(send);
239 if (rc_read_dictionary(
rh, rc_conf_str(
rh,
"dictionary"))) {
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
int ast_cel_backend_unregister(const char *name)
Unregister a CEL backend.
int ast_cel_fill_record(const struct ast_event *event, struct ast_cel_event_record *r)
Fill in an ast_cel_event_record from a CEL event.
#define AST_CEL_EVENT_RECORD_VERSION
struct ABI version
int ast_cel_backend_register(const char *name, ast_cel_backend_cb backend_callback)
Register a CEL backend.
#define RADIUS_BACKEND_NAME
@ RADIUS_FLAG_LOGUNIQUEID
@ RADIUS_FLAG_LOGUSERFIELD
static void radius_log(struct ast_event *event)
static int build_radius_record(VALUE_PAIR **send, struct ast_cel_event_record *record)
#define ADD_VENDOR_CODE(x, y)
static int load_module(void)
static struct ast_flags global_flags
static int unload_module(void)
static char radiuscfg[PATH_MAX]
General Asterisk PBX channel definitions.
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
#define ast_config_load(filename, flags)
Load a config file.
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
const char * ast_variable_retrieve(struct ast_config *config, const char *category, const char *variable)
Support for logging to various files, console and syslog Configuration in file logger....
#define ast_debug(level,...)
Log a DEBUG message.
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm)
Special version of strftime(3) that handles fractions of a second. Takes the same arguments as strfti...
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_EXTENDED
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Options provided by main asterisk program.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Helper struct for getting the fields out of a CEL event.
const char * caller_id_dnid
const char * application_data
const char * account_code
const char * caller_id_rdnis
const char * caller_id_num
const char * channel_name
const char * application_name
struct timeval event_time
uint32_t version
struct ABI version
const char * caller_id_ani
const char * caller_id_name
Structure used to handle boolean flags.
A container that holds all config-related information.
#define ast_test_flag(p, flag)
#define ast_set2_flag(p, value, flag)