Asterisk - The Open Source Telephony Project GIT-master-80b953f
Loading...
Searching...
No Matches
cel_custom.c
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2009, Digium, Inc.
5 *
6 * Steve Murphy <murf@digium.com>
7 * much borrowed from cdr code (cdr_custom.c), author Mark Spencer
8 *
9 * See http://www.asterisk.org for more information about
10 * the Asterisk project. Please do not directly contact
11 * any of the maintainers of this project for assistance;
12 * the project provides a web site, mailing lists and IRC
13 * channels for your use.
14 *
15 * This program is free software, distributed under the terms of
16 * the GNU General Public License Version 2. See the LICENSE file
17 * at the top of the source tree.
18 */
19
20/*! \file
21 *
22 * \brief Custom Comma Separated Value CEL records.
23 *
24 * \author Steve Murphy <murf@digium.com>
25 * Logs in LOG_DIR/cel_custom
26 * \ingroup cel_drivers
27 *
28 * The logic for this module now resides in res/res_cdrel_custom.c.
29 *
30 */
31
32/*** MODULEINFO
33 <depend>res_cdrel_custom</depend>
34 <support_level>core</support_level>
35 ***/
36
37#include "asterisk.h"
38
39#include "asterisk/cel.h"
40#include "asterisk/module.h"
42
43#define CONFIG "cel_custom.conf"
44
45#define CUSTOM_BACKEND_NAME "CEL Custom CSV Logging"
46
47static struct cdrel_configs *configs;
48
49/*!
50 * Protects in-flight log transactions from reloads.
51 */
53
54#define CDREL_RECORD_TYPE cdrel_record_cel
55#define CDREL_BACKEND_TYPE cdrel_backend_text
56
63
64static int unload_module(void)
65{
66 int res = 0;
67
71 if (res == 0) {
73 }
74
75 return res;
76}
77
88
89static int reload(void)
90{
91 int res = 0;
95 return res;
96}
97
98AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Customizable Comma Separated Values CEL Backend",
99 .support_level = AST_MODULE_SUPPORT_CORE,
100 .load = load_module,
101 .unload = unload_module,
102 .reload = reload,
103 .load_pri = AST_MODPRI_CDR_DRIVER,
104 .requires = "cel,res_cdrel_custom",
Asterisk main include file. File version handling, generic pbx functions.
Call Event Logging API.
static void custom_log(struct ast_event *event)
Definition cel_custom.c:57
#define CDREL_RECORD_TYPE
Definition cel_custom.c:54
static struct cdrel_configs * configs
Definition cel_custom.c:47
#define CONFIG
Definition cel_custom.c:43
static enum ast_module_load_result load_module(void)
Definition cel_custom.c:78
#define CDREL_BACKEND_TYPE
Definition cel_custom.c:55
static ast_rwlock_t configs_lock
Definition cel_custom.c:52
static int unload_module(void)
Definition cel_custom.c:64
static int reload(void)
Definition cel_custom.c:89
#define CUSTOM_BACKEND_NAME
Definition cel_custom.c:45
#define ast_rwlock_wrlock(a)
Definition lock.h:243
#define ast_rwlock_rdlock(a)
Definition lock.h:242
#define ast_rwlock_init(rwlock)
wrapper for rwlock with tracking enabled
Definition lock.h:231
#define ast_rwlock_destroy(rwlock)
Definition lock.h:240
#define ast_rwlock_unlock(a)
Definition lock.h:241
Asterisk module definitions.
@ AST_MODFLAG_LOAD_ORDER
Definition module.h:331
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
Definition module.h:557
@ AST_MODPRI_CDR_DRIVER
Definition module.h:345
@ AST_MODULE_SUPPORT_CORE
Definition module.h:121
#define ASTERISK_GPL_KEY
The text the key() function should return.
Definition module.h:46
ast_module_load_result
Definition module.h:68
@ AST_MODULE_LOAD_SUCCESS
Definition module.h:70
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Definition module.h:78
Protected header for the CDR and CEL Custom Backends.
int cdrel_logger(struct cdrel_configs *configs, void *data)
Log a record. The module's logging_cb must call this.
Definition loggers.c:270
int cdrel_reload_module(enum cdrel_backend_type backend_type, enum cdrel_record_type record_type, struct cdrel_configs **configs, const char *config_filename)
Perform module reload.
int cdrel_unload_module(enum cdrel_backend_type backend_type, enum cdrel_record_type record_type, struct cdrel_configs *configs, const char *backend_name)
Perform module unload.
struct cdrel_configs * cdrel_load_module(enum cdrel_backend_type backend_type, enum cdrel_record_type record_type, const char *config_filename, const char *backend_name, void *logging_cb)
Perform initial module load.
An event.
Definition event.c:81
Structure for rwlock and tracking information.
Definition lock.h:164