36 #include RADIUS_HEADER_STR 46 #define DATE_FORMAT "%Y-%m-%d %T %z" 48 #define VENDOR_CODE 22736 80 #ifdef FREERADIUS_CLIENT 83 static char radiuscfg[
PATH_MAX] =
"/etc/radiusclient-ng/radiusclient.conf";
90 #define RADIUS_BACKEND_NAME "CEL Radius Logging" 92 #define ADD_VENDOR_CODE(x,y) (rc_avpair_add(rh, send, x, (void *)y, strlen(y), VENDOR_CODE)) 96 int recordtype = PW_STATUS_STOP;
101 if (!rc_avpair_add(rh, send, PW_ACCT_STATUS_TYPE, &recordtype, 0, 0)) {
173 if (!rc_avpair_add(rh, send, PW_USER_NAME, (
void *)record->
channel_name,
183 VALUE_PAIR *send =
NULL;
193 ast_debug(1,
"Unable to create RADIUS record. CEL not recorded!\n");
197 result = rc_acct(rh, 0, send);
198 if (result != OK_RC) {
204 rc_avpair_free(send);
235 if (!(rh = rc_read_config(radiuscfg))) {
236 ast_log(
LOG_NOTICE,
"Cannot load radiusclient-ng configuration file %s.\n", radiuscfg);
241 if (rc_read_dictionary(rh, rc_conf_str(rh,
"dictionary"))) {
const char * account_code
const char * caller_id_name
Helper struct for getting the fields out of a CEL event.
static int unload_module(void)
static int build_radius_record(VALUE_PAIR **send, struct ast_cel_event_record *record)
A container that holds all config-related information.
Asterisk main include file. File version handling, generic pbx functions.
#define ast_set2_flag(p, value, flag)
#define ast_test_flag(p, flag)
int ast_cel_backend_register(const char *name, ast_cel_backend_cb backend_callback)
Register a CEL backend.
static int load_module(void)
const char * application_data
const char * application_name
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
#define RADIUS_BACKEND_NAME
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
const char * caller_id_num
#define ADD_VENDOR_CODE(x, y)
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_config_load(filename, flags)
Load a config file.
General Asterisk PBX channel definitions.
static char radiuscfg[PATH_MAX]
void ast_config_destroy(struct ast_config *config)
Destroys a config.
uint32_t version
struct ABI version
#define ast_strdupa(s)
duplicate a string in memory from the stack
static struct ast_flags global_flags
int ast_cel_backend_unregister(const char *name)
Unregister a CEL backend.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
static void radius_log(struct ast_event *event)
const char * caller_id_rdnis
Module has failed to load, may be in an inconsistent state.
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...
const char * caller_id_ani
#define AST_CEL_EVENT_RECORD_VERSION
struct ABI version
Structure used to handle boolean flags.
Support for logging to various files, console and syslog Configuration in file logger.conf.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
const char * ast_variable_retrieve(struct ast_config *config, const char *category, const char *variable)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Options provided by main asterisk program.
const char * caller_id_dnid
const char * channel_name
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
struct timeval event_time
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.