Asterisk - The Open Source Telephony Project
21.4.1
|
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 |
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. | |
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. | |
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. | |
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. | |
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. | |
static void | cdr_object_dtor (void *obj) |
cdr_object Destructor | |
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. | |
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. | |
static long | cdr_object_get_billsec (struct cdr_object *cdr) |
Compute the billsec for a cdr_object. | |
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. | |
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. | |
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. | |
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. | |
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. | |
static char * | cli_complete_show (struct ast_cli_args *a) |
Complete user input for 'cdr show'. | |
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. | |
static void | destroy_subscriptions (void) |
Destroy the active Stasis subscriptions. | |
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. | |
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. | |
static void | module_config_destructor (void *obj) |
Dispose of a module config object. | |
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. | |
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 = "da6642af068ee5e6490c5b1d2cc1d238" , .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. | |
static struct ao2_container * | active_cdrs_master |
A container of the active master CDRs indexed by Party A channel uniqueid. | |
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. | |
static ast_mutex_t | cdr_batch_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
Lock protecting modifications to the batch queue. | |
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. | |
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. | |
static struct stasis_forward * | channel_subscription |
Our subscription for channels. | |
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. | |
static struct aco_type * | general_options [] = ACO_TYPES(&general_option) |
static int | global_cdr_sequence = 0 |
The global sequence counter used for CDRs. | |
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. | |
static struct ast_sched_context * | sched |
Scheduler items. | |
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. | |
Call Detail Record API.
Definition in file cdr.c.
#define CDR_DEBUG | ( | fmt, | |
... | |||
) |
#define cdr_set_debug_mode | ( | mod_cfg | ) |
Return types for process_bridge_enter
functions.
struct ast_cdr* ast_cdr_alloc | ( | void | ) |
Allocate a CDR record.
NULL | on error (malloc failure) |
Definition at line 3484 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 2928 of file cdr.c.
References ast_debug, AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
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 2946 of file cdr.c.
References ast_debug, AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
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 3637 of file cdr.c.
References cdr_object::flags, cdr_object::fn_table, and cdr_object::next.
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 3492 of file cdr.c.
Referenced by ast_cdr_format_var(), and cdr_object_finalize().
Duplicate a public CDR.
cdr | the record to duplicate |
NULL | on error (malloc failure) |
Definition at line 3060 of file cdr.c.
References ast_cdr_alloc(), AST_LIST_HEAD_INIT_NOLOCK, copy_variables(), and ast_cdr::varshead.
void ast_cdr_engine_term | ( | void | ) |
Submit any remaining CDRs and prepare for shutdown
Definition at line 4665 of file cdr.c.
References ao2_global_obj_ref, ast_debug, BATCH_MODE_SAFE_SHUTDOWN, CDR_BATCHMODE, module_config::general, RAII_VAR, ast_cdr_config::batch_settings::settings, ast_cdr_config::settings, stasis_message_create(), and stasis_message_router_publish_sync().
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 3699 of file cdr.c.
References cdr_object::answer, ao2_ref, AST_CDR_FLAG_FINALIZE, AST_CDR_FLAG_KEEP_VARS, AST_CDR_FLAG_RESET, AST_CDR_FLAG_SET_ANSWER, AST_CDR_LOCK_APP, ast_debug, AST_STATE_UP, ast_string_field_set, ast_tvnow(), cdr_object_create_and_append(), cdr_object_finalize(), cdr_object_transition_state(), copy_variables(), ast_cdr::flags, cdr_object_snapshot::flags, cdr_object::flags, cdr_object::fn_table, free_variables(), cdr_object::lastevent, lock, 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.
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 3112 of file cdr.c.
References ast_cdr::accountcode, ast_cdr::amaflags, ast_cdr_disp2str(), ast_channel_amaflags2string(), ast_copy_string(), ast_tvdiff_ms(), ast_tvnow(), ast_tvzero(), ast_cdr::billsec, ast_cdr::clid, ast_cdr::dcontext, ast_cdr::disposition, ast_cdr::dst, ast_cdr::dstchannel, ast_cdr::duration, ast_cdr::lastapp, ast_cdr::lastdata, ast_cdr::linkedid, ast_cdr::peeraccount, ast_cdr::sequence, ast_cdr::src, ast_cdr::uniqueid, and ast_cdr::userfield.
void ast_cdr_free | ( | struct ast_cdr * | cdr | ) |
Free a CDR record.
cdr | ast_cdr structure to free |
Definition at line 3473 of file cdr.c.
References free_variables(), and ast_cdr::varshead.
Referenced by ast_channel_destructor(), and ast_dummy_channel_destructor().
struct ast_cdr_config* ast_cdr_get_config | ( | void | ) |
Obtain the current CDR configuration.
NULL | on error |
Definition at line 2888 of file cdr.c.
References ao2_bump, ao2_global_obj_ref, and module_config::general.
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 3386 of file cdr.c.
References cdr_object_format_property(), cdr_object_format_var_internal(), and cdr_object::last.
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 4356 of file cdr.c.
References ao2_bump, and stasis_router.
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 |
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 |
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 |
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 3660 of file cdr.c.
References cdr_object::answer, AST_LIST_REMOVE_HEAD, ast_tvnow(), cdr_object_check_party_a_answer(), 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 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 3415 of file cdr.c.
References AST_LIST_TRAVERSE, ast_str_append(), ast_str_reset(), CDR_ENABLED, cdr_object_format_property(), cdr_object::next, cdr_object::party_a, S_OR, 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 2902 of file cdr.c.
References ao2_global_obj_ref, ao2_replace, cdr_toggle_runtime_options(), and module_config::general.
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 3610 of file cdr.c.
References cdr_object::flags, cdr_object::fn_table, cdr_object::next, and cdr_object::party_a.
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 3539 of file cdr.c.
References ast_copy_string(), cdr_object_update_party_b_userfield_cb(), cdr_object::fn_table, cdr_object::next, OBJ_MULTIPLE, OBJ_NODATA, OBJ_SEARCH_KEY, cdr_object::party_a, and cdr_object_snapshot::userfield.
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 3240 of file cdr.c.
References ao2_callback, ao2_iterator_destroy(), ast_strdupa, ast_channel_snapshot::base, cdr_object::fn_table, ast_channel_snapshot_base::name, cdr_object::next, OBJ_MULTIPLE, cdr_object::party_a, cdr_object::party_b, cdr_object_snapshot::snapshot, and cdr_object_snapshot::variables.
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 |
|
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 2566 of file cdr.c.
References ast_channel_snapshot::base, cdr_object::bridge, 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 |
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 1079 of file cdr.c.
References ast_atomic_fetchadd_int(), ast_string_field_init, ast_string_field_set, ast_channel_snapshot::base, CDR_DEBUG, cdr_object_dtor(), cdr_object_transition_state(), cdr_object::disposition, cdr_object::last, cdr_object::lastevent, ast_channel_snapshot_peer::linkedid, cdr_object::linkedid, ast_channel_snapshot_base::name, cdr_object::name, 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 |
Create a new cdr_object and append it to an existing chain.
cdr | The cdr_object to append to |
event_time |
Definition at line 1116 of file cdr.c.
References cdr_object::appl, AST_CDR_FLAG_DISABLE_ALL, ast_string_field_set, cdr_object_alloc(), cdr_object_snapshot_copy(), cdr_object::context, cdr_object::data, cdr_object::disposition, cdr_object::exten, cdr_object::flags, cdr_object::last, cdr_object::linkedid, cdr_object::next, cdr_object::party_a, and cdr_object_snapshot::snapshot.
Referenced by ast_cdr_fork(), 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 1326 of file cdr.c.
References ast_channel_snapshot_base::accountcode, ast_cdr::accountcode, ast_channel_snapshot::amaflags, ast_cdr::amaflags, cdr_object::answer, cdr_object::appl, ast_calloc, ast_copy_string(), ast_debug, AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, ast_channel_snapshot::base, ast_cdr::billsec, ast_channel_snapshot::caller, cdr_object_get_billsec(), cdr_object_get_duration(), 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, cdr_object::end, 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, cdr_object::next, 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, 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 1425 of file cdr.c.
References ast_channel_snapshot::base, CDR_DEBUG, 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 |
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 1479 of file cdr.c.
References cdr_object::answer, ast_cdr_disp2str(), 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(), cdr_object_check_party_a_hangup(), cdr_object_party_b_left_bridge_cb(), handle_channel_snapshot_update_message(), handle_standard_bridge_enter_message(), and single_state_bridge_enter_comparison().
|
static |
Compute the duration for a cdr_object
Definition at line 1266 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 |
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 1231 of file cdr.c.
References AST_CDR_FLAG_PARTY_A, 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 |
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 1441 of file cdr.c.
References CDR_CONGESTION, and cdr_object::disposition.
Referenced by cdr_object_finalize().
|
static |
Copy a snapshot and its details.
dst | The destination |
src | The source |
Definition at line 833 of file cdr.c.
References copy_variables(), cdr_object_snapshot::flags, cdr_object_snapshot::snapshot, cdr_object_snapshot::userfield, and cdr_object_snapshot::variables.
Referenced by bridge_candidate_process(), cdr_object_create_and_append(), 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 1570 of file cdr.c.
References cdr_object_update_cid(), and cdr_object_snapshot::snapshot.
|
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 864 of file cdr.c.
References cdr_object_transition_state_init().
Referenced by ast_cdr_fork(), cdr_object_alloc(), cdr_object_check_party_a_hangup(), cdr_object_dispatch_all_cb(), and handle_parking_bridge_enter_message().
|
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 847 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().
Copy variables from one list to another.
to_list | destination |
from_list | source |
Definition at line 788 of file cdr.c.
References AST_LIST_INSERT_HEAD, and AST_LIST_TRAVERSE.
Referenced by ast_cdr_dup(), ast_cdr_fork(), cdr_object_create_public_records(), and cdr_object_snapshot_copy().
|
static |
Delete all variables from a variable list.
headp | The head pointer to the variable list to delete |
Definition at line 819 of file cdr.c.
References AST_LIST_REMOVE_HEAD.
Referenced by ast_cdr_fork(), and ast_cdr_free().
|
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 2467 of file cdr.c.
References ast_string_field_set, ast_channel_snapshot::base, ast_bridge_blob::bridge, CDR_DEBUG, cdr_object_party_b_left_bridge_cb(), ast_bridge_blob::channel, filter_bridge_messages(), cdr_object::fn_table, cdr_object::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, and ast_channel_snapshot_base::uniqueid.
|
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 2624 of file cdr.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_ref, bridge_candidate_process(), ast_bridge_snapshot::channels, and OBJ_SEARCH_KEY.
Referenced by handle_standard_bridge_enter_message().
|
static |
|
static |
Handler for channel snapshot update messages.
data | Passed on |
sub | The stasis subscription for this message callback |
message | The message |
Definition at line 2329 of file cdr.c.
References ao2_global_obj_ref, ao2_link, ao2_unlink, AST_CDR_FLAG_DISABLE_ALL, ast_debug, AST_FLAG_DEAD, ast_channel_snapshot::base, CDR_CHANNEL_DEFAULT_ENABLED, CDR_DEBUG, cdr_object_alloc(), cdr_object_create_and_append(), cdr_object_dispatch(), cdr_object_finalize(), check_new_cdr_needed(), ast_channel_snapshot::flags, cdr_object::flags, cdr_object::fn_table, module_config::general, 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, ast_cdr_config::settings, stasis_message_data(), stasis_message_timestamp(), and ast_channel_snapshot_base::uniqueid.
|
static |
Handler for Stasis-Core dial messages.
data | Passed on |
sub | The stasis subscription for this message callback |
message | The message |
Definition at line 2143 of file cdr.c.
References ast_json_object_get(), ast_json_string_get(), ast_multi_channel_blob_get_channel(), ast_multi_channel_blob_get_json(), ast_channel_snapshot::base, ast_channel_snapshot::caller, CDR_DEBUG, cdr_object_create_and_append(), cdr_object::disposition, cdr_object::fn_table, cdr_object::lastevent, ast_channel_snapshot_base::name, cdr_object::next, 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.
|
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 2814 of file cdr.c.
References ast_channel_snapshot::base, CDR_DEBUG, cdr_object_create_and_append(), ast_parked_call_payload::event_type, cdr_object::fn_table, cdr_object::lastevent, ast_channel_snapshot_base::name, cdr_object::next, OBJ_SEARCH_KEY, ast_parked_call_payload::parkee, cdr_object_fn_table::process_parked_channel, stasis_message_data(), stasis_message_timestamp(), and ast_channel_snapshot_base::uniqueid.
|
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 2650 of file cdr.c.
References 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.
|
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 2692 of file cdr.c.
References 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, cdr_object_fn_table::process_bridge_enter, and cdr_object_fn_table::process_party_a.
|
static |
Definition at line 3800 of file cdr.c.
References ast_malloc, and reset_batch().
|
static |
Definition at line 3792 of file cdr.c.
Referenced by init_batch().
|
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 1731 of file cdr.c.
References ast_channel_snapshot::base, 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.
|
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 1187 of file cdr.c.
References ast_channel_snapshot_dialplan::appl, AST_SOFTHANGUP_HANGUP_EXEC, CDR_END_BEFORE_H_EXTEN, ast_channel_snapshot_dialplan::context, ast_channel_snapshot::dialplan, ast_channel_snapshot_dialplan::exten, ast_channel_snapshot_dialplan::priority, and ast_channel_snapshot::softhangup_flags.
Referenced by check_new_cdr_needed().
|
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 1218 of file cdr.c.
References AST_FLAG_ORIGINATED, AST_FLAG_OUTGOING, and ast_channel_snapshot::flags.
Referenced by cdr_object_create_public_records(), and cdr_object_pick_party_a().
|
static |
Do not hold the batch lock while calling this function
Definition at line 3887 of file cdr.c.
References ast_sched_add_variable(), AST_SCHED_DEL, and cdr_pending_lock.
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:
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 |
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.
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: