Asterisk - The Open Source Telephony Project
18.5.0
|
Asterisk Beanstalkd CDR records. More...
#include "asterisk.h"
#include <time.h>
#include <stdio.h>
#include "beanstalk.h"
#include "asterisk/channel.h"
#include "asterisk/cdr.h"
#include "asterisk/module.h"
#include "asterisk/utils.h"
#include "asterisk/manager.h"
#include "asterisk/config.h"
#include "asterisk/pbx.h"
#include "asterisk/json.h"
Go to the source code of this file.
Macros | |
#define | BEANSTALK_JOB_DELAY 0 |
#define | BEANSTALK_JOB_PRIORITY 99 |
#define | BEANSTALK_JOB_SIZE 4096 |
#define | BEANSTALK_JOB_TTR 60 |
#define | CONF_FILE "cdr_beanstalkd.conf" |
#define | DATE_FORMAT "%Y-%m-%d %T" |
#define | DEFAULT_BEANSTALK_HOST "127.0.0.1" |
#define | DEFAULT_BEANSTALK_PORT 11300 |
#define | DEFAULT_BEANSTALK_TUBE "asterisk-cdr" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | beanstalk_put (struct ast_cdr *cdr) |
static int | load_config (int reload) |
static int | load_module (void) |
static int | reload (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Asterisk Beanstalkd CDR 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, .reload = reload, .load_pri = AST_MODPRI_CDR_DRIVER, .requires = "cdr", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static char * | bs_host |
static int | bs_port |
static char * | bs_tube |
static ast_rwlock_t | config_lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } |
static int | enablecdr = 0 |
static const char | name [] = "cdr_beanstalkd" |
static int | priority |
Asterisk Beanstalkd CDR records.
This module requires the beanstalk-client library, avaialble from https://github.com/deepfryed/beanstalk-client
See also
Definition in file cdr_beanstalkd.c.
#define BEANSTALK_JOB_DELAY 0 |
Definition at line 65 of file cdr_beanstalkd.c.
Referenced by beanstalk_put().
#define BEANSTALK_JOB_PRIORITY 99 |
Definition at line 63 of file cdr_beanstalkd.c.
Referenced by load_config().
#define BEANSTALK_JOB_SIZE 4096 |
Definition at line 62 of file cdr_beanstalkd.c.
#define BEANSTALK_JOB_TTR 60 |
Definition at line 64 of file cdr_beanstalkd.c.
Referenced by beanstalk_put().
#define CONF_FILE "cdr_beanstalkd.conf" |
Definition at line 61 of file cdr_beanstalkd.c.
Referenced by load_config().
#define DATE_FORMAT "%Y-%m-%d %T" |
Definition at line 60 of file cdr_beanstalkd.c.
Referenced by beanstalk_put().
#define DEFAULT_BEANSTALK_HOST "127.0.0.1" |
Definition at line 66 of file cdr_beanstalkd.c.
Referenced by load_config().
#define DEFAULT_BEANSTALK_PORT 11300 |
Definition at line 67 of file cdr_beanstalkd.c.
Referenced by load_config().
#define DEFAULT_BEANSTALK_TUBE "asterisk-cdr" |
Definition at line 68 of file cdr_beanstalkd.c.
Referenced by load_config().
|
static |
Definition at line 270 of file cdr_beanstalkd.c.
|
static |
Definition at line 270 of file cdr_beanstalkd.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 270 of file cdr_beanstalkd.c.
|
static |
Definition at line 162 of file cdr_beanstalkd.c.
References ast_cdr::accountcode, ast_cdr::amaflags, ast_cdr::answer, ast_cdr_disp2str(), ast_channel_amaflags2string(), ast_json_dump_string, ast_json_free(), ast_json_pack(), ast_json_unref(), ast_localtime(), ast_log, ast_rwlock_rdlock, ast_rwlock_unlock, ast_strftime(), BEANSTALK_JOB_DELAY, BEANSTALK_JOB_TTR, ast_cdr::billsec, bs_host, bs_port, bs_tube, ast_cdr::channel, ast_cdr::clid, config_lock, DATE_FORMAT, ast_cdr::dcontext, ast_cdr::disposition, ast_cdr::dst, ast_cdr::dstchannel, ast_cdr::duration, enablecdr, ast_cdr::end, ast_cdr::lastapp, ast_cdr::lastdata, LOG_DEBUG, LOG_ERROR, NULL, priority, S_OR, ast_cdr::src, ast_cdr::start, ast_cdr::uniqueid, and ast_cdr::userfield.
Referenced by load_module().
|
static |
Definition at line 82 of file cdr_beanstalkd.c.
References ast_category_browse(), ast_cdr_backend_suspend(), ast_cdr_backend_unsuspend(), ast_config_destroy(), ast_config_load, ast_free, ast_log, ast_rwlock_unlock, ast_rwlock_wrlock, ast_strdup, ast_true(), ast_variable_browse(), BEANSTALK_JOB_PRIORITY, bs_host, bs_port, bs_tube, CONF_FILE, CONFIG_FLAG_FILEUNCHANGED, config_lock, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, DEFAULT_BEANSTALK_HOST, DEFAULT_BEANSTALK_PORT, DEFAULT_BEANSTALK_TUBE, enablecdr, LOG_ERROR, LOG_NOTICE, LOG_WARNING, name, ast_variable::name, ast_variable::next, NULL, priority, and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Definition at line 246 of file cdr_beanstalkd.c.
References ast_cdr_register(), ast_cdr_unregister(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, beanstalk_put(), load_config(), and name.
Referenced by reload().
|
static |
Definition at line 259 of file cdr_beanstalkd.c.
References AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CDR_DRIVER, AST_MODULE_INFO(), AST_MODULE_SUPPORT_EXTENDED, ASTERISK_GPL_KEY, load_config(), load_module(), and unload_module().
|
static |
Definition at line 235 of file cdr_beanstalkd.c.
References ast_cdr_unregister(), ast_free, bs_host, bs_tube, and name.
Referenced by reload().
|
static |
Definition at line 270 of file cdr_beanstalkd.c.
|
static |
Definition at line 270 of file cdr_beanstalkd.c.
|
static |
Definition at line 73 of file cdr_beanstalkd.c.
Referenced by beanstalk_put(), load_config(), and unload_module().
|
static |
Definition at line 74 of file cdr_beanstalkd.c.
Referenced by beanstalk_put(), and load_config().
|
static |
Definition at line 75 of file cdr_beanstalkd.c.
Referenced by beanstalk_put(), load_config(), and unload_module().
|
static |
Definition at line 78 of file cdr_beanstalkd.c.
Referenced by beanstalk_put(), and load_config().
|
static |
Definition at line 72 of file cdr_beanstalkd.c.
Referenced by beanstalk_put(), and load_config().
|
static |
Definition at line 70 of file cdr_beanstalkd.c.
Referenced by load_config(), load_module(), and unload_module().
|
static |
Definition at line 76 of file cdr_beanstalkd.c.
Referenced by __after_bridge_set_goto(), _skinny_message_clear(), _skinny_message_set(), acf_isexten_exec(), action_dialplan_exec(), action_originate(), action_redirect(), add_action_to_menu_entry(), ast_add_extension2(), ast_bridge_setup_after_goto(), ast_channel_yank(), ast_compile_ael2(), ast_realtime_append_mapping(), AST_TEST_DEFINE(), beanstalk_put(), bridge_exec(), change_priority_caller_on_queue(), complete_dialplan_remove_extension(), copy_plain_file(), dns_srv_alloc(), dns_srv_sort(), handle_queue_change_priority_caller(), isexten_function_read(), jingle_interpret_ice_udp_transport(), leave_voicemail(), load_config(), load_module(), lua_pbx_exec(), manager_change_priority_caller_on_queue(), manager_dialplan_extension_add(), manager_dialplan_extension_remove(), originate_exec(), pidf_generate_body_content(), reload(), setup_peer_after_bridge_goto(), srv_result_read(), stasis_app_control_continue(), and xmpp_client_set_presence().