Asterisk - The Open Source Telephony Project
18.5.0
|
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_CONGESTION "0" |
#define | DEFAULT_ENABLED "1" |
#define | DEFAULT_END_BEFORE_H_EXTEN "1" |
#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_objects. 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) |
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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .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 [] |
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, | |
... | |||
) |
Definition at line 210 of file cdr.c.
Referenced by bridge_candidate_add_to_cdr(), bridge_candidate_process(), cdr_object_alloc(), cdr_object_check_party_a_answer(), cdr_object_dispatch(), cdr_object_transition_state_init(), handle_bridge_enter_message(), handle_bridge_leave_message(), handle_channel_snapshot_update_message(), handle_cli_debug(), handle_dial_message(), handle_parked_call_message(), handle_parking_bridge_enter_message(), handle_standard_bridge_enter_message(), process_config(), single_state_bridge_enter_comparison(), and single_state_process_dial_begin().
#define cdr_set_debug_mode | ( | mod_cfg | ) |
Definition at line 203 of file cdr.c.
Referenced by ast_cdr_set_config(), handle_cli_debug(), module_config_post_apply(), and process_config().
#define DEFAULT_BATCH_SAFE_SHUTDOWN "1" |
Definition at line 201 of file cdr.c.
Referenced by process_config().
#define DEFAULT_BATCH_SCHEDULER_ONLY "0" |
Definition at line 200 of file cdr.c.
Referenced by process_config().
#define DEFAULT_BATCH_SIZE "100" |
Definition at line 196 of file cdr.c.
Referenced by process_config().
#define DEFAULT_BATCH_TIME "300" |
Definition at line 198 of file cdr.c.
Referenced by process_config().
#define DEFAULT_BATCHMODE "0" |
Definition at line 190 of file cdr.c.
Referenced by process_config().
#define DEFAULT_ENABLED "1" |
Definition at line 189 of file cdr.c.
Referenced by process_config().
#define DEFAULT_END_BEFORE_H_EXTEN "1" |
Definition at line 193 of file cdr.c.
Referenced by process_config().
#define DEFAULT_INITIATED_SECONDS "0" |
Definition at line 194 of file cdr.c.
Referenced by process_config().
#define DEFAULT_UNANSWERED "0" |
Definition at line 191 of file cdr.c.
Referenced by process_config().
#define FORMAT_STRING "%-25.25s %-25.25s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8ld %-8.8ld\n" |
Referenced by cli_show_channel(), and cli_show_channels().
#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 |
Definition at line 197 of file cdr.c.
Referenced by process_config().
#define MAX_BATCH_TIME 86400 |
Definition at line 199 of file cdr.c.
Referenced by process_config().
#define TITLE_STRING "%-25.25s %-25.25s %-15.15s %-8.8s %-8.8s %-8.8s %-8.8s %-8.8s\n" |
Referenced by cli_show_channel(), and cli_show_channels().
#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.
|
static |
The container for the module configuration.
struct ast_cdr* ast_cdr_alloc | ( | void | ) |
Allocate a CDR record.
a | malloc'd ast_cdr structure |
NULL | on error (malloc failure) |
Definition at line 3422 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 suspdended |
-1 | The backend could not be suspended |
Definition at line 2866 of file cdr.c.
References ast_debug, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, cdr_beitem::name, and NULL.
Referenced by load_config(), my_unload_module(), 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 2884 of file cdr.c.
References ast_debug, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, cdr_beitem::name, and NULL.
Referenced by load_config(), my_load_module(), 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.
channel_name | The CDR's channel |
option | Option to clear from the CDR |
0 | on success |
1 | on error |
Definition at line 3575 of file cdr.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_clear_flag, cdr_object_get_by_name(), cdr_object::flags, cdr_object::fn_table, and cdr_object::next.
Referenced by appcdr_callback(), 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 3430 of file cdr.c.
References AST_CDR_ANSWERED, AST_CDR_BUSY, AST_CDR_CONGESTION, AST_CDR_FAILED, AST_CDR_NOANSWER, and AST_CDR_NULL.
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 |
a | malloc'd ast_cdr structure, |
NULL | on error (malloc failure) |
Definition at line 2998 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(), load_values_config(), manager_log(), and syslog_log().
void ast_cdr_engine_term | ( | void | ) |
Submit any remaining CDRs and prepare for shutdown
Definition at line 4577 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(), and stasis_message_router_publish_sync().
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 3637 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(), ast_channel_snapshot::base, cdr_object::bridge, cdr_all_relink(), cdr_object_create_and_append(), cdr_object_finalize(), cdr_object_get_by_name(), cdr_object_transition_state(), context, cdr_object::context, copy_variables(), cdr_object::data, exten, cdr_object::exten, cdr_object_snapshot::flags, cdr_object::flags, cdr_object::fn_table, free_variables(), cdr_object::last, cdr_object::lastevent, lock, ast_channel_snapshot_base::name, cdr_object::next, 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 extraced, provide epoch seconds. Otherwise format as a date/time stamp |
Definition at line 3050 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, NULL, ast_cdr::peeraccount, ast_cdr::sequence, ast_cdr::src, ast_cdr::start, ast_cdr::uniqueid, and ast_cdr::userfield.
Referenced by cdr_handler(), cdr_read_callback(), cdr_retrieve_time(), mysql_log(), odbc_log(), and pgsql_log().
void ast_cdr_free | ( | struct ast_cdr * | cdr | ) |
Free a CDR record.
cdr | ast_cdr structure to free Returns nothing |
Definition at line 3411 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 2953 of file cdr.c.
References 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(), cdr_beitem::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.
NULL | on error |
The | current CDR configuration |
Definition at line 2826 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 3324 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(), and cdr_object::last.
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 2861 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 |
the | stasis_message_router otherwise |
Definition at line 4291 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 2948 of file cdr.c.
References cdr_generic_register().
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 2993 of file cdr.c.
References ast_cdr_generic_unregister().
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 2943 of file cdr.c.
References cdr_generic_register().
Referenced by load_module(), load_values_config(), my_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 3598 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 |
the | total number of serialized variables |
Definition at line 3353 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(), CDR_ENABLED, cdr_object_format_property(), cdr_object_get_by_name(), 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 2840 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ao2_replace, cdr_set_debug_mode, cdr_toggle_runtime_options(), 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.
channel_name | The CDR's channel |
option | Option to apply to the CDR |
0 | on success |
1 | on error |
Definition at line 3548 of file cdr.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_set_flag, cdr_object_get_by_name(), cdr_object::flags, cdr_object::fn_table, cdr_object::next, and cdr_object::party_a.
Referenced by appcdr_callback(), 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 3477 of file cdr.c.
References 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, 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(), cdr_write_callback(), handle_request_info(), and start_monitor_exec().
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 3178 of file cdr.c.
References 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_object::fn_table, LOG_ERROR, 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, 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 2988 of file cdr.c.
References ast_cdr_generic_unregister().
Referenced by load_module(), load_values_config(), my_unload_module(), reload(), tds_unload_module(), and unload_module().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
Definition at line 1617 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 1540 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(), ast_channel_snapshot_dialplan::context, context, cdr_object::context, ast_channel_snapshot_dialplan::data, cdr_object::data, ast_channel_snapshot::dialplan, ast_channel_snapshot_dialplan::exten, exten, cdr_object::exten, ast_channel_snapshot::flags, cdr_object::flags, is_cdr_flag_set(), ast_channel_snapshot_peer::linkedid, ast_cdr::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 2472 of file cdr.c.
References ast_string_field_set, ast_channel_snapshot::base, cdr_object::bridge, 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_obj being processed |
cand_cdr | The cdr_object that is a candidate |
Definition at line 2503 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 2015 of file cdr.c.
References ast_channel_snapshot::base, cdr_object::bridge, cdr_object_transition_state(), ast_channel_snapshot_base::name, cdr_object::party_a, cdr_object::party_b, cdr_object_snapshot::snapshot, and ast_bridge_snapshot::uniqueid.
|
static |
Definition at line 2002 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(), ast_channel_snapshot::flags, ast_channel_snapshot_base::name, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 912 of file cdr.c.
References ast_assert, CMP_MATCH, 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 888 of file cdr.c.
References ast_assert, ast_str_case_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and cdr_object::party_b_name.
Referenced by load_module().
|
static |
Definition at line 4472 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 949 of file cdr.c.
References 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 972 of file cdr.c.
References 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 3841 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 4416 of file cdr.c.
References ast_cond_init, ast_log, ast_pthread_create_background, AST_PTHREADT_NULL, ast_cdr_config::batch_settings, cdr_pending_cond, cdr_thread, do_cdr(), LOG_ERROR, LOG_NOTICE, NULL, ast_cdr_config::batch_settings::size, start_batch_mode(), and ast_cdr_config::batch_settings::time.
Referenced by cdr_toggle_runtime_options().
|
static |
Definition at line 4385 of file cdr.c.
References aco_info_destroy(), 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(), finalize_batch_mode(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, stasis_message_router_unsubscribe_and_join(), and STASIS_MESSAGE_TYPE_CLEANUP.
Referenced by load_module().
|
static |
Definition at line 3018 of file cdr.c.
References AST_LIST_TRAVERSE, ast_strlen_zero, ast_var_name(), ast_var_value(), ast_var_t::entries, NULL, and ast_cdr::varshead.
Referenced by ast_cdr_format_var().
|
static |
Definition at line 2902 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, LOG_WARNING, and cdr_beitem::name.
Referenced by ast_cdr_modifier_register(), and ast_cdr_register().
|
static |
Definition at line 3035 of file cdr.c.
References ast_localtime(), ast_strftime(), and NULL.
Referenced by ast_cdr_format_var(), cdr_object_format_property(), cli_show_channel(), and cli_show_channels().
|
static |
Definition at line 854 of file cdr.c.
References ast_assert, CMP_MATCH, 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 830 of file cdr.c.
References ast_assert, ast_str_case_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and cdr_object::uniqueid.
Referenced by load_module().
|
static |
Definition at line 4445 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 |
This implicitly sets the state of the newly created CDR to the Single state (single_state_fn_table)
Definition at line 1039 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, cdr_object_snapshot::snapshot, 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 1494 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 1477 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(), 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 |
Definition at line 1075 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(), context, cdr_object::context, cdr_object::data, cdr_object::disposition, exten, 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 |
A | chain of ast_cdr objects on success |
NULL | on failure |
Definition at line 1287 of file cdr.c.
References ast_channel_snapshot_base::accountcode, ast_cdr::accountcode, ast_channel_snapshot::amaflags, ast_cdr::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::sequence, cdr_object::sequence, cdr_object_snapshot::snapshot, snapshot_is_dialed(), ast_cdr::src, ast_cdr::start, cdr_object::start, ast_channel_snapshot_base::uniqueid, ast_cdr::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 1386 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_objects. It should only be used during shutdown, so that we get billing records for everything that we can.
Definition at line 4260 of file cdr.c.
References ao2_lock, ao2_unlock, cdr_all_unlink(), cdr_object_dispatch(), cdr_object_transition_state(), CMP_MATCH, and cdr_object::next.
Referenced by cdr_engine_shutdown().
|
static |
cdr_object Destructor
Definition at line 999 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_object'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_object | The CDR to finalize |
Definition at line 1440 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 2196 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 3243 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, 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::uniqueid, and cdr_object_snapshot::userfield.
Referenced by ast_cdr_getvar(), and ast_cdr_serialize_variables().
|
static |
Format a variable on a cdr_object.
Definition at line 3226 of file cdr.c.
References ast_copy_string(), AST_LIST_TRAVERSE, ast_var_name(), ast_var_value(), ast_var_t::entries, cdr_object::party_a, and cdr_object_snapshot::variables.
Referenced by ast_cdr_getvar().
|
static |
Compute the billsec for a cdr_object.
Definition at line 1235 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 3312 of file cdr.c.
References ao2_callback, ast_strdupa, ast_strlen_zero, cdr_object_get_by_name_cb(), 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 3142 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 1227 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 2361 of file cdr.c.
References ast_assert, ast_channel_snapshot::base, cdr_object::bridge, bridge_leave_data::bridge, 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 |
The | snapshot that won |
Definition at line 1192 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 3126 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 1402 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 791 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 1531 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 821 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 |
Definition at line 804 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 |
Definition at line 1506 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 2220 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 3455 of file cdr.c.
References ast_assert, ast_copy_string(), ast_channel_snapshot::base, party_b_userfield_update::channel_name, 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, cdr_object_snapshot::userfield, and party_b_userfield_update::userfield.
Referenced by ast_cdr_setuserfield().
|
static |
Definition at line 3766 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 4488 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 2249 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 3970 of file cdr.c.
References 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, cdr_object_snapshot::snapshot, and ast_cli_args::word.
Referenced by handle_cli_show().
|
static |
Definition at line 4055 of file cdr.c.
References ast_channel_snapshot_base::accountcode, cdr_object::answer, ao2_cleanup, ao2_lock, ao2_unlock, cdr_object::appl, ast_cli_args::argv, 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, cdr_object::end, ast_cli_args::fd, 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 3991 of file cdr.c.
References 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, ast_cli_args::fd, 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 |
The | number of copied variables |
Definition at line 746 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 4314 of file cdr.c.
References ast_bridge_topic_all(), ast_channel_topic_all(), ast_parking_topic(), and stasis_forward_all().
Referenced by cdr_toggle_runtime_options().
|
static |
Destroy the active Stasis subscriptions.
Definition at line 4304 of file cdr.c.
References stasis_forward_cancel().
Referenced by cdr_toggle_runtime_options(), and unload_module().
|
static |
Definition at line 1880 of file cdr.c.
References 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, cdr_object::bridge, BRIDGE_ENTER_NO_PARTY_B, BRIDGE_ENTER_OBTAINED_PARTY_B, BRIDGE_ENTER_ONLY_PARTY, 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, cdr_object_snapshot::snapshot, and ast_bridge_snapshot::uniqueid.
|
static |
|
static |
Definition at line 1848 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(), cdr_object::disposition, 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 1802 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(), ast_channel_snapshot::flags, ast_channel_snapshot_base::name, NULL, cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 2089 of file cdr.c.
Referenced by handle_dial_message().
|
static |
Definition at line 1828 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().
|
static |
Definition at line 1976 of file cdr.c.
References cdr_object_transition_state(), cdr_object::fn_table, and cdr_object_fn_table::process_bridge_enter.
|
static |
Definition at line 1992 of file cdr.c.
References cdr_object_transition_state().
|
static |
Definition at line 1982 of file cdr.c.
References cdr_object_transition_state(), cdr_object::party_b, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 1951 of file cdr.c.
References base_process_party_a(), cdr_object_transition_state(), cdr_object_transition_state_init(), cdr_object::fn_table, cdr_object::party_a, cdr_object::party_b, cdr_object_fn_table::process_party_a, cdr_object_snapshot::snapshot, and snapshot_cep_changed().
|
static |
Definition at line 3749 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 3903 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 2386 of file cdr.c.
References ast_bridge_snapshot::subclass, and ast_bridge_snapshot::technology.
Referenced by handle_bridge_enter_message(), and handle_bridge_leave_message().
|
static |
Definition at line 2064 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 2073 of file cdr.c.
References filter_channel_snapshot().
Referenced by handle_channel_snapshot_update_message().
|
static |
Definition at line 4277 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 2044 of file cdr.c.
References cdr_object_finalize().
|
static |
Definition at line 2049 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 777 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 2708 of file cdr.c.
References ao2_cleanup, ao2_find, ast_assert, ast_log, AST_LOG_WARNING, ast_channel_snapshot::base, ast_bridge_blob::bridge, CDR_DEBUG, ast_bridge_blob::channel, 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_bridge_snapshot::subclass, 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 |
topic | The topic this message was published for |
message | The message - hopefully a bridge one! |
Definition at line 2404 of file cdr.c.
References 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, ast_bridge_blob::bridge, bridge_leave_data::bridge, CDR_DEBUG, cdr_object_party_b_left_bridge_cb(), ast_bridge_blob::channel, 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 2561 of file cdr.c.
References 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 |
topic | The topic this message was published for |
message | A blank ao2 object |
Definition at line 2820 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 |
topic | The topic this message was published for |
message | The message |
Definition at line 2278 of file cdr.c.
References ao2_callback_data, ao2_cleanup, ao2_find, ao2_link, ao2_lock, ao2_unlink, ao2_unlock, ast_assert, AST_FLAG_DEAD, ast_log, AST_LOG_WARNING, ast_test_flag, ast_channel_snapshot::base, cdr_all_unlink(), 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(), ast_channel_snapshot::flags, cdr_object::fn_table, cdr_object::is_root, cdr_object::lastevent, ast_channel_snapshot_base::name, ast_channel_snapshot_update::new_snapshot, cdr_object::next, OBJ_MULTIPLE, OBJ_NODATA, OBJ_SEARCH_KEY, ast_channel_snapshot_update::old_snapshot, cdr_object_fn_table::process_party_a, stasis_message_data(), stasis_message_timestamp(), ast_channel_snapshot_base::uniqueid, and update().
Referenced by load_module().
|
static |
Definition at line 3929 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_cli_args::argc, ast_cli_args::argv, 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, ast_cli_args::fd, module_config::general, NULL, ast_cdr_config::settings, and ast_cli_entry::usage.
|
static |
Definition at line 4115 of file cdr.c.
References ast_cli_args::argc, 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 4145 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_cli_args::argc, 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_CONGESTION, CDR_ENABLED, cdr_sched, CDR_UNANSWERED, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ESS, ast_cli_args::fd, module_config::general, cdr_beitem::name, NULL, ast_cdr_config::batch_settings::settings, ast_cdr_config::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 4212 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, ast_cli_args::argc, ast_cli(), ast_test_flag, CDR_BATCHMODE, CDR_ENABLED, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, 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 |
topic | The topic this message was published for |
message | The message |
Definition at line 2105 of file cdr.c.
References 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_status_end(), 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 |
topic | The topic this message was published for |
message | The message about who got parked |
Definition at line 2751 of file cdr.c.
References 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 |
Definition at line 2586 of file cdr.c.
References ao2_lock, ao2_unlock, ast_channel_snapshot::base, 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, and cdr_object_fn_table::process_party_a.
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 |
Definition at line 2627 of file cdr.c.
References ao2_lock, ao2_unlock, ast_channel_snapshot::base, 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 3738 of file cdr.c.
References ast_malloc, batch, and reset_batch().
Referenced by cdr_detach().
|
static |
Definition at line 1127 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 4522 of file cdr.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_container_register(), 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, cdr_all_cmp_fn(), cdr_all_hash_fn(), cdr_all_print_fn(), cdr_engine_shutdown(), cdr_master_cmp_fn(), cdr_master_hash_fn(), cdr_master_print_fn(), cdr_toggle_runtime_options(), 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, NULL, process_config(), stasis_message_router_add(), stasis_message_router_create, stasis_message_router_set_congestion_limits(), STASIS_MESSAGE_TYPE_INIT, and stasis_topic_create().
Referenced by reload_module().
|
static |
Create a new module config object.
Definition at line 300 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 289 of file cdr.c.
References ao2_ref, and module_config::general.
Referenced by module_config_alloc().
|
static |
Definition at line 276 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, and cdr_set_debug_mode.
|
static |
Definition at line 2032 of file cdr.c.
References ast_channel_snapshot::base, cdr_object_transition_state(), ast_channel_snapshot_base::name, cdr_object::party_a, and cdr_object_snapshot::snapshot.
|
static |
Definition at line 3508 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 4340 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_CONGESTION, CDR_DEBUG, CDR_ENABLED, CDR_END_BEFORE_H_EXTEN, 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_ENABLED, DEFAULT_END_BEFORE_H_EXTEN, DEFAULT_INITIATED_SECONDS, DEFAULT_UNANSWERED, FLDSET, module_config::general, LOG_NOTICE, MAX_BATCH_SIZE, MAX_BATCH_TIME, module_config_alloc(), OPT_BOOLFLAG_T, OPT_UINT_T, PARSE_IN_RANGE, settings, and ast_cdr_config::settings.
Referenced by load_module(), and reload_module().
|
static |
Definition at line 4617 of file cdr.c.
References ao2_cleanup, ao2_global_obj_ref, AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CORE, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_test_flag, ASTERISK_GPL_KEY, CDR_BATCHMODE, CDR_ENABLED, cdr_toggle_runtime_options(), finalize_batch_mode(), module_config::general, load_module(), process_config(), reload(), ast_cdr_config::settings, and unload_module().
|
static |
Definition at line 3730 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 1262 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(), and ast_var_t::entries.
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 1692 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 1639 of file cdr.c.
References cdr_object_check_party_a_answer(), cdr_object::lastevent, and cdr_object::start.
|
static |
Definition at line 1736 of file cdr.c.
References 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, 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 1653 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(), 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 1793 of file cdr.c.
References cdr_object_transition_state().
|
static |
Definition at line 1645 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 1148 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 1179 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 3825 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 3804 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 4515 of file cdr.c.
References destroy_subscriptions().
Referenced by reload_module().
|
static |
|
static |
|
static |
|
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:
|
static |
|
static |
Lock protecting modifications to the batch queue.
Definition at line 358 of file cdr.c.
Referenced by cdr_detach(), and cdr_submit_batch().
|
static |
Definition at line 362 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 361 of file cdr.c.
Referenced by do_cdr(), and start_batch_mode().
|
static |
Definition at line 353 of file cdr.c.
Referenced by handle_cli_status(), and start_batch_mode().
|
static |
Definition at line 354 of file cdr.c.
Referenced by start_batch_mode().
|
static |
Definition at line 355 of file cdr.c.
Referenced by cdr_enable_batch_mode(), and finalize_batch_mode().
|
static |
|
static |
|
static |
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:
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:
struct cdr_object_fn_table finalized_state_fn_table |
|
static |
|
static |
|
static |
The global sequence counter used for CDRs.
Definition at line 349 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.
|
static |
Our subscription for parking.
Definition at line 380 of file cdr.c.
Referenced by 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:
|
static |
Message router for stasis messages regarding channel state.
Definition at line 371 of file cdr.c.
Referenced by ast_cdr_message_router().