Asterisk - The Open Source Telephony Project
18.5.0
|
RADIUS CEL Support. More...
#include "asterisk.h"
#include <radcli/radcli.h>
#include "asterisk/channel.h"
#include "asterisk/cel.h"
#include "asterisk/module.h"
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk/options.h"
Go to the source code of this file.
Macros | |
#define | ADD_VENDOR_CODE(x, y) (rc_avpair_add(rh, send, x, (void *)y, strlen(y), VENDOR_CODE)) |
#define | DATE_FORMAT "%Y-%m-%d %T %z" |
#define | RADIUS_BACKEND_NAME "CEL Radius Logging" |
#define | VENDOR_CODE 22736 |
Enumerations | |
enum | { PW_AST_ACCT_CODE = 101, PW_AST_CIDNUM = 102, PW_AST_CIDNAME = 103, PW_AST_CIDANI = 104, PW_AST_CIDRDNIS = 105, PW_AST_CIDDNID = 106, PW_AST_EXTEN = 107, PW_AST_CONTEXT = 108, PW_AST_CHANNAME = 109, PW_AST_APPNAME = 110, PW_AST_APPDATA = 111, PW_AST_EVENT_TIME = 112, PW_AST_AMA_FLAGS = 113, PW_AST_UNIQUE_ID = 114, PW_AST_USER_NAME = 115, PW_AST_LINKED_ID = 116 } |
enum | { RADIUS_FLAG_USEGMTIME = (1 << 0), RADIUS_FLAG_LOGUNIQUEID = (1 << 1), RADIUS_FLAG_LOGUSERFIELD = (1 << 2) } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | build_radius_record (VALUE_PAIR **send, struct ast_cel_event_record *record) |
static int | load_module (void) |
static void | radius_log (struct ast_event *event) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER, .description = "RADIUS CEL Backend", .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n", .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b", .support_level = AST_MODULE_SUPPORT_EXTENDED, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CDR_DRIVER, .requires = "cel", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static char * | cel_config = "cel.conf" |
static struct ast_flags | global_flags = { RADIUS_FLAG_USEGMTIME | RADIUS_FLAG_LOGUNIQUEID | RADIUS_FLAG_LOGUSERFIELD } |
static char | radiuscfg [PATH_MAX] = "/etc/radiusclient-ng/radiusclient.conf" |
static rc_handle * | rh = NULL |
#define ADD_VENDOR_CODE | ( | x, | |
y | |||
) | (rc_avpair_add(rh, send, x, (void *)y, strlen(y), VENDOR_CODE)) |
Definition at line 92 of file cel_radius.c.
Referenced by build_radius_record().
#define DATE_FORMAT "%Y-%m-%d %T %z" |
ISO 8601 standard format
Definition at line 46 of file cel_radius.c.
Referenced by build_radius_record().
#define RADIUS_BACKEND_NAME "CEL Radius Logging" |
Definition at line 90 of file cel_radius.c.
Referenced by load_module(), and unload_module().
#define VENDOR_CODE 22736 |
Definition at line 48 of file cel_radius.c.
Referenced by build_radius_record().
anonymous enum |
Definition at line 50 of file cel_radius.c.
anonymous enum |
Enumerator | |
---|---|
RADIUS_FLAG_USEGMTIME | Log dates and times in UTC |
RADIUS_FLAG_LOGUNIQUEID | Log Unique ID |
RADIUS_FLAG_LOGUSERFIELD | Log User Field |
Definition at line 69 of file cel_radius.c.
|
static |
Definition at line 263 of file cel_radius.c.
|
static |
Definition at line 263 of file cel_radius.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 263 of file cel_radius.c.
|
static |
Definition at line 94 of file cel_radius.c.
References ast_cel_event_record::account_code, ADD_VENDOR_CODE, ast_cel_event_record::amaflag, amaflags, ast_cel_event_record::application_data, ast_cel_event_record::application_name, ast_channel_amaflags2string(), ast_localtime(), ast_strdupa, ast_strftime(), ast_test_flag, ast_cel_event_record::caller_id_ani, ast_cel_event_record::caller_id_dnid, ast_cel_event_record::caller_id_name, ast_cel_event_record::caller_id_num, ast_cel_event_record::caller_id_rdnis, ast_cel_event_record::channel_name, ast_cel_event_record::context, DATE_FORMAT, ast_cel_event_record::event_time, ast_cel_event_record::extension, ast_cel_event_record::linked_id, NULL, PW_AST_ACCT_CODE, PW_AST_AMA_FLAGS, PW_AST_APPDATA, PW_AST_APPNAME, PW_AST_CHANNAME, PW_AST_CIDANI, PW_AST_CIDDNID, PW_AST_CIDNAME, PW_AST_CIDNUM, PW_AST_CIDRDNIS, PW_AST_CONTEXT, PW_AST_EVENT_TIME, PW_AST_EXTEN, PW_AST_LINKED_ID, PW_AST_UNIQUE_ID, RADIUS_FLAG_LOGUNIQUEID, RADIUS_FLAG_USEGMTIME, ast_cel_event_record::unique_id, and VENDOR_CODE.
Referenced by radius_log().
|
static |
Definition at line 218 of file cel_radius.c.
References ast_cel_backend_register(), ast_config_destroy(), ast_config_load, ast_copy_string(), ast_log, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CDR_DRIVER, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_EXTENDED, ast_set2_flag, ast_true(), ast_variable_retrieve(), ASTERISK_GPL_KEY, LOG_NOTICE, NULL, RADIUS_BACKEND_NAME, RADIUS_FLAG_USEGMTIME, radius_log(), tmp(), and unload_module().
|
static |
Definition at line 180 of file cel_radius.c.
References AST_CEL_EVENT_RECORD_VERSION, ast_cel_fill_record(), ast_debug, ast_log, build_radius_record(), LOG_ERROR, NULL, result, and ast_cel_event_record::version.
Referenced by load_module().
|
static |
Definition at line 208 of file cel_radius.c.
References ast_cel_backend_unregister(), AST_MODULE_LOAD_SUCCESS, NULL, and RADIUS_BACKEND_NAME.
Referenced by load_module().
|
static |
Definition at line 263 of file cel_radius.c.
|
static |
Definition at line 263 of file cel_radius.c.
|
static |
Definition at line 78 of file cel_radius.c.
|
static |
Definition at line 86 of file cel_radius.c.
|
static |
Definition at line 83 of file cel_radius.c.
|
static |
Definition at line 88 of file cel_radius.c.