Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Call Detail Record API. More...
#include "asterisk.h"
#include <signal.h>
#include <inttypes.h>
#include "asterisk/lock.h"
#include "asterisk/channel.h"
#include "asterisk/cdr.h"
#include "asterisk/callerid.h"
#include "asterisk/manager.h"
#include "asterisk/module.h"
#include "asterisk/causes.h"
#include "asterisk/linkedlists.h"
#include "asterisk/utils.h"
#include "asterisk/sched.h"
#include "asterisk/config.h"
#include "asterisk/cli.h"
#include "asterisk/stringfields.h"
#include "asterisk/config_options.h"
#include "asterisk/json.h"
#include "asterisk/parking.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_bridges.h"
#include "asterisk/stasis_message_router.h"
#include "asterisk/astobj2.h"
#include "asterisk/taskprocessor.h"
Go to the source code of this file.
Data Structures | |
struct | be_list |
List of registered backends. More... | |
struct | bridge_leave_data |
struct | cdr_batch |
The actual batch queue. More... | |
struct | cdr_batch_item |
Queued CDR waiting to be batched. More... | |
struct | cdr_beitem |
Registration object for CDR backends. More... | |
struct | cdr_object |
An in-memory representation of an active CDR. More... | |
struct | cdr_object_fn_table |
A virtual table used for cdr_object. More... | |
struct | cdr_object_snapshot |
A wrapper object around a snapshot. Fields that are mutable by the CDR engine are replicated here. More... | |
struct | mo_list |
List of registered modifiers. More... | |
struct | module_config |
The configuration settings for this module. More... | |
struct | party_b_userfield_update |
Macros | |
#define | CDR_DEBUG(fmt, ...) |
#define | cdr_set_debug_mode(mod_cfg) |
#define | DEFAULT_BATCH_SAFE_SHUTDOWN "1" |
#define | DEFAULT_BATCH_SCHEDULER_ONLY "0" |
#define | DEFAULT_BATCH_SIZE "100" |
#define | DEFAULT_BATCH_TIME "300" |
#define | DEFAULT_BATCHMODE "0" |
#define | DEFAULT_CHANNEL_ENABLED "1" |
#define | DEFAULT_CONGESTION "0" |
#define | DEFAULT_ENABLED "1" |
#define | DEFAULT_END_BEFORE_H_EXTEN "1" |
#define | DEFAULT_IGNORE_DIAL_CHANGES "0" |
#define | DEFAULT_IGNORE_STATE_CHANGES "0" |
#define | DEFAULT_INITIATED_SECONDS "0" |
#define | DEFAULT_UNANSWERED "0" |
#define | FORMAT_STRING "%-25.25s %-25.25s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8ld %-8.8ld\n" |
#define | FORMAT_STRING "%-10.10s %-20.20s %-25.25s %-15.15s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8ld %-8.8ld\n" |
#define | MAX_BATCH_SIZE 1000 |
#define | MAX_BATCH_TIME 86400 |
#define | TITLE_STRING "%-25.25s %-25.25s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8s %-8.8s\n" |
#define | TITLE_STRING "%-10.10s %-20.20s %-25.25s %-15.15s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8s %-8.8s\n" |
Enumerations | |
enum | process_bridge_enter_results { BRIDGE_ENTER_ONLY_PARTY , BRIDGE_ENTER_OBTAINED_PARTY_B , BRIDGE_ENTER_NO_PARTY_B , BRIDGE_ENTER_NEED_CDR } |
Return types for process_bridge_enter functions. More... | |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static | AO2_GLOBAL_OBJ_STATIC (module_configs) |
The container for the module configuration. More... | |
struct ast_cdr * | ast_cdr_alloc (void) |
Allocate a CDR record. More... | |
int | ast_cdr_backend_suspend (const char *name) |
Suspend a CDR backend temporarily. More... | |
int | ast_cdr_backend_unsuspend (const char *name) |
Unsuspend a CDR backend. More... | |
int | ast_cdr_clear_property (const char *channel_name, enum ast_cdr_options option) |
Clear a property on a CDR for a channel. More... | |
const char * | ast_cdr_disp2str (int disposition) |
Disposition to a string. More... | |
struct ast_cdr * | ast_cdr_dup (struct ast_cdr *cdr) |
Duplicate a public CDR. More... | |
void | ast_cdr_engine_term (void) |
int | ast_cdr_fork (const char *channel_name, struct ast_flags *options) |
Fork a CDR. More... | |
void | ast_cdr_format_var (struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int raw) |
Format a CDR variable from an already posted CDR. More... | |
void | ast_cdr_free (struct ast_cdr *cdr) |
Free a CDR record. More... | |
static int | ast_cdr_generic_unregister (struct be_list *generic_list, const char *name) |
struct ast_cdr_config * | ast_cdr_get_config (void) |
Obtain the current CDR configuration. More... | |
int | ast_cdr_getvar (const char *channel_name, const char *name, char *value, size_t length) |
Retrieve a CDR variable from a channel's current CDR. More... | |
int | ast_cdr_is_enabled (void) |
Return TRUE if CDR subsystem is enabled. More... | |
struct stasis_message_router * | ast_cdr_message_router (void) |
Return the message router for the CDR engine. More... | |
int | ast_cdr_modifier_register (const char *name, const char *desc, ast_cdrbe be) |
Register a CDR modifier. More... | |
int | ast_cdr_modifier_unregister (const char *name) |
Unregister a CDR modifier. More... | |
int | ast_cdr_register (const char *name, const char *desc, ast_cdrbe be) |
Register a CDR handling engine. More... | |
int | ast_cdr_reset (const char *channel_name, int keep_variables) |
Reset the detail record. More... | |
int | ast_cdr_serialize_variables (const char *channel_name, struct ast_str **buf, char delim, char sep) |
Serializes all the data and variables for a current CDR record. More... | |
void | ast_cdr_set_config (struct ast_cdr_config *config) |
Set the current CDR configuration. More... | |
int | ast_cdr_set_property (const char *channel_name, enum ast_cdr_options option) |
Set a property on a CDR for a channel. More... | |
void | ast_cdr_setuserfield (const char *channel_name, const char *userfield) |
Set CDR user field for channel (stored in CDR) More... | |
int | ast_cdr_setvar (const char *channel_name, const char *name, const char *value) |
Set a variable on a CDR. More... | |
int | ast_cdr_unregister (const char *name) |
Unregister a CDR handling engine. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static enum process_bridge_enter_results | base_process_bridge_enter (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static int | base_process_bridge_leave (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static int | base_process_dial_end (struct cdr_object *cdr, struct ast_channel_snapshot *caller, struct ast_channel_snapshot *peer, const char *dial_status) |
static int | base_process_parked_channel (struct cdr_object *cdr, struct ast_parked_call_payload *parking_info) |
static int | base_process_party_a (struct cdr_object *cdr, struct ast_channel_snapshot *snapshot) |
static void | bridge_candidate_add_to_cdr (struct cdr_object *cdr, struct cdr_object_snapshot *party_b) |
static void | bridge_candidate_process (struct cdr_object *cdr, struct cdr_object *base_cand_cdr) |
Process a single bridge_candidate . More... | |
static int | bridge_state_process_bridge_leave (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static void | bridge_state_process_party_b (struct cdr_object *cdr, struct ast_channel_snapshot *snapshot) |
static int | cdr_all_cmp_fn (void *obj, void *arg, int flags) |
static int | cdr_all_hash_fn (const void *obj, const int flags) |
static void | cdr_all_print_fn (void *v_obj, void *where, ao2_prnt_fn *prnt) |
static void | cdr_all_relink (struct cdr_object *cdr) |
static void | cdr_all_unlink (struct cdr_object *cdr) |
static void | cdr_detach (struct ast_cdr *cdr) |
static void | cdr_enable_batch_mode (struct ast_cdr_config *config) |
static void | cdr_engine_shutdown (void) |
static const char * | cdr_format_var_internal (struct ast_cdr *cdr, const char *name) |
static int | cdr_generic_register (struct be_list *generic_list, const char *name, const char *desc, ast_cdrbe be) |
static void | cdr_get_tv (struct timeval when, const char *fmt, char *buf, int bufsize) |
static int | cdr_master_cmp_fn (void *obj, void *arg, int flags) |
static int | cdr_master_hash_fn (const void *obj, const int flags) |
static void | cdr_master_print_fn (void *v_obj, void *where, ao2_prnt_fn *prnt) |
static struct cdr_object * | cdr_object_alloc (struct ast_channel_snapshot *chan, const struct timeval *event_time) |
cdr_object constructor More... | |
static void | cdr_object_check_party_a_answer (struct cdr_object *cdr) |
Check to see if a CDR needs to be answered based on its Party A. Note that this is safe to call as much as you want - we won't answer twice. More... | |
static void | cdr_object_check_party_a_hangup (struct cdr_object *cdr) |
Check to see if a CDR needs to move to the finalized state because its Party A hungup. More... | |
static struct cdr_object * | cdr_object_create_and_append (struct cdr_object *cdr, const struct timeval *event_time) |
Create a new cdr_object and append it to an existing chain. More... | |
static struct ast_cdr * | cdr_object_create_public_records (struct cdr_object *cdr) |
Create a chain of ast_cdr objects from a chain of cdr_object suitable for consumption by the registered CDR backends. More... | |
static void | cdr_object_dispatch (struct cdr_object *cdr) |
Dispatch a CDR. More... | |
static int | cdr_object_dispatch_all_cb (void *obj, void *arg, int flags) |
This dispatches all cdr_object. It should only be used during shutdown, so that we get billing records for everything that we can. More... | |
static void | cdr_object_dtor (void *obj) |
cdr_object Destructor More... | |
static void | cdr_object_finalize (struct cdr_object *cdr) |
Finalize a CDR. More... | |
static int | cdr_object_finalize_party_b (void *obj, void *arg, void *data, int flags) |
static int | cdr_object_format_property (struct cdr_object *cdr_obj, const char *name, char *value, size_t length) |
Format one of the standard properties on a cdr_object. More... | |
static void | cdr_object_format_var_internal (struct cdr_object *cdr, const char *name, char *value, size_t length) |
Format a variable on a cdr_object. More... | |
static long | cdr_object_get_billsec (struct cdr_object *cdr) |
Compute the billsec for a cdr_object. More... | |
static struct cdr_object * | cdr_object_get_by_name (const char *name) |
static int | cdr_object_get_by_name_cb (void *obj, void *arg, int flags) |
static long | cdr_object_get_duration (struct cdr_object *cdr) |
static int | cdr_object_party_b_left_bridge_cb (void *obj, void *arg, void *data, int flags) |
Callback used to notify CDRs of a Party B leaving the bridge. More... | |
static struct cdr_object_snapshot * | cdr_object_pick_party_a (struct cdr_object_snapshot *left, struct cdr_object_snapshot *right) |
Given two CDR snapshots, figure out who should be Party A for the resulting CDR. More... | |
static int | cdr_object_select_all_by_name_cb (void *obj, void *arg, int flags) |
static void | cdr_object_set_disposition (struct cdr_object *cdr, int hangupcause) |
Set the disposition on a cdr_object based on a hangupcause code. More... | |
static void | cdr_object_snapshot_copy (struct cdr_object_snapshot *dst, struct cdr_object_snapshot *src) |
Copy a snapshot and its details. More... | |
static void | cdr_object_swap_snapshot (struct cdr_object_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot) |
Swap an old cdr_object_snapshot's ast_channel_snapshot for a new ast_channel_snapshot. More... | |
static void | cdr_object_transition_state (struct cdr_object *cdr, struct cdr_object_fn_table *fn_table) |
Transition a cdr_object to a new state. More... | |
static void | cdr_object_transition_state_init (struct cdr_object *cdr, struct cdr_object_fn_table *fn_table, int do_init) |
Transition a cdr_object to a new state with initiation flag. More... | |
static void | cdr_object_update_cid (struct cdr_object_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot) |
Set Caller ID information on a CDR. More... | |
static int | cdr_object_update_party_b (void *obj, void *arg, void *data, int flags) |
static int | cdr_object_update_party_b_userfield_cb (void *obj, void *arg, void *data, int flags) |
Callback used to update the userfield on Party B on all CDRs. More... | |
static void | cdr_submit_batch (int shutdown) |
static int | cdr_toggle_runtime_options (void) |
Checks if CDRs are enabled and enables/disables the necessary options. More... | |
static int | check_new_cdr_needed (struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot) |
Determine if we need to add a new CDR based on snapshots. More... | |
static char * | cli_complete_show (struct ast_cli_args *a) |
Complete user input for 'cdr show'. More... | |
static void | cli_show_channel (struct ast_cli_args *a) |
static void | cli_show_channels (struct ast_cli_args *a) |
CONFIG_INFO_CORE ("cdr", cfg_info, module_configs, module_config_alloc,.files=ACO_FILES(&module_file_conf),.post_apply_config=module_config_post_apply,) | |
static int | copy_variables (struct varshead *to_list, struct varshead *from_list) |
Copy variables from one list to another. More... | |
static int | create_subscriptions (void) |
Create the Stasis subcriptions for CDRs. More... | |
static void | destroy_subscriptions (void) |
Destroy the active Stasis subscriptions. More... | |
static enum process_bridge_enter_results | dial_state_process_bridge_enter (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static int | dial_state_process_dial_begin (struct cdr_object *cdr, struct ast_channel_snapshot *caller, struct ast_channel_snapshot *peer) |
static int | dial_state_process_dial_end (struct cdr_object *cdr, struct ast_channel_snapshot *caller, struct ast_channel_snapshot *peer, const char *dial_status) |
static void | dial_state_process_party_b (struct cdr_object *cdr, struct ast_channel_snapshot *snapshot) |
static int | dial_status_end (const char *dialstatus) |
static enum ast_cdr_disposition | dial_status_to_disposition (const char *dial_status) |
static enum process_bridge_enter_results | dialed_pending_state_process_bridge_enter (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static int | dialed_pending_state_process_dial_begin (struct cdr_object *cdr, struct ast_channel_snapshot *caller, struct ast_channel_snapshot *peer) |
static int | dialed_pending_state_process_parking_bridge_enter (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static int | dialed_pending_state_process_party_a (struct cdr_object *cdr, struct ast_channel_snapshot *snapshot) |
static void * | do_batch_backend_process (void *data) |
static void * | do_cdr (void *data) |
static int | filter_bridge_messages (struct ast_bridge_snapshot *bridge) |
Filter bridge messages based on bridge technology. More... | |
static int | filter_channel_snapshot (struct ast_channel_snapshot *snapshot) |
static int | filter_channel_snapshot_message (struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot) |
static void | finalize_batch_mode (void) |
static void | finalized_state_init_function (struct cdr_object *cdr) |
static int | finalized_state_process_party_a (struct cdr_object *cdr, struct ast_channel_snapshot *snapshot) |
static void | free_variables (struct varshead *headp) |
Delete all variables from a variable list. More... | |
static void | handle_bridge_enter_message (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | handle_bridge_leave_message (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Handler for when a channel leaves a bridge. More... | |
static void | handle_bridge_pairings (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge) |
Handle creating bridge pairings for the cdr_object that just entered a bridge. More... | |
static void | handle_cdr_sync_message (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Handler for a synchronization message. More... | |
static void | handle_channel_snapshot_update_message (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Handler for channel snapshot update messages. More... | |
static char * | handle_cli_debug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_show (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_status (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_submit (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | handle_dial_message (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Handler for Stasis-Core dial messages. More... | |
static void | handle_parked_call_message (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Handler for when a channel is parked. More... | |
static void | handle_parking_bridge_enter_message (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel, const struct timeval *event_time) |
Handle entering into a parking bridge. More... | |
static void | handle_standard_bridge_enter_message (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel, const struct timeval *event_time) |
Handle a bridge enter message for a 'normal' bridge. More... | |
static int | init_batch (void) |
static int | is_cdr_flag_set (unsigned int cdr_flag) |
static int | load_module (void) |
static void * | module_config_alloc (void) |
Create a new module config object. More... | |
static void | module_config_destructor (void *obj) |
Dispose of a module config object. More... | |
static void | module_config_post_apply (void) |
static int | parked_state_process_bridge_leave (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static void | post_cdr (struct ast_cdr *cdr) |
static int | process_config (int reload) |
static int | reload_module (void) |
static void | reset_batch (void) |
static void | set_variable (struct varshead *headp, const char *name, const char *value) |
static int | single_state_bridge_enter_comparison (struct cdr_object *cdr, struct cdr_object *cand_cdr) |
Handle a comparison between our cdr_object and a cdr_object already in the bridge while in the Single state. The goal of this is to find a Party B for our CDR. More... | |
static void | single_state_init_function (struct cdr_object *cdr) |
static enum process_bridge_enter_results | single_state_process_bridge_enter (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static int | single_state_process_dial_begin (struct cdr_object *cdr, struct ast_channel_snapshot *caller, struct ast_channel_snapshot *peer) |
static int | single_state_process_parking_bridge_enter (struct cdr_object *cdr, struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *channel) |
static void | single_state_process_party_b (struct cdr_object *cdr, struct ast_channel_snapshot *snapshot) |
static int | snapshot_cep_changed (struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot) |
Return whether or not a channel has changed its state in the dialplan, subject to endbeforehexten logic. More... | |
static int | snapshot_is_dialed (struct ast_channel_snapshot *snapshot) |
Return whether or not a ast_channel_snapshot is for a channel that was created as the result of a dial operation. More... | |
static void | start_batch_mode (void) |
STASIS_MESSAGE_TYPE_DEFN_LOCAL (cdr_sync_message_type) | |
A message type used to synchronize with the CDR topic. More... | |
static int | submit_scheduled_batch (const void *data) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "CDR Engine" , .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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = AST_MODPRI_CORE, .requires = "extconfig", } |
static struct ao2_container * | active_cdrs_all |
A container of all active CDRs with a Party B indexed by Party B channel name. More... | |
static struct ao2_container * | active_cdrs_master |
A container of the active master CDRs indexed by Party A channel uniqueid. More... | |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct cdr_batch * | batch = NULL |
static struct be_list | be_list = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
struct cdr_object_fn_table | bridge_state_fn_table |
The virtual table for the Bridged state. More... | |
static struct stasis_forward * | bridge_subscription |
Our subscription for bridges. More... | |
static ast_mutex_t | cdr_batch_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
Lock protecting modifications to the batch queue. More... | |
static int | cdr_debug_enabled |
static ast_cond_t | cdr_pending_cond |
static ast_mutex_t | cdr_pending_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
These are used to wake up the CDR thread when there's work to do. More... | |
static const char *const | cdr_readonly_vars [] |
static int | cdr_sched = -1 |
static ast_mutex_t | cdr_sched_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static pthread_t | cdr_thread = AST_PTHREADT_NULL |
static struct stasis_topic * | cdr_topic |
The parent topic for all topics we want to aggregate for CDRs. More... | |
static struct stasis_forward * | channel_subscription |
Our subscription for channels. More... | |
static struct ast_cli_entry | cli_commands [] |
static int | dial_changes_ignored |
struct cdr_object_fn_table | dial_state_fn_table |
The virtual table for the Dial state. More... | |
struct cdr_object_fn_table | dialed_pending_state_fn_table |
The virtual table for the Dialed Pending state. More... | |
struct cdr_object_fn_table | finalized_state_fn_table |
The virtual table for the finalized state. More... | |
static struct aco_type | general_option |
The type definition for general options. More... | |
static struct aco_type * | general_options [] = ACO_TYPES(&general_option) |
static int | global_cdr_sequence = 0 |
The global sequence counter used for CDRs. More... | |
static const char * | ignore_categories [] |
static struct aco_type | ignore_option |
static struct mo_list | mo_list = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static struct aco_file | module_file_conf |
The file definition. More... | |
struct cdr_object_fn_table | parked_state_fn_table |
The virtual table for the Parked state. More... | |
static struct stasis_forward * | parking_subscription |
Our subscription for parking. More... | |
static struct ast_sched_context * | sched |
Scheduler items. More... | |
struct cdr_object_fn_table | single_state_fn_table |
The virtual table for the Single state. More... | |
static struct stasis_message_router * | stasis_router |
Message router for stasis messages regarding channel state. More... | |
Call Detail Record API.
Definition in file cdr.c.
#define CDR_DEBUG | ( | fmt, | |
... | |||
) |
#define cdr_set_debug_mode | ( | mod_cfg | ) |
#define FORMAT_STRING "%-25.25s %-25.25s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8ld %-8.8ld\n" |
#define FORMAT_STRING "%-10.10s %-20.20s %-25.25s %-15.15s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8ld %-8.8ld\n" |
#define TITLE_STRING "%-25.25s %-25.25s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8s %-8.8s\n" |
#define TITLE_STRING "%-10.10s %-20.20s %-25.25s %-15.15s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8s %-8.8s\n" |
Return types for process_bridge_enter
functions.
Definition at line 433 of file cdr.c.
|
static |
The container for the module configuration.
struct ast_cdr * ast_cdr_alloc | ( | void | ) |
Allocate a CDR record.
NULL | on error (malloc failure) |
Definition at line 3501 of file cdr.c.
References ast_calloc.
Referenced by ast_cdr_dup().
int ast_cdr_backend_suspend | ( | const char * | name | ) |
Suspend a CDR backend temporarily.
0 | The backend is suspended |
-1 | The backend could not be suspended |
Definition at line 2932 of file cdr.c.
References ast_debug, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, cdr_beitem::name, name, and NULL.
Referenced by load_config(), and odbc_load_module().
int ast_cdr_backend_unsuspend | ( | const char * | name | ) |
Unsuspend a CDR backend.
0 | The backend was unsuspended |
-1 | The back could not be unsuspended |
Definition at line 2950 of file cdr.c.
References ast_debug, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, cdr_beitem::name, name, and NULL.
Referenced by load_config(), and odbc_load_module().
int ast_cdr_clear_property | ( | const char * | channel_name, |
enum ast_cdr_options | option | ||
) |
Clear a property on a CDR for a channel.
Clears a flag previously set by ast_cdr_set_property
channel_name | The CDR's channel |
option | Option to clear from the CDR |
0 | on success |
1 | on error |
Definition at line 3654 of file cdr.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_clear_flag, cdr_object_get_by_name(), finalized_state_fn_table, cdr_object::flags, cdr_object::fn_table, and cdr_object::next.
Referenced by AST_TEST_DEFINE(), and cdr_prop_write_callback().
const char * ast_cdr_disp2str | ( | int | disposition | ) |
Disposition to a string.
disposition | input binary form Converts the binary form of a disposition to string form. |
Definition at line 3509 of file cdr.c.
References AST_CDR_ANSWERED, AST_CDR_BUSY, AST_CDR_CONGESTION, AST_CDR_FAILED, AST_CDR_NOANSWER, AST_CDR_NULL, and ast_cdr::disposition.
Referenced by ast_cdr_format_var(), beanstalk_put(), build_csv_record(), build_radius_record(), cdr_object_finalize(), cdr_read_callback(), execute_cb(), manager_log(), and tds_log().
Duplicate a public CDR.
cdr | the record to duplicate |
NULL | on error (malloc failure) |
Definition at line 3064 of file cdr.c.
References ast_cdr_alloc(), AST_LIST_HEAD_INIT_NOLOCK, copy_variables(), ast_cdr::next, NULL, and ast_cdr::varshead.
Referenced by custom_log(), manager_log(), and write_cdr().
void ast_cdr_engine_term | ( | void | ) |
Submit any remaining CDRs and prepare for shutdown
Definition at line 4682 of file cdr.c.
References ao2_alloc, ao2_cleanup, ao2_global_obj_ref, ast_debug, ast_test_flag, BATCH_MODE_SAFE_SHUTDOWN, CDR_BATCHMODE, cdr_submit_batch(), NULL, RAII_VAR, stasis_message_create(), stasis_message_router_publish_sync(), and stasis_router.
Referenced by can_safely_quit(), and finalize_batch_mode().
int ast_cdr_fork | ( | const char * | channel_name, |
struct ast_flags * | options | ||
) |
Fork a CDR.
channel_name | The name of the channel whose CDR should be forked |
options | Options to control how the fork occurs. |
0 | on success |
-1 | on failure |
Definition at line 3716 of file cdr.c.
References cdr_object::answer, ao2_cleanup, ao2_ref, cdr_object::appl, AST_CDR_FLAG_FINALIZE, AST_CDR_FLAG_KEEP_VARS, AST_CDR_FLAG_RESET, AST_CDR_FLAG_SET_ANSWER, AST_CDR_LOCK_APP, ast_clear_flag, ast_debug, AST_STATE_UP, ast_string_field_set, ast_test_flag, ast_tvnow(), cdr_object::bridge, cdr_all_relink(), cdr_object_create_and_append(), cdr_object_finalize(), cdr_object_get_by_name(), cdr_object_transition_state(), voicemailpwcheck::context, copy_variables(), cdr_object::data, cdr_object::exten, finalized_state_fn_table, ast_flags::flags, cdr_object_snapshot::flags, cdr_object::flags, cdr_object::fn_table, free_variables(), cdr_object::last, cdr_object::lastevent, lock, cdr_object::next, options, cdr_object::party_a, cdr_object::party_b, RAII_VAR, SCOPED_AO2LOCK, cdr_object_snapshot::snapshot, cdr_object::start, ast_channel_snapshot::state, cdr_object_snapshot::userfield, and cdr_object_snapshot::variables.
Referenced by AST_TEST_DEFINE(), and forkcdr_callback().
void ast_cdr_format_var | ( | struct ast_cdr * | cdr, |
const char * | name, | ||
char ** | ret, | ||
char * | workspace, | ||
int | workspacelen, | ||
int | raw | ||
) |
Format a CDR variable from an already posted CDR.
cdr | The dispatched CDR to process |
name | The name of the variable |
ret | Pointer to the formatted buffer |
workspace | A pointer to the buffer to use to format the variable |
workspacelen | The size of workspace |
raw | If non-zero and a date/time is extracted, provide epoch seconds. Otherwise format as a date/time stamp |
Definition at line 3116 of file cdr.c.
References ast_cdr::accountcode, ast_cdr::amaflags, ast_cdr::answer, ast_cdr_disp2str(), ast_channel_amaflags2string(), ast_copy_string(), ast_strlen_zero(), ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), ast_cdr::billsec, cdr_format_var_internal(), cdr_get_tv(), ast_cdr::channel, ast_cdr::clid, ast_cdr::dcontext, ast_cdr::disposition, ast_cdr::dst, ast_cdr::dstchannel, ast_cdr::duration, ast_cdr::end, ast_cdr::lastapp, ast_cdr::lastdata, ast_cdr::linkedid, name, NULL, ast_cdr::peeraccount, ast_cdr::peertenantid, ast_cdr::sequence, ast_cdr::src, ast_cdr::start, ast_cdr::tenantid, ast_cdr::uniqueid, and ast_cdr::userfield.
Referenced by cdr_read_callback(), cdr_retrieve_time(), odbc_log(), and pgsql_log().
void ast_cdr_free | ( | struct ast_cdr * | cdr | ) |
Free a CDR record.
cdr | ast_cdr structure to free |
Definition at line 3490 of file cdr.c.
References ast_free, free_variables(), ast_cdr::next, and ast_cdr::varshead.
Referenced by ast_channel_destructor(), ast_dummy_channel_destructor(), cdr_detach(), clear_mock_cdr_backend(), and do_batch_backend_process().
|
static |
Definition at line 3019 of file cdr.c.
References active_cdrs_master, ao2_container_count(), ast_free, ast_log, AST_LOG_WARNING, AST_RWLIST_REMOVE, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, match(), name, and NULL.
Referenced by ast_cdr_modifier_unregister(), and ast_cdr_unregister().
struct ast_cdr_config * ast_cdr_get_config | ( | void | ) |
Obtain the current CDR configuration.
The configuration is a ref counted object. The caller of this function must decrement the ref count when finished with the configuration.
NULL | on error |
Definition at line 2892 of file cdr.c.
References ao2_bump, ao2_cleanup, ao2_global_obj_ref, module_config::general, and NULL.
Referenced by test_cdr_init_cb().
int ast_cdr_getvar | ( | const char * | channel_name, |
const char * | name, | ||
char * | value, | ||
size_t | length | ||
) |
Retrieve a CDR variable from a channel's current CDR.
channel_name | The name of the party A channel that the CDR is associated with |
name | The name of the variable to retrieve |
value | Buffer to hold the value |
length | The size of the buffer |
0 | on success |
non-zero | on failure |
Definition at line 3403 of file cdr.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_log, AST_LOG_ERROR, ast_strlen_zero(), cdr_object_format_property(), cdr_object_format_var_internal(), cdr_object_get_by_name(), cdr_object::last, name, and value.
Referenced by AST_TEST_DEFINE(), cdr_read_callback(), and cdr_retrieve_time().
int ast_cdr_is_enabled | ( | void | ) |
Return TRUE if CDR subsystem is enabled.
Definition at line 2927 of file cdr.c.
References CDR_ENABLED, and is_cdr_flag_set().
Referenced by action_coresettings(), and handle_show_settings().
struct stasis_message_router * ast_cdr_message_router | ( | void | ) |
Return the message router for the CDR engine.
This returns the stasis_message_router that the CDR engine uses for dispatching Stasis Message Bus API messages. The reference on the message router is bumped and must be released by the caller of this function.
NULL | if the CDR engine is disabled or unavailable |
Definition at line 4373 of file cdr.c.
References ao2_bump, NULL, and stasis_router.
Referenced by cdr_prop_write(), cdr_read(), cdr_write(), forkcdr_exec(), load_module(), publish_app_cdr_message(), and unload_module().
int ast_cdr_modifier_register | ( | const char * | name, |
const char * | desc, | ||
ast_cdrbe | be | ||
) |
Register a CDR modifier.
name | name associated with the particular CDR modifier |
desc | description of the CDR modifier |
be | function pointer to a CDR modifier |
Used to register a Call Detail Record modifier.
This gives modules a chance to modify CDR fields before they are dispatched to registered backends (odbc, syslog, etc).
0 | on success. |
-1 | on error |
Definition at line 3014 of file cdr.c.
References be, cdr_generic_register(), desc, and name.
int ast_cdr_modifier_unregister | ( | const char * | name | ) |
Unregister a CDR modifier.
name | name of CDR modifier to unregister Unregisters a CDR modifier by its name |
0 | The modifier unregistered successfully |
-1 | The modifier could not be unregistered at this time |
Definition at line 3059 of file cdr.c.
References ast_cdr_generic_unregister(), and name.
int ast_cdr_register | ( | const char * | name, |
const char * | desc, | ||
ast_cdrbe | be | ||
) |
Register a CDR handling engine.
name | name associated with the particular CDR handler |
desc | description of the CDR handler |
be | function pointer to a CDR handler Used to register a Call Detail Record handler. |
0 | on success. |
-1 | on error |
Definition at line 3009 of file cdr.c.
References be, cdr_generic_register(), desc, and name.
Referenced by load_module(), odbc_load_module(), and unload_module().
int ast_cdr_reset | ( | const char * | channel_name, |
int | keep_variables | ||
) |
Reset the detail record.
channel_name | The channel that the CDR is associated with |
keep_variables | Keep the variables during the reset. If zero, variables are discarded during the reset. |
0 | on success |
-1 | on failure |
Definition at line 3677 of file cdr.c.
References cdr_object::answer, ao2_cleanup, ao2_lock, ao2_unlock, AST_LIST_REMOVE_HEAD, ast_tvnow(), ast_var_delete(), cdr_object_check_party_a_answer(), cdr_object_get_by_name(), cdr_object::end, cdr_object::lastevent, cdr_object::next, cdr_object::party_a, cdr_object::party_b, cdr_object_snapshot::snapshot, cdr_object::start, and cdr_object_snapshot::variables.
Referenced by appcdr_callback(), and dial_exec_full().
int ast_cdr_serialize_variables | ( | const char * | channel_name, |
struct ast_str ** | buf, | ||
char | delim, | ||
char | sep | ||
) |
Serializes all the data and variables for a current CDR record.
channel_name | The channel to get the CDR for |
buf | A buffer to use for formatting the data |
delim | A delimeter to use to separate variable keys/values |
sep | A separator to use between nestings |
Definition at line 3432 of file cdr.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_assert, AST_LIST_TRAVERSE, ast_log, AST_LOG_ERROR, ast_str_append(), ast_str_reset(), ast_strlen_zero(), ast_var_name(), ast_var_value(), buf, CDR_ENABLED, cdr_object_format_property(), cdr_object_get_by_name(), cdr_readonly_vars, ast_var_t::entries, is_cdr_flag_set(), LOG_ERROR, cdr_object::next, cdr_object::party_a, S_OR, total, var, and cdr_object_snapshot::variables.
Referenced by handle_showchan().
void ast_cdr_set_config | ( | struct ast_cdr_config * | config | ) |
Set the current CDR configuration.
config | The new CDR configuration |
Definition at line 2906 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ao2_replace, cdr_set_debug_mode, cdr_toggle_runtime_options(), config, and module_config::general.
Referenced by test_cdr_cleanup_cb().
int ast_cdr_set_property | ( | const char * | channel_name, |
enum ast_cdr_options | option | ||
) |
Set a property on a CDR for a channel.
This function sets specific administrative properties on a CDR for a channel. This includes properties like preventing a CDR from being dispatched, to setting the channel as the preferred Party A in future CDRs. See ast_cdr_options for more information.
channel_name | The CDR's channel |
option | Option to apply to the CDR |
0 | on success |
1 | on error |
Definition at line 3627 of file cdr.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_set_flag, cdr_object_get_by_name(), finalized_state_fn_table, cdr_object::flags, cdr_object::fn_table, cdr_object::next, and cdr_object::party_a.
Referenced by AST_TEST_DEFINE(), and cdr_prop_write_callback().
void ast_cdr_setuserfield | ( | const char * | channel_name, |
const char * | userfield | ||
) |
Set CDR user field for channel (stored in CDR)
channel_name | The name of the channel that owns the CDR |
userfield | The user field to set |
Definition at line 3556 of file cdr.c.
References active_cdrs_all, ao2_callback_data, ao2_cleanup, ao2_lock, ao2_unlock, ast_copy_string(), cdr_object_get_by_name(), cdr_object_update_party_b_userfield_cb(), party_b_userfield_update::channel_name, finalized_state_fn_table, cdr_object::fn_table, cdr_object::next, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_SEARCH_KEY, cdr_object::party_a, cdr_object_snapshot::userfield, and party_b_userfield_update::userfield.
Referenced by AST_TEST_DEFINE(), and cdr_write_callback().
int ast_cdr_setvar | ( | const char * | channel_name, |
const char * | name, | ||
const char * | value | ||
) |
Set a variable on a CDR.
channel_name | The channel to set the variable on |
name | The name of the variable to set |
value | The value of the variable to set |
0 | on success |
non-zero | on failure |
Definition at line 3249 of file cdr.c.
References active_cdrs_master, ao2_callback, ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_next, ao2_lock, ao2_unlock, ast_log, AST_LOG_ERROR, ast_strdupa, ast_channel_snapshot::base, cdr_object_select_all_by_name_cb(), cdr_readonly_vars, finalized_state_fn_table, cdr_object::fn_table, LOG_ERROR, name, ast_channel_snapshot_base::name, cdr_object::next, NULL, OBJ_MULTIPLE, cdr_object::party_a, cdr_object::party_b, set_variable(), cdr_object_snapshot::snapshot, value, and cdr_object_snapshot::variables.
Referenced by AST_TEST_DEFINE(), and cdr_write_callback().
int ast_cdr_unregister | ( | const char * | name | ) |
Unregister a CDR handling engine.
name | name of CDR handler to unregister Unregisters a CDR by it's name |
0 | The backend unregistered successfully |
-1 | The backend could not be unregistered at this time |
Definition at line 3054 of file cdr.c.
References ast_cdr_generic_unregister(), and name.
Referenced by load_module(), reload(), tds_unload_module(), and unload_module().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
|
static |
Definition at line 1654 of file cdr.c.
References BRIDGE_ENTER_NEED_CDR.
|
static |
|
static |
|
static |
Definition at line 1660 of file cdr.c.
References ast_assert, AST_CDR_LOCK_APP, ast_set_flag, ast_string_field_set, ast_channel_snapshot::base, cdr_object::flags, cdr_object::fn_table, ast_channel_snapshot_base::name, ast_parked_call_payload::parkee, ast_parked_call_payload::parkinglot, ast_parked_call_payload::parkingspace, cdr_object::party_a, cdr_object_fn_table::process_party_a, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 1583 of file cdr.c.
References ast_channel_snapshot_dialplan::appl, cdr_object::appl, ast_assert, AST_CDR_LOCK_APP, AST_FLAG_SUBROUTINE_EXEC, ast_set_flag, AST_SOFTHANGUP_HANGUP_EXEC, ast_string_field_set, ast_strlen_zero(), ast_test_flag, ast_channel_snapshot::base, CDR_END_BEFORE_H_EXTEN, cdr_object_check_party_a_answer(), cdr_object_check_party_a_hangup(), cdr_object_finalize(), cdr_object_swap_snapshot(), voicemailpwcheck::context, ast_channel_snapshot_dialplan::context, cdr_object::context, ast_channel_snapshot_dialplan::data, cdr_object::data, ast_channel_snapshot::dialplan, ast_channel_snapshot_dialplan::exten, cdr_object::exten, ast_channel_snapshot::flags, cdr_object::flags, is_cdr_flag_set(), ast_cdr::linkedid, ast_channel_snapshot_peer::linkedid, cdr_object::linkedid, ast_channel_snapshot_base::name, cdr_object::party_a, ast_channel_snapshot::peer, cdr_object_snapshot::snapshot, and ast_channel_snapshot::softhangup_flags.
Referenced by dialed_pending_state_process_party_a(), and single_state_process_dial_begin().
|
static |
Definition at line 2539 of file cdr.c.
References ast_string_field_set, ast_channel_snapshot::base, cdr_object::bridge, bridge_state_fn_table, cdr_all_relink(), CDR_DEBUG, cdr_object_check_party_a_answer(), cdr_object_create_and_append(), cdr_object_snapshot_copy(), cdr_object_transition_state(), cdr_object::lastevent, ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
Referenced by bridge_candidate_process().
|
static |
Process a single bridge_candidate
.
When a CDR enters a bridge, it needs to make pairings with everyone else that it is not currently paired with. This function determines, for the CDR for the channel that entered the bridge and the CDR for every other channel currently in the bridge, who is Party A and makes new CDRs.
cdr | The cdr_object being processed |
base_cand_cdr | The cdr_object that is a candidate |
Definition at line 2570 of file cdr.c.
References ao2_lock, ao2_unlock, ast_channel_snapshot::base, cdr_object::bridge, bridge_candidate_add_to_cdr(), cdr_all_relink(), CDR_DEBUG, cdr_object_pick_party_a(), cdr_object_snapshot_copy(), cdr_object::end, ast_channel_snapshot_base::name, cdr_object::next, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
Referenced by handle_bridge_pairings().
|
static |
Definition at line 2058 of file cdr.c.
References ast_channel_snapshot::base, cdr_object::bridge, cdr_object_transition_state(), finalized_state_fn_table, ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 2045 of file cdr.c.
References ast_assert, AST_FLAG_DEAD, ast_test_flag, ast_channel_snapshot::base, cdr_object_swap_snapshot(), cdr_object_transition_state(), finalized_state_fn_table, ast_channel_snapshot::flags, ast_channel_snapshot_base::name, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 956 of file cdr.c.
References ast_assert, CMP_MATCH, cdr_object::flags, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, OBJ_SEARCH_PARTIAL_KEY, and cdr_object::party_b_name.
Referenced by load_module().
|
static |
Definition at line 932 of file cdr.c.
References ast_assert, ast_str_case_hash(), cdr_object::flags, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and cdr_object::party_b_name.
Referenced by load_module().
|
static |
Definition at line 4553 of file cdr.c.
References ast_channel_snapshot::base, cdr_object::bridge, ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
Referenced by load_module().
|
static |
Definition at line 991 of file cdr.c.
References active_cdrs_all, ao2_link_flags, ao2_lock, ao2_unlink_flags, ao2_unlock, ast_string_field_set, ast_channel_snapshot::base, ast_channel_snapshot_base::name, OBJ_NOLOCK, cdr_object::party_b, cdr_object::party_b_name, and cdr_object_snapshot::snapshot.
Referenced by ast_cdr_fork(), bridge_candidate_add_to_cdr(), bridge_candidate_process(), single_state_bridge_enter_comparison(), and single_state_process_dial_begin().
|
static |
Definition at line 1012 of file cdr.c.
References active_cdrs_all, ao2_lock, ao2_ref, ao2_unlink_flags, ao2_unlock, ast_assert, ast_string_field_set, cdr_object::is_root, cdr_object::next, OBJ_NOLOCK, and cdr_object::party_b_name.
Referenced by cdr_object_dispatch_all_cb(), and handle_channel_snapshot_update_message().
|
static |
Definition at line 3920 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_calloc, ast_cdr_free(), ast_debug, ast_mutex_lock, ast_mutex_unlock, ast_test_flag, batch, cdr_batch_item::cdr, cdr_batch_lock, CDR_BATCHMODE, CDR_ENABLED, cdr_batch::head, init_batch(), cdr_batch_item::next, post_cdr(), RAII_VAR, cdr_batch::size, start_batch_mode(), and cdr_batch::tail.
Referenced by cdr_object_dispatch().
|
static |
Definition at line 4501 of file cdr.c.
References ast_cond_init, ast_log, ast_pthread_create_background, AST_PTHREADT_NULL, cdr_pending_cond, cdr_thread, config, do_cdr(), LOG_ERROR, LOG_NOTICE, NULL, and start_batch_mode().
Referenced by cdr_toggle_runtime_options().
|
static |
Definition at line 4470 of file cdr.c.
References aco_info_destroy(), active_cdrs_all, active_cdrs_master, ao2_callback, ao2_cleanup, ao2_container_unregister(), ao2_global_obj_release, ARRAY_LEN, ast_cli_unregister_multiple(), ast_free, ast_sched_context_destroy(), batch, cdr_object_dispatch_all_cb(), cdr_topic, cli_commands, finalize_batch_mode(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, stasis_message_router_unsubscribe_and_join(), STASIS_MESSAGE_TYPE_CLEANUP, and stasis_router.
Referenced by load_module().
|
static |
Definition at line 3084 of file cdr.c.
References AST_LIST_TRAVERSE, ast_strlen_zero(), ast_var_name(), ast_var_value(), ast_var_t::entries, name, NULL, and ast_cdr::varshead.
Referenced by ast_cdr_format_var().
|
static |
Definition at line 2968 of file cdr.c.
References ast_calloc, ast_copy_string(), ast_free, ast_log, AST_RWLIST_INSERT_HEAD, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, be, cdr_beitem::be, cdr_beitem::desc, desc, LOG_WARNING, cdr_beitem::name, and name.
Referenced by ast_cdr_modifier_register(), and ast_cdr_register().
|
static |
Definition at line 3101 of file cdr.c.
References ast_localtime(), ast_strftime(), buf, and NULL.
Referenced by ast_cdr_format_var(), cdr_object_format_property(), cli_show_channel(), and cli_show_channels().
|
static |
Definition at line 898 of file cdr.c.
References ast_assert, CMP_MATCH, cdr_object::flags, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, OBJ_SEARCH_PARTIAL_KEY, and cdr_object::uniqueid.
Referenced by load_module().
|
static |
Definition at line 874 of file cdr.c.
References ast_assert, ast_str_case_hash(), cdr_object::flags, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and cdr_object::uniqueid.
Referenced by load_module().
|
static |
Definition at line 4528 of file cdr.c.
References ast_channel_snapshot::base, cdr_object::bridge, ast_channel_snapshot_base::name, cdr_object::next, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
Referenced by load_module().
|
static |
cdr_object constructor
chan | The ast_channel_snapshot that is the CDR's Party A |
event_time |
This implicitly sets the state of the newly created CDR to the Single state (single_state_fn_table)
Definition at line 1080 of file cdr.c.
References ao2_alloc, ao2_cleanup, ao2_t_ref, ast_assert, ast_atomic_fetchadd_int(), AST_CDR_NULL, ast_string_field_init, ast_string_field_set, ast_channel_snapshot::base, CDR_DEBUG, cdr_object_dtor(), cdr_object_transition_state(), cdr_object::disposition, global_cdr_sequence, cdr_object::last, cdr_object::lastevent, ast_channel_snapshot_peer::linkedid, cdr_object::linkedid, name, ast_channel_snapshot_base::name, NULL, cdr_object::party_a, ast_channel_snapshot::peer, cdr_object::sequence, single_state_fn_table, cdr_object_snapshot::snapshot, ast_channel_snapshot_base::tenantid, cdr_object::tenantid, ast_channel_snapshot_base::uniqueid, and cdr_object::uniqueid.
Referenced by cdr_object_create_and_append(), and handle_channel_snapshot_update_message().
|
static |
Check to see if a CDR needs to be answered based on its Party A. Note that this is safe to call as much as you want - we won't answer twice.
Definition at line 1537 of file cdr.c.
References cdr_object::answer, AST_STATE_UP, ast_tvzero(), CDR_DEBUG, cdr_object::lastevent, cdr_object::party_a, cdr_object_snapshot::snapshot, and ast_channel_snapshot::state.
Referenced by ast_cdr_reset(), base_process_party_a(), bridge_candidate_add_to_cdr(), and single_state_init_function().
|
static |
Check to see if a CDR needs to move to the finalized state because its Party A hungup.
Definition at line 1520 of file cdr.c.
References AST_FLAG_DEAD, AST_SOFTHANGUP_HANGUP_EXEC, ast_test_flag, CDR_END_BEFORE_H_EXTEN, cdr_object_finalize(), cdr_object_transition_state(), finalized_state_fn_table, ast_channel_snapshot::flags, cdr_object::fn_table, is_cdr_flag_set(), cdr_object::party_a, cdr_object_snapshot::snapshot, and ast_channel_snapshot::softhangup_flags.
Referenced by base_process_party_a().
|
static |
Create a new cdr_object and append it to an existing chain.
cdr | The cdr_object to append to |
event_time |
Definition at line 1118 of file cdr.c.
References cdr_object::appl, AST_CDR_FLAG_DISABLE_ALL, AST_CDR_NULL, ast_set_flag, ast_string_field_set, ast_test_flag, cdr_object_alloc(), cdr_object_snapshot_copy(), voicemailpwcheck::context, cdr_object::context, cdr_object::data, cdr_object::disposition, cdr_object::exten, cdr_object::flags, cdr_object::last, cdr_object::linkedid, cdr_object::next, NULL, cdr_object::party_a, and cdr_object_snapshot::snapshot.
Referenced by ast_cdr_fork(), bridge_candidate_add_to_cdr(), handle_channel_snapshot_update_message(), handle_dial_message(), handle_parked_call_message(), handle_parking_bridge_enter_message(), and handle_standard_bridge_enter_message().
|
static |
Create a chain of ast_cdr objects from a chain of cdr_object suitable for consumption by the registered CDR backends.
cdr | The cdr_object to convert to a public record |
NULL | on failure |
Definition at line 1328 of file cdr.c.
References ast_cdr::accountcode, ast_channel_snapshot_base::accountcode, ast_cdr::amaflags, ast_channel_snapshot::amaflags, ast_cdr::answer, cdr_object::answer, cdr_object::appl, ast_assert, ast_callerid_merge(), ast_calloc, ast_copy_flags, ast_copy_string(), ast_debug, AST_FLAGS_ALL, ast_free, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, ast_strlen_zero(), ast_var_assign, ast_var_name(), ast_var_value(), ast_channel_snapshot::base, ast_cdr::billsec, ast_channel_snapshot::caller, cdr_object_get_billsec(), cdr_object_get_duration(), ast_cdr::channel, ast_cdr::clid, cdr_object::context, copy_variables(), cdr_object::data, ast_cdr::dcontext, ast_cdr::disposition, cdr_object::disposition, ast_cdr::dst, ast_cdr::dstchannel, ast_cdr::duration, ast_cdr::end, cdr_object::end, ast_var_t::entries, cdr_object::exten, cdr_object::flags, ast_cdr::lastapp, ast_cdr::lastdata, ast_cdr::linkedid, cdr_object::linkedid, ast_channel_snapshot_caller::name, ast_channel_snapshot_base::name, ast_cdr::next, cdr_object::next, NULL, ast_channel_snapshot_caller::number, cdr_object::party_a, cdr_object::party_b, ast_cdr::peeraccount, ast_cdr::peertenantid, ast_cdr::sequence, cdr_object::sequence, cdr_object_snapshot::snapshot, snapshot_is_dialed(), ast_cdr::src, ast_cdr::start, cdr_object::start, ast_cdr::tenantid, ast_channel_snapshot_base::tenantid, cdr_object::tenantid, ast_cdr::uniqueid, ast_channel_snapshot_base::uniqueid, ast_cdr::userfield, cdr_object_snapshot::userfield, cdr_object_snapshot::variables, and ast_cdr::varshead.
Referenced by cdr_object_dispatch().
|
static |
Dispatch a CDR.
cdr | The cdr_object to dispatch |
This will create a ast_cdr object and publish it to the various backends
Definition at line 1429 of file cdr.c.
References ast_channel_snapshot::base, CDR_DEBUG, cdr_detach(), cdr_object_create_public_records(), ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
Referenced by cdr_object_dispatch_all_cb(), and handle_channel_snapshot_update_message().
|
static |
This dispatches all cdr_object. It should only be used during shutdown, so that we get billing records for everything that we can.
Definition at line 4342 of file cdr.c.
References ao2_lock, ao2_unlock, cdr_all_unlink(), cdr_object_dispatch(), cdr_object_transition_state(), CMP_MATCH, finalized_state_fn_table, and cdr_object::next.
Referenced by cdr_engine_shutdown().
|
static |
cdr_object Destructor
Definition at line 1039 of file cdr.c.
References ao2_cleanup, AST_LIST_REMOVE_HEAD, ast_string_field_free_memory, ast_var_delete(), ast_var_t::entries, cdr_object::is_root, cdr_object::next, cdr_object::party_a, cdr_object::party_b, cdr_object_snapshot::snapshot, and cdr_object_snapshot::variables.
Referenced by cdr_object_alloc().
|
static |
Finalize a CDR.
This function is safe to call multiple times. Note that you can call this explicitly before going to the finalized state if there's a chance the CDR will be re-activated, in which case the cdr's
end time should be cleared. This function is implicitly called when a CDR transitions to the finalized state and right before it is dispatched
cdr | The CDR to finalize |
Definition at line 1483 of file cdr.c.
References cdr_object::answer, AST_CDR_ANSWERED, ast_cdr_disp2str(), AST_CDR_FAILED, AST_CDR_NULL, ast_debug, ast_tvdiff_ms(), ast_tvzero(), ast_channel_snapshot::base, ast_channel_snapshot_hangup::cause, cdr_object_set_disposition(), cdr_object::disposition, cdr_object::end, ast_channel_snapshot::hangup, cdr_object::lastevent, ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, cdr_object_snapshot::snapshot, and cdr_object::start.
Referenced by ast_cdr_fork(), base_process_party_a(), cdr_object_check_party_a_hangup(), cdr_object_finalize_party_b(), cdr_object_party_b_left_bridge_cb(), dial_state_process_bridge_enter(), finalized_state_init_function(), handle_channel_snapshot_update_message(), handle_standard_bridge_enter_message(), and single_state_bridge_enter_comparison().
|
static |
Definition at line 2252 of file cdr.c.
References ast_assert, ast_channel_snapshot::base, cdr_object_finalize(), ast_channel_snapshot_base::name, cdr_object::party_b, cdr_object::party_b_name, and cdr_object_snapshot::snapshot.
Referenced by handle_channel_snapshot_update_message().
|
static |
Format one of the standard properties on a cdr_object.
Definition at line 3314 of file cdr.c.
References ast_channel_snapshot_base::accountcode, ast_channel_snapshot::amaflags, cdr_object::answer, ast_channel_snapshot_dialplan::appl, ast_callerid_merge(), ast_copy_string(), ast_channel_snapshot::base, ast_channel_snapshot::caller, cdr_get_tv(), cdr_object_get_billsec(), cdr_object_get_duration(), ast_channel_snapshot_dialplan::context, ast_channel_snapshot_dialplan::data, ast_channel_snapshot::dialplan, cdr_object::disposition, cdr_object::end, ast_channel_snapshot_dialplan::exten, cdr_object::linkedid, name, ast_channel_snapshot_caller::name, ast_channel_snapshot_base::name, NULL, ast_channel_snapshot_caller::number, cdr_object::party_a, cdr_object::party_b, cdr_object::sequence, cdr_object_snapshot::snapshot, cdr_object::start, ast_channel_snapshot_base::tenantid, ast_channel_snapshot_base::uniqueid, cdr_object_snapshot::userfield, and value.
Referenced by ast_cdr_getvar(), and ast_cdr_serialize_variables().
|
static |
Format a variable on a cdr_object.
Definition at line 3297 of file cdr.c.
References ast_copy_string(), AST_LIST_TRAVERSE, ast_var_name(), ast_var_value(), ast_var_t::entries, name, cdr_object::party_a, value, and cdr_object_snapshot::variables.
Referenced by ast_cdr_getvar().
|
static |
Compute the billsec for a cdr_object.
Definition at line 1276 of file cdr.c.
References cdr_object::answer, ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), CDR_INITIATED_SECONDS, cdr_object::end, and is_cdr_flag_set().
Referenced by cdr_object_create_public_records(), and cdr_object_format_property().
|
static |
Definition at line 3391 of file cdr.c.
References active_cdrs_master, ao2_callback, ast_strdupa, ast_strlen_zero(), cdr_object_get_by_name_cb(), name, and NULL.
Referenced by ast_cdr_clear_property(), ast_cdr_fork(), ast_cdr_getvar(), ast_cdr_reset(), ast_cdr_serialize_variables(), ast_cdr_set_property(), ast_cdr_setuserfield(), and cli_show_channel().
|
static |
Definition at line 3212 of file cdr.c.
References ast_channel_snapshot::base, CMP_MATCH, name, ast_channel_snapshot_base::name, cdr_object::party_a, and cdr_object_snapshot::snapshot.
Referenced by cdr_object_get_by_name().
|
static |
Compute the duration for a cdr_object
Definition at line 1268 of file cdr.c.
References ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), cdr_object::end, and cdr_object::start.
Referenced by cdr_object_create_public_records(), and cdr_object_format_property().
|
static |
Callback used to notify CDRs of a Party B leaving the bridge.
Definition at line 2429 of file cdr.c.
References ast_assert, ast_channel_snapshot::base, cdr_object::bridge, bridge_leave_data::bridge, bridge_state_fn_table, cdr_object_finalize(), bridge_leave_data::channel, cdr_object::fn_table, cdr_object::lastevent, bridge_leave_data::lastevent, ast_channel_snapshot_base::name, cdr_object::party_b, cdr_object::party_b_name, cdr_object_snapshot::snapshot, and ast_bridge_snapshot::uniqueid.
Referenced by handle_bridge_leave_message().
|
static |
Given two CDR snapshots, figure out who should be Party A for the resulting CDR.
left | One of the snapshots |
right | The other snapshot |
Definition at line 1233 of file cdr.c.
References AST_CDR_FLAG_PARTY_A, ast_test_flag, ast_channel_snapshot::base, ast_channel_snapshot_base::creationtime, cdr_object_snapshot::snapshot, and snapshot_is_dialed().
Referenced by bridge_candidate_process(), and single_state_bridge_enter_comparison().
|
static |
Definition at line 3196 of file cdr.c.
References ast_channel_snapshot::base, CMP_MATCH, name, ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
Referenced by ast_cdr_setvar().
|
static |
Set the disposition on a cdr_object based on a hangupcause code.
cdr | The cdr_object |
hangupcause | The Asterisk hangup cause code |
Definition at line 1445 of file cdr.c.
References AST_CAUSE_BUSY, AST_CAUSE_CONGESTION, AST_CAUSE_NO_ANSWER, AST_CAUSE_NO_ROUTE_DESTINATION, AST_CAUSE_NORMAL_CLEARING, AST_CAUSE_UNREGISTERED, AST_CDR_BUSY, AST_CDR_CONGESTION, AST_CDR_FAILED, AST_CDR_NOANSWER, CDR_CONGESTION, cdr_object::disposition, and is_cdr_flag_set().
Referenced by cdr_object_finalize().
|
static |
Copy a snapshot and its details.
dst | The destination |
src | The source |
Definition at line 834 of file cdr.c.
References ao2_t_replace, copy_variables(), cdr_object_snapshot::flags, cdr_object_snapshot::snapshot, cdr_object_snapshot::userfield, and cdr_object_snapshot::variables.
Referenced by bridge_candidate_add_to_cdr(), bridge_candidate_process(), cdr_object_create_and_append(), dial_state_process_bridge_enter(), and single_state_bridge_enter_comparison().
|
static |
Swap an old cdr_object_snapshot's ast_channel_snapshot for a new ast_channel_snapshot.
old_snapshot | The old cdr_object_snapshot |
new_snapshot | The new ast_channel_snapshot for old_snapshot |
Definition at line 1574 of file cdr.c.
References ao2_t_replace, cdr_object_update_cid(), and cdr_object_snapshot::snapshot.
Referenced by base_process_party_a(), bridge_state_process_party_b(), dial_state_process_dial_end(), dial_state_process_party_b(), and single_state_process_dial_begin().
|
static |
Transition a cdr_object to a new state.
cdr | The cdr_object to transition |
fn_table | The cdr_object_fn_table state to go to |
Definition at line 865 of file cdr.c.
References cdr_object_transition_state_init().
Referenced by ast_cdr_fork(), bridge_candidate_add_to_cdr(), bridge_state_process_bridge_leave(), bridge_state_process_party_b(), cdr_object_alloc(), cdr_object_check_party_a_hangup(), cdr_object_dispatch_all_cb(), dial_state_process_bridge_enter(), dial_state_process_dial_end(), dial_state_process_party_b(), dialed_pending_state_process_bridge_enter(), dialed_pending_state_process_dial_begin(), dialed_pending_state_process_parking_bridge_enter(), dialed_pending_state_process_party_a(), handle_parking_bridge_enter_message(), parked_state_process_bridge_leave(), single_state_process_bridge_enter(), single_state_process_dial_begin(), and single_state_process_parking_bridge_enter().
|
static |
Transition a cdr_object to a new state with initiation flag.
cdr | The cdr_object to transition |
fn_table | The cdr_object_fn_table state to go to |
do_init |
Definition at line 848 of file cdr.c.
References ast_channel_snapshot::base, CDR_DEBUG, cdr_object::fn_table, cdr_object_fn_table::init_function, ast_channel_snapshot_base::name, cdr_object_fn_table::name, cdr_object::party_a, and cdr_object_snapshot::snapshot.
Referenced by cdr_object_transition_state(), and dialed_pending_state_process_party_a().
|
static |
Set Caller ID information on a CDR.
Definition at line 1549 of file cdr.c.
References ast_channel_snapshot::caller, ast_channel_snapshot_caller::dialed_subaddr, ast_channel_snapshot_caller::dnid, set_variable(), cdr_object_snapshot::snapshot, ast_channel_snapshot_caller::subaddr, and cdr_object_snapshot::variables.
Referenced by cdr_object_swap_snapshot().
|
static |
Definition at line 2276 of file cdr.c.
References ast_log, ast_channel_snapshot::base, cdr_object::fn_table, cdr_object::linkedid, LOG_NOTICE, ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, cdr_object::party_b_name, cdr_object_fn_table::process_party_b, and cdr_object_snapshot::snapshot.
Referenced by handle_channel_snapshot_update_message().
|
static |
Callback used to update the userfield on Party B on all CDRs.
Definition at line 3534 of file cdr.c.
References ast_assert, ast_copy_string(), ast_channel_snapshot::base, finalized_state_fn_table, cdr_object::fn_table, sip_to_pjsip::info(), ast_channel_snapshot_base::name, cdr_object::next, cdr_object::party_b, cdr_object::party_b_name, cdr_object_snapshot::snapshot, and cdr_object_snapshot::userfield.
Referenced by ast_cdr_setuserfield().
|
static |
Definition at line 3845 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_debug, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_pthread_create_detached_background, AST_PTHREADT_NULL, ast_test_flag, batch, BATCH_MODE_SCHEDULER_ONLY, ast_cdr_config::batch_settings, cdr_batch_lock, do_batch_backend_process(), module_config::general, cdr_batch::head, LOG_WARNING, NULL, reset_batch(), and ast_cdr_config::batch_settings::settings.
Referenced by ast_cdr_engine_term(), and submit_scheduled_batch().
|
static |
Checks if CDRs are enabled and enables/disables the necessary options.
Definition at line 4569 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_log, AST_LOG_ERROR, ast_test_flag, CDR_BATCHMODE, cdr_enable_batch_mode(), CDR_ENABLED, create_subscriptions(), destroy_subscriptions(), module_config::general, LOG_NOTICE, and ast_cdr_config::settings.
Referenced by ast_cdr_set_config(), load_module(), and reload_module().
|
static |
Determine if we need to add a new CDR based on snapshots.
Definition at line 2305 of file cdr.c.
References ast_channel_snapshot_dialplan::appl, AST_SOFTHANGUP_HANGUP_EXEC, ast_strlen_zero(), ast_test_flag, CDR_END_BEFORE_H_EXTEN, ast_channel_snapshot::dialplan, is_cdr_flag_set(), snapshot_cep_changed(), and ast_channel_snapshot::softhangup_flags.
Referenced by handle_channel_snapshot_update_message().
|
static |
Complete user input for 'cdr show'.
Definition at line 4049 of file cdr.c.
References a, active_cdrs_master, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_cli_completion_add(), ast_strdup, ast_channel_snapshot::base, ast_channel_snapshot_base::name, NULL, cdr_object::party_a, and cdr_object_snapshot::snapshot.
Referenced by handle_cli_show().
|
static |
Definition at line 4134 of file cdr.c.
References a, ast_channel_snapshot_base::accountcode, cdr_object::answer, ao2_cleanup, ao2_lock, ao2_unlock, cdr_object::appl, ast_callerid_merge(), ast_cli(), ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), ast_channel_snapshot::base, ast_channel_snapshot::caller, cdr_get_tv(), cdr_object_get_by_name(), cdr_object::data, end, cdr_object::end, FORMAT_STRING, ast_channel_snapshot_caller::name, ast_channel_snapshot_base::name, cdr_object::next, ast_channel_snapshot_caller::number, cdr_object::party_a, cdr_object::party_b, cdr_object_snapshot::snapshot, snapshot_is_dialed(), cdr_object::start, and TITLE_STRING.
Referenced by handle_cli_show().
|
static |
Definition at line 4070 of file cdr.c.
References a, active_cdrs_master, cdr_object::answer, ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, cdr_object::appl, ast_cli(), ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), ast_channel_snapshot::base, cdr_get_tv(), cdr_object::end, FORMAT_STRING, cdr_object::last, lock, ast_channel_snapshot_base::name, cdr_object::next, cdr_object::party_a, cdr_object::party_b, SCOPED_AO2LOCK, cdr_object_snapshot::snapshot, snapshot_is_dialed(), cdr_object::start, and TITLE_STRING.
Referenced by handle_cli_show().
CONFIG_INFO_CORE | ( | "cdr" | , |
cfg_info | , | ||
module_configs | , | ||
module_config_alloc | , | ||
. | files = ACO_FILES(&module_file_conf) , |
||
. | post_apply_config = module_config_post_apply |
||
) |
Copy variables from one list to another.
to_list | destination |
from_list | source |
Definition at line 789 of file cdr.c.
References AST_LIST_INSERT_HEAD, AST_LIST_TRAVERSE, ast_strlen_zero(), ast_var_assign, ast_var_name(), ast_var_value(), ast_var_t::entries, and var.
Referenced by ast_cdr_dup(), ast_cdr_fork(), cdr_object_create_public_records(), and cdr_object_snapshot_copy().
|
static |
Create the Stasis subcriptions for CDRs.
Definition at line 4396 of file cdr.c.
References ast_bridge_topic_all(), ast_channel_topic_all(), ast_parking_topic(), bridge_subscription, cdr_topic, channel_subscription, parking_subscription, and stasis_forward_all().
Referenced by cdr_toggle_runtime_options().
|
static |
Destroy the active Stasis subscriptions.
Definition at line 4386 of file cdr.c.
References bridge_subscription, channel_subscription, parking_subscription, and stasis_forward_cancel().
Referenced by cdr_toggle_runtime_options(), and unload_module().
|
static |
Definition at line 1923 of file cdr.c.
References active_cdrs_master, ao2_cleanup, ao2_container_count(), ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_string_field_set, ast_channel_snapshot::base, ast_channel_snapshot::bridge, cdr_object::bridge, BRIDGE_ENTER_NO_PARTY_B, BRIDGE_ENTER_OBTAINED_PARTY_B, BRIDGE_ENTER_ONLY_PARTY, bridge_state_fn_table, cdr_object_finalize(), cdr_object_snapshot_copy(), cdr_object_transition_state(), ast_bridge_snapshot::channels, cdr_object::fn_table, ast_channel_snapshot_base::name, cdr_object::next, OBJ_SEARCH_KEY, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
|
static |
Definition at line 1891 of file cdr.c.
References ast_assert, AST_CDR_ANSWERED, ast_channel_snapshot::base, ast_channel_snapshot::caller, cdr_object_swap_snapshot(), cdr_object_transition_state(), dial_status_to_disposition(), dialed_pending_state_fn_table, cdr_object::disposition, finalized_state_fn_table, ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, ast_channel_snapshot::peer, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 1845 of file cdr.c.
References ast_assert, AST_FLAG_DEAD, ast_test_flag, ast_channel_snapshot::base, cdr_object_swap_snapshot(), cdr_object_transition_state(), finalized_state_fn_table, ast_channel_snapshot::flags, ast_channel_snapshot_base::name, NULL, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 2132 of file cdr.c.
Referenced by handle_dial_message().
|
static |
Definition at line 1871 of file cdr.c.
References AST_CDR_ANSWERED, AST_CDR_BUSY, AST_CDR_CONGESTION, AST_CDR_FAILED, AST_CDR_NOANSWER, CDR_CONGESTION, and is_cdr_flag_set().
Referenced by dial_state_process_dial_end(), and handle_dial_message().
|
static |
Definition at line 2019 of file cdr.c.
References cdr_object::bridge, cdr_object_transition_state(), dial_state_fn_table, cdr_object::fn_table, and cdr_object_fn_table::process_bridge_enter.
|
static |
Definition at line 2035 of file cdr.c.
References cdr_object_transition_state(), and finalized_state_fn_table.
|
static |
Definition at line 2025 of file cdr.c.
References cdr_object_transition_state(), parked_state_fn_table, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 1994 of file cdr.c.
References base_process_party_a(), cdr_object_transition_state(), cdr_object_transition_state_init(), finalized_state_fn_table, cdr_object::fn_table, cdr_object::party_a, cdr_object::party_b, cdr_object_fn_table::process_party_a, single_state_fn_table, cdr_object_snapshot::snapshot, and snapshot_cep_changed().
|
static |
Definition at line 3828 of file cdr.c.
References ast_cdr_free(), ast_free, cdr_batch_item::cdr, cdr_batch_item::next, NULL, and post_cdr().
Referenced by cdr_submit_batch().
|
static |
Definition at line 3982 of file cdr.c.
References ast_cond_timedwait, ast_debug, ast_mutex_lock, ast_mutex_unlock, ast_samp2tv(), ast_sched_runq(), ast_sched_wait(), ast_tvadd(), ast_tvnow(), cdr_pending_cond, cdr_pending_lock, and NULL.
Referenced by cdr_enable_batch_mode().
|
static |
Filter bridge messages based on bridge technology.
Definition at line 2454 of file cdr.c.
References bridge_leave_data::bridge, ast_bridge_snapshot::subclass, and ast_bridge_snapshot::technology.
Referenced by handle_bridge_enter_message(), and handle_bridge_leave_message().
|
static |
Definition at line 2107 of file cdr.c.
References AST_CHAN_TP_INTERNAL, ast_channel_snapshot::base, and ast_channel_snapshot_base::tech_properties.
Referenced by filter_channel_snapshot_message(), handle_bridge_enter_message(), handle_bridge_leave_message(), handle_dial_message(), and handle_parked_call_message().
|
static |
Definition at line 2116 of file cdr.c.
References filter_channel_snapshot().
Referenced by handle_channel_snapshot_update_message().
|
static |
Definition at line 4359 of file cdr.c.
References ast_cdr_engine_term(), ast_cond_destroy, AST_PTHREADT_NULL, cdr_pending_cond, cdr_thread, and NULL.
Referenced by cdr_engine_shutdown(), and reload_module().
|
static |
Definition at line 2087 of file cdr.c.
References cdr_object_finalize().
|
static |
Definition at line 2092 of file cdr.c.
References AST_SOFTHANGUP_HANGUP_EXEC, ast_test_flag, CDR_END_BEFORE_H_EXTEN, is_cdr_flag_set(), and ast_channel_snapshot::softhangup_flags.
|
static |
Delete all variables from a variable list.
headp | The head pointer to the variable list to delete |
Definition at line 820 of file cdr.c.
References AST_LIST_REMOVE_HEAD, ast_var_delete(), and ast_var_t::entries.
Referenced by ast_cdr_fork(), and ast_cdr_free().
|
static |
Definition at line 2776 of file cdr.c.
References active_cdrs_master, ao2_cleanup, ao2_find, ast_assert, ast_log, AST_LOG_WARNING, ast_channel_snapshot::base, cdr_object::bridge, CDR_DEBUG, filter_bridge_messages(), filter_channel_snapshot(), handle_parking_bridge_enter_message(), handle_standard_bridge_enter_message(), ast_channel_snapshot_base::name, OBJ_SEARCH_KEY, stasis_message_data(), stasis_message_timestamp(), ast_channel_snapshot_base::uniqueid, and update().
Referenced by load_module().
|
static |
Handler for when a channel leaves a bridge.
data | Passed on |
sub | The stasis subscription for this message callback |
message | The message - hopefully a bridge one! |
Definition at line 2471 of file cdr.c.
References active_cdrs_all, active_cdrs_master, ao2_callback_data, ao2_cleanup, ao2_find, ao2_lock, ao2_unlock, ast_assert, ast_log, AST_LOG_WARNING, ast_string_field_set, ast_channel_snapshot::base, bridge_leave_data::bridge, CDR_DEBUG, cdr_object_party_b_left_bridge_cb(), bridge_leave_data::channel, filter_bridge_messages(), filter_channel_snapshot(), cdr_object::fn_table, cdr_object::lastevent, bridge_leave_data::lastevent, ast_channel_snapshot_base::name, cdr_object::next, OBJ_MULTIPLE, OBJ_NODATA, OBJ_SEARCH_KEY, cdr_object_fn_table::process_bridge_leave, stasis_message_data(), stasis_message_timestamp(), ast_bridge_snapshot::subclass, ast_channel_snapshot_base::uniqueid, and update().
Referenced by load_module().
|
static |
Handle creating bridge pairings for the cdr_object that just entered a bridge.
cdr | The cdr_object that just entered the bridge |
bridge | The ast_bridge_snapshot representing the bridge it just entered |
Definition at line 2628 of file cdr.c.
References active_cdrs_master, ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, bridge_candidate_process(), ast_bridge_snapshot::channels, and OBJ_SEARCH_KEY.
Referenced by handle_standard_bridge_enter_message().
|
static |
Handler for a synchronization message.
data | Passed on |
sub | The stasis subscription for this message callback |
message | A blank ao2 object |
Definition at line 2886 of file cdr.c.
Referenced by load_module().
|
static |
Handler for channel snapshot update messages.
data | Passed on |
sub | The stasis subscription for this message callback |
message | The message |
Definition at line 2333 of file cdr.c.
References active_cdrs_all, active_cdrs_master, ao2_callback_data, ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_link, ao2_lock, ao2_unlink, ao2_unlock, ast_assert, AST_CDR_FLAG_DISABLE_ALL, ast_debug, AST_FLAG_DEAD, ast_log, AST_LOG_WARNING, ast_set_flag, ast_test_flag, cdr_all_unlink(), CDR_CHANNEL_DEFAULT_ENABLED, CDR_DEBUG, cdr_object_alloc(), cdr_object_create_and_append(), cdr_object_dispatch(), cdr_object_finalize(), cdr_object_finalize_party_b(), cdr_object_update_party_b(), check_new_cdr_needed(), filter_channel_snapshot_message(), cdr_object::flags, cdr_object::fn_table, module_config::general, cdr_object::is_root, cdr_object::lastevent, cdr_object::next, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_SEARCH_KEY, cdr_object_fn_table::process_party_a, ast_cdr_config::settings, stasis_message_data(), stasis_message_timestamp(), and update().
Referenced by load_module().
|
static |
Definition at line 4008 of file cdr.c.
References a, ao2_cleanup, ao2_global_obj_ref, ast_clear_flag, ast_cli(), ast_set_flag, ast_test_flag, CDR_DEBUG, cdr_set_debug_mode, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, module_config::general, NULL, ast_cdr_config::settings, and ast_cli_entry::usage.
|
static |
Definition at line 4194 of file cdr.c.
References a, cli_complete_show(), CLI_GENERATE, CLI_INIT, cli_show_channel(), cli_show_channels(), CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 4224 of file cdr.c.
References a, ao2_cleanup, ao2_global_obj_ref, ast_cli(), AST_RWLIST_EMPTY, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_sched_when(), ast_test_flag, batch, BATCH_MODE_SAFE_SHUTDOWN, BATCH_MODE_SCHEDULER_ONLY, ast_cdr_config::batch_settings, CDR_BATCHMODE, CDR_CHANNEL_DEFAULT_ENABLED, CDR_CONGESTION, CDR_ENABLED, CDR_IGNORE_DIAL_CHANGES, CDR_IGNORE_STATE_CHANGES, cdr_sched, CDR_UNANSWERED, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ESS, module_config::general, cdr_beitem::name, NULL, ast_cdr_config::settings, ast_cdr_config::batch_settings::settings, ast_cdr_config::batch_settings::size, cdr_batch::size, ast_cdr_config::batch_settings::time, and ast_cli_entry::usage.
|
static |
Definition at line 4294 of file cdr.c.
References a, ao2_cleanup, ao2_global_obj_ref, ast_cli(), ast_test_flag, CDR_BATCHMODE, CDR_ENABLED, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, module_config::general, NULL, ast_cdr_config::settings, start_batch_mode(), and ast_cli_entry::usage.
|
static |
Handler for Stasis-Core dial messages.
data | Passed on |
sub | The stasis subscription for this message callback |
message | The message |
Definition at line 2147 of file cdr.c.
References active_cdrs_master, ao2_cleanup, ao2_find, ao2_lock, ao2_unlock, ast_assert, ast_json_object_get(), ast_json_string_get(), ast_log, AST_LOG_WARNING, ast_multi_channel_blob_get_channel(), ast_multi_channel_blob_get_json(), ast_strlen_zero(), ast_channel_snapshot::base, ast_channel_snapshot::caller, CDR_DEBUG, cdr_object_create_and_append(), dial_changes_ignored, dial_status_end(), dial_status_to_disposition(), cdr_object::disposition, filter_channel_snapshot(), cdr_object::fn_table, cdr_object::lastevent, ast_channel_snapshot_base::name, cdr_object::next, NULL, OBJ_SEARCH_KEY, ast_channel_snapshot::peer, cdr_object_fn_table::process_dial_begin, cdr_object_fn_table::process_dial_end, stasis_message_data(), stasis_message_timestamp(), and ast_channel_snapshot_base::uniqueid.
Referenced by load_module().
|
static |
Handler for when a channel is parked.
data | Passed on |
sub | The stasis subscription for this message callback |
message | The message about who got parked |
Definition at line 2818 of file cdr.c.
References active_cdrs_master, ao2_cleanup, ao2_find, ao2_lock, ao2_unlock, ast_assert, ast_log, AST_LOG_WARNING, ast_channel_snapshot::base, CDR_DEBUG, cdr_object_create_and_append(), ast_parked_call_payload::event_type, filter_channel_snapshot(), cdr_object::fn_table, cdr_object::lastevent, ast_channel_snapshot_base::name, cdr_object::next, OBJ_SEARCH_KEY, PARKED_CALL, ast_parked_call_payload::parkee, cdr_object_fn_table::process_parked_channel, stasis_message_data(), stasis_message_timestamp(), and ast_channel_snapshot_base::uniqueid.
Referenced by load_module().
|
static |
Handle entering into a parking bridge.
cdr | The CDR to operate on |
bridge | The bridge the channel just entered |
channel | The channel snapshot |
event_time |
Definition at line 2654 of file cdr.c.
References ao2_lock, ao2_unlock, ast_channel_snapshot::base, cdr_object::bridge, CDR_DEBUG, cdr_object_create_and_append(), cdr_object_transition_state(), cdr_object::fn_table, cdr_object::lastevent, ast_channel_snapshot_base::name, cdr_object::next, cdr_object_fn_table::process_parking_bridge_enter, cdr_object_fn_table::process_party_a, and single_state_fn_table.
Referenced by handle_bridge_enter_message().
|
static |
Handle a bridge enter message for a 'normal' bridge.
cdr | The CDR to operate on |
bridge | The bridge the channel just entered |
channel | The channel snapshot |
event_time |
Definition at line 2696 of file cdr.c.
References ao2_lock, ao2_unlock, ast_channel_snapshot::base, cdr_object::bridge, BRIDGE_ENTER_NEED_CDR, BRIDGE_ENTER_NO_PARTY_B, BRIDGE_ENTER_OBTAINED_PARTY_B, BRIDGE_ENTER_ONLY_PARTY, CDR_DEBUG, cdr_object_create_and_append(), cdr_object_finalize(), cdr_object::fn_table, handle_bridge_pairings(), cdr_object::lastevent, ast_channel_snapshot_base::name, cdr_object::next, NULL, cdr_object_fn_table::process_bridge_enter, cdr_object_fn_table::process_party_a, and result.
Referenced by handle_bridge_enter_message().
|
static |
Definition at line 3817 of file cdr.c.
References ast_malloc, batch, and reset_batch().
Referenced by cdr_detach().
|
static |
Definition at line 1168 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_test_flag, module_config::general, and ast_cdr_config::settings.
Referenced by ast_cdr_is_enabled(), ast_cdr_serialize_variables(), base_process_party_a(), cdr_object_check_party_a_hangup(), cdr_object_get_billsec(), cdr_object_set_disposition(), check_new_cdr_needed(), dial_status_to_disposition(), finalized_state_process_party_a(), and snapshot_cep_changed().
|
static |
Definition at line 4603 of file cdr.c.
References active_cdrs_all, active_cdrs_master, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_cleanup, ao2_container_alloc_hash, ao2_container_register(), ao2_global_obj_ref, ARRAY_LEN, ast_channel_dial_type(), ast_channel_entered_bridge_type(), ast_channel_left_bridge_type(), ast_channel_snapshot_type(), ast_cli_register_multiple, ast_log, AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_SUCCESS, AST_NUM_CHANNEL_BUCKETS, ast_parked_call_type(), ast_register_atexit(), ast_sched_context_create(), AST_TASKPROCESSOR_HIGH_WATER_LEVEL, ast_test_flag, cdr_all_cmp_fn(), cdr_all_hash_fn(), cdr_all_print_fn(), CDR_DEBUG, cdr_engine_shutdown(), CDR_IGNORE_DIAL_CHANGES, CDR_IGNORE_STATE_CHANGES, cdr_master_cmp_fn(), cdr_master_hash_fn(), cdr_master_print_fn(), cdr_toggle_runtime_options(), cdr_topic, cli_commands, dial_changes_ignored, module_config::general, handle_bridge_enter_message(), handle_bridge_leave_message(), handle_cdr_sync_message(), handle_channel_snapshot_update_message(), handle_dial_message(), handle_parked_call_message(), LOG_ERROR, LOG_WARNING, NULL, process_config(), ast_cdr_config::settings, stasis_message_router_add(), stasis_message_router_create, stasis_message_router_set_congestion_limits(), STASIS_MESSAGE_TYPE_INIT, stasis_router, and stasis_topic_create().
|
static |
Create a new module config object.
Definition at line 342 of file cdr.c.
References ao2_alloc, ao2_ref, cdr_config, module_config::general, module_config_destructor(), and NULL.
Referenced by process_config().
|
static |
Dispose of a module config object.
Definition at line 331 of file cdr.c.
References ao2_ref, and module_config::general.
Referenced by module_config_alloc().
|
static |
Definition at line 318 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, and cdr_set_debug_mode.
|
static |
Definition at line 2075 of file cdr.c.
References ast_channel_snapshot::base, cdr_object_transition_state(), finalized_state_fn_table, ast_channel_snapshot_base::name, cdr_object::party_a, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 3587 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, AST_CDR_ANSWERED, AST_CDR_FLAG_DISABLE, ast_debug, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_strlen_zero(), ast_test_flag, cdr_beitem::be, CDR_UNANSWERED, ast_cdr::channel, ast_cdr::disposition, ast_cdr::dstchannel, module_config::general, ast_cdr::next, and ast_cdr_config::settings.
Referenced by cdr_detach(), and do_batch_backend_process().
|
static |
Definition at line 4422 of file cdr.c.
References ACO_EXACT, aco_info_init(), aco_option_register, aco_process_config(), ACO_PROCESS_ERROR, aco_set_defaults(), ao2_cleanup, ao2_global_obj_replace_unref, ast_log, BATCH_MODE_SAFE_SHUTDOWN, BATCH_MODE_SCHEDULER_ONLY, CDR_BATCHMODE, CDR_CHANNEL_DEFAULT_ENABLED, CDR_CONGESTION, CDR_DEBUG, CDR_ENABLED, CDR_END_BEFORE_H_EXTEN, CDR_IGNORE_DIAL_CHANGES, CDR_IGNORE_STATE_CHANGES, CDR_INITIATED_SECONDS, cdr_set_debug_mode, CDR_UNANSWERED, DEFAULT_BATCH_SAFE_SHUTDOWN, DEFAULT_BATCH_SCHEDULER_ONLY, DEFAULT_BATCH_SIZE, DEFAULT_BATCH_TIME, DEFAULT_BATCHMODE, DEFAULT_CHANNEL_ENABLED, DEFAULT_ENABLED, DEFAULT_END_BEFORE_H_EXTEN, DEFAULT_IGNORE_DIAL_CHANGES, DEFAULT_IGNORE_STATE_CHANGES, DEFAULT_INITIATED_SECONDS, DEFAULT_UNANSWERED, FLDSET, module_config::general, general_option, general_options, LOG_NOTICE, MAX_BATCH_SIZE, MAX_BATCH_TIME, module_config_alloc(), OPT_BOOLFLAG_T, OPT_UINT_T, PARSE_IN_RANGE, reload(), settings, and ast_cdr_config::settings.
Referenced by load_module(), and reload_module().
|
static |
Definition at line 4722 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_test_flag, CDR_BATCHMODE, CDR_ENABLED, cdr_toggle_runtime_options(), finalize_batch_mode(), module_config::general, process_config(), and ast_cdr_config::settings.
|
static |
Definition at line 3809 of file cdr.c.
References batch, cdr_batch::head, NULL, cdr_batch::size, and cdr_batch::tail.
Referenced by cdr_submit_batch(), and init_batch().
|
static |
Definition at line 1303 of file cdr.c.
References AST_LIST_INSERT_HEAD, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_var_assign, ast_var_delete(), ast_var_name(), ast_var_t::entries, name, and value.
Referenced by ast_cdr_setvar(), and cdr_object_update_cid().
|
static |
Handle a comparison between our cdr_object and a cdr_object already in the bridge while in the Single state. The goal of this is to find a Party B for our CDR.
cdr | Our cdr_object in the Single state |
cand_cdr | The cdr_object already in the Bridge state |
0 | The cand_cdr had a Party A or Party B that we could use as our Party B |
1 | No party in the cand_cdr could be used as our Party B |
Definition at line 1735 of file cdr.c.
References ast_channel_snapshot::base, cdr_all_relink(), CDR_DEBUG, cdr_object_finalize(), cdr_object_pick_party_a(), cdr_object_snapshot_copy(), ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
Referenced by single_state_process_bridge_enter().
|
static |
Definition at line 1682 of file cdr.c.
References cdr_object_check_party_a_answer(), cdr_object::lastevent, and cdr_object::start.
|
static |
Definition at line 1779 of file cdr.c.
References active_cdrs_master, ao2_cleanup, ao2_container_count(), ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_string_field_set, cdr_object::bridge, BRIDGE_ENTER_NO_PARTY_B, BRIDGE_ENTER_OBTAINED_PARTY_B, BRIDGE_ENTER_ONLY_PARTY, bridge_state_fn_table, cdr_object_transition_state(), ast_bridge_snapshot::channels, cdr_object::fn_table, cdr_object::next, OBJ_SEARCH_KEY, single_state_bridge_enter_comparison(), and ast_bridge_snapshot::uniqueid.
|
static |
Definition at line 1696 of file cdr.c.
References AST_CDR_LOCK_APP, ast_set_flag, ast_channel_snapshot::base, base_process_party_a(), cdr_all_relink(), CDR_DEBUG, cdr_object_swap_snapshot(), cdr_object_transition_state(), dial_state_fn_table, cdr_object::flags, ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 1836 of file cdr.c.
References cdr_object_transition_state(), and parked_state_fn_table.
|
static |
Definition at line 1688 of file cdr.c.
References ast_assert, NULL, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Return whether or not a channel has changed its state in the dialplan, subject to endbeforehexten logic.
old_snapshot | The previous state |
new_snapshot | The new state |
0 | if the state has not changed |
1 | if the state changed |
Definition at line 1189 of file cdr.c.
References ast_channel_snapshot_dialplan::appl, AST_SOFTHANGUP_HANGUP_EXEC, ast_test_flag, CDR_END_BEFORE_H_EXTEN, ast_channel_snapshot_dialplan::context, ast_channel_snapshot::dialplan, ast_channel_snapshot_dialplan::exten, is_cdr_flag_set(), ast_channel_snapshot_dialplan::priority, and ast_channel_snapshot::softhangup_flags.
Referenced by check_new_cdr_needed(), and dialed_pending_state_process_party_a().
|
static |
Return whether or not a ast_channel_snapshot is for a channel that was created as the result of a dial operation.
0 | the channel was not created as the result of a dial |
1 | the channel was created as the result of a dial |
Definition at line 1220 of file cdr.c.
References AST_FLAG_ORIGINATED, AST_FLAG_OUTGOING, ast_test_flag, and ast_channel_snapshot::flags.
Referenced by cdr_object_create_public_records(), cdr_object_pick_party_a(), cli_show_channel(), and cli_show_channels().
|
static |
Do not hold the batch lock while calling this function
Definition at line 3904 of file cdr.c.
References ast_cond_signal, ast_mutex_lock, ast_mutex_unlock, ast_sched_add_variable(), AST_SCHED_DEL, cdr_pending_cond, cdr_pending_lock, cdr_sched, cdr_sched_lock, NULL, and submit_scheduled_batch().
Referenced by cdr_detach(), cdr_enable_batch_mode(), and handle_cli_submit().
STASIS_MESSAGE_TYPE_DEFN_LOCAL | ( | cdr_sync_message_type | ) |
A message type used to synchronize with the CDR topic.
|
static |
Definition at line 3883 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_cdr_config::batch_settings, cdr_submit_batch(), module_config::general, and ast_cdr_config::batch_settings::time.
Referenced by start_batch_mode().
|
static |
Definition at line 4596 of file cdr.c.
References destroy_subscriptions().
|
static |
|
static |
A container of all active CDRs with a Party B indexed by Party B channel name.
Definition at line 410 of file cdr.c.
Referenced by ast_cdr_setuserfield(), cdr_all_relink(), cdr_all_unlink(), cdr_engine_shutdown(), handle_bridge_leave_message(), handle_channel_snapshot_update_message(), and load_module().
|
static |
A container of the active master CDRs indexed by Party A channel uniqueid.
Definition at line 407 of file cdr.c.
Referenced by ast_cdr_generic_unregister(), ast_cdr_setvar(), cdr_engine_shutdown(), cdr_object_get_by_name(), cli_complete_show(), cli_show_channels(), dial_state_process_bridge_enter(), handle_bridge_enter_message(), handle_bridge_leave_message(), handle_bridge_pairings(), handle_channel_snapshot_update_message(), handle_dial_message(), handle_parked_call_message(), load_module(), and single_state_process_bridge_enter().
|
static |
Referenced by cdr_detach(), cdr_engine_shutdown(), cdr_submit_batch(), handle_cli_status(), init_batch(), and reset_batch().
|
static |
struct cdr_object_fn_table bridge_state_fn_table |
The virtual table for the Bridged state.
A cdr_object enters this state when it receives notification that the channel has entered a bridge.
A cdr_object from this state can go to:
Definition at line 701 of file cdr.c.
Referenced by bridge_candidate_add_to_cdr(), cdr_object_party_b_left_bridge_cb(), dial_state_process_bridge_enter(), and single_state_process_bridge_enter().
|
static |
Our subscription for bridges.
Definition at line 416 of file cdr.c.
Referenced by create_subscriptions(), and destroy_subscriptions().
|
static |
Lock protecting modifications to the batch queue.
Definition at line 400 of file cdr.c.
Referenced by cdr_detach(), and cdr_submit_batch().
|
static |
Definition at line 404 of file cdr.c.
Referenced by cdr_enable_batch_mode(), do_cdr(), finalize_batch_mode(), and start_batch_mode().
|
static |
These are used to wake up the CDR thread when there's work to do.
Definition at line 403 of file cdr.c.
Referenced by do_cdr(), and start_batch_mode().
|
static |
Definition at line 3224 of file cdr.c.
Referenced by ast_cdr_serialize_variables(), and ast_cdr_setvar().
|
static |
Definition at line 395 of file cdr.c.
Referenced by handle_cli_status(), and start_batch_mode().
|
static |
Definition at line 396 of file cdr.c.
Referenced by start_batch_mode().
|
static |
Definition at line 397 of file cdr.c.
Referenced by cdr_enable_batch_mode(), and finalize_batch_mode().
|
static |
The parent topic for all topics we want to aggregate for CDRs.
Definition at line 425 of file cdr.c.
Referenced by cdr_engine_shutdown(), create_subscriptions(), and load_module().
|
static |
Our subscription for channels.
Definition at line 419 of file cdr.c.
Referenced by create_subscriptions(), and destroy_subscriptions().
|
static |
Definition at line 4331 of file cdr.c.
Referenced by cdr_engine_shutdown(), and load_module().
|
static |
Definition at line 250 of file cdr.c.
Referenced by handle_dial_message(), and load_module().
struct cdr_object_fn_table dial_state_fn_table |
The virtual table for the Dial state.
A cdr_object that has begun a dial operation. This state is entered when the Party A for a CDR is determined to be dialing out to a Party B or when a CDR is for an originated channel (in which case the Party A information is the originated channel, and there is no Party B).
A cdr_object from this state can go in any of the following states:
Definition at line 646 of file cdr.c.
Referenced by dialed_pending_state_process_bridge_enter(), and single_state_process_dial_begin().
struct cdr_object_fn_table dialed_pending_state_fn_table |
The virtual table for the Dialed Pending state.
A cdr_object that has successfully finished a dial operation, but we don't know what they're going to do yet. It's theoretically possible to dial a party and then have that party not be bridged with the caller; likewise, an origination can complete and the channel go off and execute dialplan. The pending state acts as a bridge between either:
A cdr_object from this state can go in any of the following states:
Definition at line 679 of file cdr.c.
Referenced by dial_state_process_dial_end().
struct cdr_object_fn_table finalized_state_fn_table |
The virtual table for the finalized state.
Once in the finalized state, the CDR is done. No modifications can be made to the CDR.
Definition at line 736 of file cdr.c.
Referenced by ast_cdr_clear_property(), ast_cdr_fork(), ast_cdr_set_property(), ast_cdr_setuserfield(), ast_cdr_setvar(), bridge_state_process_bridge_leave(), bridge_state_process_party_b(), cdr_object_check_party_a_hangup(), cdr_object_dispatch_all_cb(), cdr_object_update_party_b_userfield_cb(), dial_state_process_dial_end(), dial_state_process_party_b(), dialed_pending_state_process_dial_begin(), dialed_pending_state_process_party_a(), and parked_state_process_bridge_leave().
|
static |
The type definition for general options.
Definition at line 272 of file cdr.c.
Referenced by process_config().
|
static |
Definition at line 316 of file cdr.c.
Referenced by process_config().
|
static |
The global sequence counter used for CDRs.
Definition at line 391 of file cdr.c.
Referenced by cdr_object_alloc().
|
static |
|
static |
|
static |
The file definition.
struct cdr_object_fn_table parked_state_fn_table |
The virtual table for the Parked state.
Parking is weird. Unlike typical bridges, it has to be treated somewhat uniquely - a channel in a parking bridge (which is a subclass of a holding bridge) has to be handled as if the channel went into an application. However, when the channel comes out, we need a new CDR - unlike the Single state.
Definition at line 720 of file cdr.c.
Referenced by dialed_pending_state_process_parking_bridge_enter(), and single_state_process_parking_bridge_enter().
|
static |
Our subscription for parking.
Definition at line 422 of file cdr.c.
Referenced by create_subscriptions(), destroy_subscriptions(), and park_and_announce_app_exec().
|
static |
struct cdr_object_fn_table single_state_fn_table |
The virtual table for the Single state.
A cdr_object starts off in this state. This represents a channel that has no Party B information itself.
A cdr_object from this state can go into any of the following states:
Definition at line 615 of file cdr.c.
Referenced by cdr_object_alloc(), dialed_pending_state_process_party_a(), and handle_parking_bridge_enter_message().
|
static |
Message router for stasis messages regarding channel state.
Definition at line 413 of file cdr.c.
Referenced by ast_cdr_engine_term(), ast_cdr_message_router(), cdr_engine_shutdown(), and load_module().