42#include RADIUS_HEADER_STR
50#define DATE_FORMAT "%Y-%m-%d %T %z"
52#define VENDOR_CODE 22736
84static const char desc[] =
"RADIUS CDR Backend";
85static const char name[] =
"radius";
88#ifdef FREERADIUS_CLIENT
100 int recordtype = PW_STATUS_STOP;
105 if (!rc_avpair_add(
rh, tosend, PW_ACCT_STATUS_TYPE, &recordtype, 0, 0))
200 if (!rc_avpair_add(
rh, tosend, PW_USER_NAME, &cdr->
channel, strlen(cdr->
channel), 0))
204 if (!rc_avpair_add(
rh, tosend, PW_ACCT_SESSION_ID, &cdr->
uniqueid, strlen(cdr->
uniqueid), 0))
213 VALUE_PAIR *tosend =
NULL;
216 ast_debug(1,
"Unable to create RADIUS record. CDR not recorded!\n");
227 rc_avpair_free(tosend);
269 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_cdr_unregister(const char *name)
Unregister a CDR handling engine.
const char * ast_cdr_disp2str(int disposition)
Disposition to a string.
int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
Register a CDR handling engine.
static const char cdr_config[]
@ RADIUS_FLAG_LOGUNIQUEID
@ RADIUS_FLAG_LOGUSERFIELD
static int build_radius_record(VALUE_PAIR **tosend, struct ast_cdr *cdr)
static int load_module(void)
static struct ast_flags global_flags
static int unload_module(void)
static char radiuscfg[PATH_MAX]
static int radius_log(struct ast_cdr *cdr)
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.
#define CONFIG_STATUS_FILEINVALID
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)
#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.
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.
Responsible for call detail data.
char dstchannel[AST_MAX_EXTENSION]
char lastdata[AST_MAX_EXTENSION]
char userfield[AST_MAX_USER_FIELD]
char channel[AST_MAX_EXTENSION]
char src[AST_MAX_EXTENSION]
char dst[AST_MAX_EXTENSION]
char clid[AST_MAX_EXTENSION]
char uniqueid[AST_MAX_UNIQUEID]
char accountcode[AST_MAX_ACCOUNT_CODE]
char lastapp[AST_MAX_EXTENSION]
char dcontext[AST_MAX_EXTENSION]
Structure used to handle boolean flags.
#define ast_test_flag(p, flag)
#define ast_set2_flag(p, value, flag)