| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
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 = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .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 = AST_RWLOCK_INIT_VALUE | 
| static int | enablecdr = 0 | 
| static const char | name [] = "cdr_beanstalkd" | 
| static int | priority | 
Asterisk Beanstalkd CDR records.
This module requires the beanstalk-client library, available 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.
| #define BEANSTALK_JOB_PRIORITY 99 | 
Definition at line 63 of file cdr_beanstalkd.c.
| #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.
| #define CONF_FILE "cdr_beanstalkd.conf" | 
Definition at line 61 of file cdr_beanstalkd.c.
| #define DATE_FORMAT "%Y-%m-%d %T" | 
Definition at line 60 of file cdr_beanstalkd.c.
| #define DEFAULT_BEANSTALK_HOST "127.0.0.1" | 
Definition at line 66 of file cdr_beanstalkd.c.
| #define DEFAULT_BEANSTALK_PORT 11300 | 
Definition at line 67 of file cdr_beanstalkd.c.
| #define DEFAULT_BEANSTALK_TUBE "asterisk-cdr" | 
Definition at line 68 of file cdr_beanstalkd.c.
| 
 | 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, reload(), and ast_variable::value.
| 
 | 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.
| 
 | static | 
Definition at line 259 of file cdr_beanstalkd.c.
References load_config().
Referenced by load_config().
| 
 | static | 
Definition at line 235 of file cdr_beanstalkd.c.
References ast_cdr_unregister(), ast_free, bs_host, bs_tube, and name.
| 
 | 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(), __ast_goto_if_exists(), action_dialplan_exec(), action_originate(), action_redirect(), add_action_to_menu_entry(), add_extension(), ast_add_extension(), ast_add_extension2(), ast_add_extension2(), ast_add_extension2(), ast_add_extension2_lockopt(), ast_add_extension2_nolock(), ast_add_extension_nolock(), ast_async_goto(), ast_async_goto_by_name(), ast_async_goto_if_exists(), ast_bridge_set_after_go_on(), ast_bridge_set_after_goto(), ast_bridge_setup_after_goto(), ast_canmatch_extension(), ast_compile_ael2(), ast_context_remove_extension(), ast_context_remove_extension2(), ast_context_remove_extension_callerid(), ast_context_remove_extension_callerid2(), ast_exists_extension(), ast_explicit_goto(), ast_get_extension_data(), ast_goto_if_exists(), ast_json_dialplan_cep(), ast_json_dialplan_cep_app(), ast_matchmore_extension(), ast_pbx_outgoing_exten(), ast_pbx_outgoing_exten_predial(), ast_realtime_append_mapping(), ast_spawn_extension(), ast_srv_get_nth_record(), ast_syslog_priority(), ast_syslog_priority_name(), AST_TEST_DEFINE(), ast_walk_extension_priorities(), async_goto_with_discard_bridge_after(), beanstalk_put(), bridge_exec(), canmatch(), change_priority_caller_on_queue(), complete_dialplan_remove_extension(), copy_plain_file(), dns_srv_alloc(), dns_srv_sort(), dundi_canmatch(), dundi_exec(), dundi_exists(), dundi_helper(), dundi_matchmore(), exec(), exists(), find_engine(), find_matching_priority(), find_matching_priority(), generate_srv_record(), gosub_allocate_frame(), handle_gosub(), handle_queue_change_priority_caller(), iax2_canmatch(), iax2_exec(), iax2_exists(), iax2_matchmore(), isexten_function_read(), jingle_interpret_ice_udp_transport(), leave_voicemail(), load_config(), load_module(), localized_add_extension2(), localized_find_extension(), localized_walk_extension_priorities(), loopback_parse(), loopback_subst(), lua_find_extension(), lua_pbx_exec(), lua_update_registry(), manager_change_priority_caller_on_queue(), manager_dialplan_extension_add(), manager_dialplan_extension_remove(), matchmore(), originate_exec(), parking_add_extension(), parse_srv(), pbx_extension_helper(), pbx_extension_helper(), pbx_find_extension(), pbx_find_extension(), pbx_outgoing_attempt(), pidf_generate_body_content(), raise_exception(), realtime_canmatch(), realtime_common(), realtime_exec(), realtime_exists(), realtime_matchmore(), realtime_switch_common(), setup_peer_after_bridge_goto(), setup_peer_after_bridge_goto(), srv_result_read(), stasis_app_control_continue(), and xmpp_client_set_presence().