73 struct ast_cdr_batch_item *
next;
144 if (!strcasecmp(name, i->
name)) {
171 if (!strcasecmp(name, i->
name)) {
180 ast_verb(2,
"Unregistered '%s' CDR backend\n", name);
223 memcpy(newcdr, cdr,
sizeof(*newcdr));
237 for (; cdr; cdr = recur ? cdr->
next : NULL) {
249 static void cdr_get_tv(
struct timeval when,
const char *fmt,
char *buf,
int bufsize)
252 snprintf(buf, bufsize,
"%ld.%06ld", (
long)when.tv_sec, (
long)when.tv_usec);
266 const char *fmt =
"%Y-%m-%d %T";
276 if (!strcasecmp(name,
"clid"))
278 else if (!strcasecmp(name,
"src"))
280 else if (!strcasecmp(name,
"dst"))
282 else if (!strcasecmp(name,
"dcontext"))
284 else if (!strcasecmp(name,
"channel"))
286 else if (!strcasecmp(name,
"dstchannel"))
288 else if (!strcasecmp(name,
"lastapp"))
290 else if (!strcasecmp(name,
"lastdata"))
292 else if (!strcasecmp(name,
"start"))
294 else if (!strcasecmp(name,
"answer"))
296 else if (!strcasecmp(name,
"end"))
297 cdr_get_tv(cdr->
end, raw ? NULL : fmt, workspace, workspacelen);
298 else if (!strcasecmp(name,
"duration")) {
300 }
else if (!strcasecmp(name,
"billsec")) {
302 }
else if (!strcasecmp(name,
"disposition")) {
304 snprintf(workspace, workspacelen,
"%ld", cdr->
disposition);
308 }
else if (!strcasecmp(name,
"amaflags")) {
310 snprintf(workspace, workspacelen,
"%ld", cdr->
amaflags);
314 }
else if (!strcasecmp(name,
"accountcode"))
316 else if (!strcasecmp(name,
"peeraccount"))
318 else if (!strcasecmp(name,
"uniqueid"))
320 else if (!strcasecmp(name,
"linkedid"))
322 else if (!strcasecmp(name,
"userfield"))
324 else if (!strcasecmp(name,
"sequence"))
325 snprintf(workspace, workspacelen,
"%d", cdr->
sequence);
336 static const char *
const cdr_readonly_vars[] = {
"clid",
"src",
"dst",
"dcontext",
"channel",
"dstchannel",
337 "lastapp",
"lastdata",
"start",
"answer",
"end",
"duration",
338 "billsec",
"disposition",
"amaflags",
"accountcode",
"uniqueid",
"linkedid",
339 "userfield",
"sequence", NULL };
357 ast_log(
LOG_ERROR,
"Attempt to set a variable on a nonexistent CDR record.\n");
361 for (; cdr; cdr = recur ? cdr->
next : NULL) {
385 struct ast_var_t *variables, *newvariable = NULL;
390 if (!to_cdr || !from_cdr)
415 int total = 0, x = 0, i;
419 for (; cdr; cdr = recur ? cdr->
next : NULL) {
458 for (; cdr; cdr = recur ? cdr->
next : NULL) {
510 struct ast_var_t *variablesfrom,*variablesto;
515 const char *fromvarname, *fromvarval;
516 const char *tovarname = NULL, *tovarval = NULL;
525 if ( strcasecmp(fromvarname,
ast_var_name(variablesto)) == 0 ) {
531 if (tovarname && strcasecmp(fromvarval,tovarval) != 0) {
532 ast_log(
LOG_NOTICE,
"Merging CDR's: variable %s value %s dropped in favor of value %s\n", tovarname, fromvarval, tovarval);
534 }
else if (tovarname && strcasecmp(fromvarval,tovarval) == 0)
548 int discard_from = 0;
575 while (lfrom && lfrom->
next) {
588 memcpy(&tcdr, to,
sizeof(tcdr));
590 memcpy(to, from,
sizeof(*to));
592 while (lfrom && lfrom->
next) {
599 if (llfrom == from) {
729 for (; cdr; cdr = cdr->
next) {
740 for (; cdr; cdr = cdr->
next) {
756 for (; cdr; cdr = cdr->
next) {
766 for (; cdr; cdr = cdr->
next) {
794 for (; cdr; cdr = cdr->
next) {
814 for (; cdr; cdr = cdr->
next) {
825 for (; cdr; cdr = cdr->
next) {
837 for (; cdr; cdr = cdr->
next) {
850 for (; cdr; cdr = cdr->
next) {
885 for (; cdr; cdr = cdr->
next) {
899 for ( ; cdr ; cdr = cdr->
next) {
935 for ( ; cdr ; cdr = cdr->
next) {
961 switch (disposition) {
985 return "DOCUMENTATION";
993 const char *old_acct =
"";
1000 for ( ; cdr ; cdr = cdr->
next) {
1009 "AccountCode: %s\r\n"
1010 "OldAccountCode: %s\r\n",
1019 const char *old_acct =
"";
1026 for ( ; cdr ; cdr = cdr->
next) {
1035 "PeerAccount: %s\r\n"
1036 "OldPeerAccount: %s\r\n",
1047 for (cdr = chan->
cdr; cdr; cdr = cdr->
next) {
1061 for ( ; cdr ; cdr = cdr->
next) {
1073 for ( ; cdr ; cdr = cdr->
next) {
1087 for ( ; cdr ; cdr = cdr->
next) {
1107 if (!strcasecmp(flag,
"default"))
1109 if (!strcasecmp(flag,
"omit"))
1111 if (!strcasecmp(flag,
"billing"))
1113 if (!strcasecmp(flag,
"documentation"))
1122 for ( ; cdr ; cdr = cdr->
next) {
1157 for ( ; cdr ; cdr = cdr->
next) {
1182 memset(&cdr->
end, 0,
sizeof(cdr->
end));
1208 memset(&cdr->
end, 0,
sizeof(cdr->
end));
1262 processeditem = batchitem;
1263 batchitem = batchitem->
next;
1288 ast_debug(1,
"CDR single-threaded batch processing begins now\n");
1292 ast_log(
LOG_WARNING,
"CDR processing thread could not detach, now trying in this thread\n");
1295 ast_debug(1,
"CDR multi-threaded batch processing begins now\n");
1332 int submit_batch = 0;
1353 ast_debug(1,
"CDR detaching from this thread\n");
1356 if (!(newtail =
ast_calloc(1,
sizeof(*newtail)))) {
1391 struct timespec timeout;
1402 timeout.tv_sec = now.tv_sec;
1403 timeout.tv_nsec = now.tv_usec * 1000;
1409 ast_debug(2,
"Processed %d scheduled CDR batches from the run queue\n", numevents);
1419 long nextbatchtime=0;
1423 e->
command =
"cdr show status";
1425 "Usage: cdr show status\n"
1426 " Displays the Call Detail Record engine system status.\n";
1436 ast_cli(a->
fd,
"Call Detail Record (CDR) settings\n");
1437 ast_cli(a->
fd,
"----------------------------------\n");
1443 ast_cli(a->
fd,
"* Batch Mode Settings\n");
1444 ast_cli(a->
fd,
" -------------------\n");
1451 ast_cli(a->
fd,
" Current batch size: %d record%s\n", cnt,
ESS(cnt));
1454 ast_cli(a->
fd,
" Next batch processing time: %ld second%s\n\n", nextbatchtime,
ESS(nextbatchtime));
1456 ast_cli(a->
fd,
"* Registered Backends\n");
1457 ast_cli(a->
fd,
" -------------------\n");
1479 "Usage: cdr submit\n"
1480 " Posts all pending batched CDR data to the configured CDR backend engine modules.\n";
1489 ast_cli(a->
fd,
"Submitted CDRs to backend engines for processing. This may take a while.\n");
1500 const char *enabled_value;
1501 const char *unanswered_value;
1502 const char *batched_value;
1503 const char *scheduleronly_value;
1504 const char *batchsafeshutdown_value;
1505 const char *size_value;
1506 const char *time_value;
1507 const char *end_before_h_value;
1508 const char *initiatedseconds_value;
1559 if (sscanf(size_value,
"%30d", &cfg_size) < 1)
1561 else if (cfg_size < 0)
1562 ast_log(
LOG_WARNING,
"Invalid maximum batch size '%d' specified, using default\n", cfg_size);
1567 if (sscanf(time_value,
"%30d", &cfg_time) < 1)
1569 else if (cfg_time < 0)
1570 ast_log(
LOG_WARNING,
"Invalid maximum batch time '%d' specified, using default\n", cfg_time);
1681 char workspace[256];
1688 for (tmpcdr = cdr; tmpcdr; tmpcdr = (recur ? tmpcdr->
next : NULL)) {
static void set_one_cid(struct ast_cdr *cdr, struct ast_channel *c)
int ast_cdr_setamaflags(struct ast_channel *chan, const char *amaflags)
Set AMA flags for channel.
const ast_string_field peeraccount
int ast_cdr_disposition(struct ast_cdr *cdr, int cause)
Save the result of the call based on the AST_CAUSE_*.
void ast_cdr_submit_batch(int shutdown)
Spawns (possibly) a new thread to submit a batch of CDRs to the backend engines.
int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int recur)
static char accountcode[AST_MAX_ACCOUNT_CODE]
int ast_cdr_isset_unanswered(void)
Main Channel structure associated with a channel.
char accountcode[AST_MAX_ACCOUNT_CODE]
#define AST_CLI_DEFINE(fn, txt,...)
void ast_cdr_failed(struct ast_cdr *cdr)
Fail a call.
char * str
Subscriber phone number (Malloced)
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
const char * ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable)
Gets a variable.
static const char config[]
The data tree to be returned by the callbacks and managed by functions local to this file...
char * str
Subscriber phone number (Malloced)
struct ast_party_caller caller
Channel Caller ID information.
static void reset_batch(void)
static void * do_batch_backend_process(void *data)
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized...
const ast_string_field uniqueid
static const int UNANSWERED_DEFAULT
static struct ast_cdr_batch * batch
int ast_cli_register(struct ast_cli_entry *e)
Registers a command or an array of commands.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
char dstchannel[AST_MAX_EXTENSION]
void ast_cdr_reset(struct ast_cdr *cdr, struct ast_flags *flags)
Reset the detail record, optionally posting it first.
static void * do_cdr(void *data)
#define ast_set2_flag(p, value, flag)
#define ast_test_flag(p, flag)
void ast_cdr_end(struct ast_cdr *cdr)
End a call.
const char * ast_var_value(const struct ast_var_t *var)
struct ast_party_name name
Subscriber name.
int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, const void *data) attribute_warn_unused_result
Adds a scheduled event Schedule an event to take place at some point in the future. callback will be called with data as the argument, when milliseconds into the future (approximately) If callback returns 0, no further events will be re-scheduled.
struct ast_var_t * ast_var_assign(const char *name, const char *value)
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
char context[AST_MAX_CONTEXT]
const char * ast_var_name(const struct ast_var_t *var)
int ast_cdr_appenduserfield(struct ast_channel *chan, const char *userfield)
Append to CDR user field for channel (stored in CDR)
#define ast_set_flag(p, flag)
int ast_cli_unregister(struct ast_cli_entry *e)
Unregisters a command or an array of commands.
descriptor for a cli entry.
static void post_cdr(struct ast_cdr *cdr)
static int batchsafeshutdown
static int cdr_seq_inc(struct ast_cdr *cdr)
char dcontext[AST_MAX_EXTENSION]
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
int ast_cdr_setaccount(struct ast_channel *chan, const char *account)
Set account code, will generate AMI event.
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
static int batchscheduleronly
static void do_reload(int reload)
static char * handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
#define AST_MAX_ACCOUNT_CODE
struct ast_cdr * ast_cdr_dup(struct ast_cdr *cdr)
Duplicate a record.
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
static ast_mutex_t cdr_sched_lock
static void cdr_engine_shutdown(void)
void ast_cdr_setdisposition(struct ast_cdr *cdr, long int disposition)
Set the disposition for a call.
Configuration File Parser.
char * str
Subscriber name (Malloced)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
#define ast_cond_init(cond, attr)
unsigned char valid
TRUE if the subaddress information is valid/present.
static int submit_scheduled_batch(const void *data)
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
static const int BATCH_TIME_DEFAULT
#define ast_mutex_lock(a)
struct ast_cdr_batch_item * head
static const int ENABLED_DEFAULT
#define ast_copy_flags(dest, src, flagz)
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
static const int BATCH_SCHEDULER_ONLY_DEFAULT
char * str
Malloced subaddress string.
char * ast_cdr_flags2str(int flags)
void ast_cli(int fd, const char *fmt,...)
const ast_string_field linkedid
static const char * ast_cdr_getvar_internal(struct ast_cdr *cdr, const char *name, int recur)
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
#define ast_cond_signal(cond)
struct ast_config * ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags)
Load a config file.
void ast_var_delete(struct ast_var_t *var)
#define ast_pthread_create_detached_background(a, b, c, d)
#define ast_verb(level,...)
void ast_config_destroy(struct ast_config *config)
Destroys a config.
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return * the previous value of *p. This can be used to handle reference co...
String fields in structures.
int(* ast_cdrbe)(struct ast_cdr *cdr)
CDR backend callback.
pthread_cond_t ast_cond_t
int ast_cdr_data_add_structure(struct ast_data *tree, struct ast_cdr *cdr, int recur)
#define ast_manager_event(chan, category, event, contents,...)
int ast_cdr_setuserfield(struct ast_channel *chan, const char *userfield)
Set CDR user field for channel (stored in CDR)
struct ast_cdr_batch_item * tail
#define ast_pthread_create_background(a, b, c, d)
#define CONFIG_STATUS_FILEMISSING
void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int recur, int raw)
struct ast_party_id id
Caller party ID.
int ast_cdr_setcid(struct ast_cdr *cdr, struct ast_channel *chan)
Initialize based on a channel.
char lastdata[AST_MAX_EXTENSION]
struct ast_cdr * ast_cdr_append(struct ast_cdr *cdr, struct ast_cdr *newcdr)
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_RWLIST_INSERT_HEAD
#define EVENT_FLAG_SYSTEM
#define ast_debug(level,...)
Log a DEBUG message.
int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
Register a CDR handling engine.
char * ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num, const char *unknown)
struct ast_party_id ani
Automatic Number Identification (ANI)
General Asterisk PBX channel definitions.
struct ast_party_dialed::@155 number
Dialed/Called number.
#define AST_SCHED_DEL(sched, id)
a loop construct to ensure that the scheduled task get deleted. The idea is that if we loop attemptin...
void ast_unregister_atexit(void(*func)(void))
Unregister a function registered with ast_register_atexit().
#define AST_PTHREADT_NULL
static force_inline int attribute_pure ast_strlen_zero(const char *s)
struct ast_data * ast_data_add_node(struct ast_data *root, const char *childname)
Add a container child.
#define AST_RWLIST_TRAVERSE
Scheduler Routines (derived from cheops)
void ast_cdr_answer(struct ast_cdr *cdr)
Answer a call.
char ast_default_accountcode[AST_MAX_ACCOUNT_CODE]
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
static ast_mutex_t cdr_pending_lock
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
int ast_register_atexit(void(*func)(void))
Register a function to be executed before Asterisk exits.
struct timeval ast_samp2tv(unsigned int _nsamp, unsigned int _rate)
Returns a timeval corresponding to the duration of n samples at rate r. Useful to convert samples to ...
void ast_cdr_setanswer(struct ast_cdr *cdr, struct timeval t)
Set the answer time for a call.
#define AST_RWLIST_REMOVE_CURRENT
static const char *const cdr_readonly_vars[]
static void cdr_get_tv(struct timeval when, const char *fmt, char *buf, int bufsize)
char dst[AST_MAX_EXTENSION]
static int init_batch(void)
A set of macros to manage forward-linked lists.
char channel[AST_MAX_EXTENSION]
static const int BATCH_SAFE_SHUTDOWN_DEFAULT
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
#define AST_CAUSE_NO_ANSWER
#define AST_LIST_MOVE_CURRENT(newhead, field)
struct ast_cdr * ast_cdr_dup_unique_swap(struct ast_cdr *cdr)
Duplicate a record and increment the sequence number of the old record.
struct ast_cdr_batch_item * next
int ast_cdr_update(struct ast_channel *chan)
Update CDR on a channel.
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN
static struct sched_context * sched
struct ast_party_dialed dialed
Dialed/Called information.
int ast_cdr_engine_reload(void)
Reload the configuration file cdr.conf and start/stop CDR scheduling thread.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define ast_strdupa(s)
duplicate a string in memory from the stack
static void check_post(struct ast_cdr *cdr)
print a warning if cdr already posted
struct ast_party_subaddress subaddress
Subscriber subaddress.
void ast_cdr_engine_term(void)
Responsible for call detail data.
char lastapp[AST_MAX_EXTENSION]
int ast_cdr_serialize_variables(struct ast_cdr *cdr, struct ast_str **buf, char delim, char sep, int recur)
void ast_cdr_start(struct ast_cdr *cdr)
Start a call.
int ast_tvcmp(struct timeval _a, struct timeval _b)
Compres two struct timeval instances returning -1, 0, 1 if the first arg is smaller, equal or greater to the second.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
void sched_context_destroy(struct sched_context *c)
destroys a schedule context Destroys (free's) the given sched_context structure
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
long ast_sched_when(struct sched_context *con, int id)
Returns the number of seconds before an event takes place.
static ast_cond_t cdr_pending_cond
static ast_mutex_t cdr_batch_lock
static const int BATCH_SIZE_DEFAULT
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ast_cdr_amaflags2int(const char *flag)
Convert a string to a detail record AMA flag.
void ast_cdr_detach(struct ast_cdr *cdr)
Detaches the detail record for posting (and freeing) either now or at a later time in bulk with other...
enum ast_channel_state _state
struct timeval ast_tvadd(struct timeval a, struct timeval b)
Returns the sum of two timevals a + b.
const ast_string_field name
void ast_cdr_specialized_reset(struct ast_cdr *cdr, struct ast_flags *flags)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
#define ast_cond_destroy(cond)
void ast_cdr_merge(struct ast_cdr *to, struct ast_cdr *from)
Move the non-null data from the "from" cdr to the "to" cdr.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
struct ast_var_t::@158 entries
char macrocontext[AST_MAX_CONTEXT]
int ast_cdr_copy_vars(struct ast_cdr *to_cdr, struct ast_cdr *from_cdr)
void ast_cdr_setapp(struct ast_cdr *cdr, const char *app, const char *data)
Set the last executed application.
int ast_cdr_setpeeraccount(struct ast_channel *chan, const char *account)
Set the peer account.
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm)
Special version of strftime(3) that handles fractions of a second. Takes the same arguments as strfti...
struct ast_party_subaddress subaddress
Dialed/Called subaddress.
Structure used to handle boolean flags.
#define ast_clear_flag(p, flag)
int ast_sched_runq(struct sched_context *con)
Runs the queue.
static const int BATCHMODE_DEFAULT
char src[AST_MAX_EXTENSION]
char peeraccount[AST_MAX_ACCOUNT_CODE]
char macroexten[AST_MAX_EXTENSION]
void ast_str_reset(struct ast_str *buf)
Reset the content of a dynamic string. Useful before a series of ast_str_append.
struct ast_cdr * ast_cdr_dup_unique(struct ast_cdr *cdr)
Duplicate a record and increment the sequence number.
void ast_cdr_discard(struct ast_cdr *cdr)
Discard and free a CDR record.
static struct ast_cli_entry cli_status
struct ast_flags ast_options
struct sched_context * sched_context_create(void)
New schedule context.
Standard Command Line Interface.
static void cdr_merge_vars(struct ast_cdr *to, struct ast_cdr *from)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
struct timeval ast_tv(ast_time_t sec, ast_suseconds_t usec)
Returns a timeval from sec, usec.
int ast_cdr_engine_init(void)
Load the configuration file cdr.conf and possibly start the CDR scheduling thread.
void ast_cdr_noanswer(struct ast_cdr *cdr)
A call wasn't answered.
int ast_sched_wait(struct sched_context *con) attribute_warn_unused_result
Determines number of seconds until the next outstanding event to take place Determine the number of s...
void ast_cdr_free(struct ast_cdr *cdr)
Free a CDR record.
const ast_string_field accountcode
Internal Asterisk hangup causes.
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
int check_cdr_enabled(void)
Return TRUE if CDR subsystem is enabled.
unsigned char valid
TRUE if the name information is valid/present.
char clid[AST_MAX_EXTENSION]
#define CONFIG_STATUS_FILEINVALID
static void submit_unscheduled_batch(void)
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
struct ast_data * ast_data_add_str(struct ast_data *root, const char *childname, const char *string)
Add a string node type.
static struct ast_cli_entry cli_submit
static char * handle_cli_submit(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
struct ast_data * ast_data_add_int(struct ast_data *root, const char *childname, int value)
Add an integer node type.
char * ast_cdr_disp2str(int disposition)
Disposition to a string.
void ast_cdr_setdestchan(struct ast_cdr *cdr, const char *chan)
Set the destination channel, if there was one.
void ast_cdr_free_vars(struct ast_cdr *cdr, int recur)
unsigned char valid
TRUE if the number information is valid/present.
#define ast_cond_timedwait(cond, mutex, time)
int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *chan)
Initialize based on a channel.
#define AST_RWLIST_TRAVERSE_SAFE_END
struct ast_cdr * ast_cdr_alloc(void)
Allocate a CDR record.
char exten[AST_MAX_EXTENSION]
#define AST_MUTEX_DEFINE_STATIC(mutex)
static pthread_t cdr_thread
void ast_cdr_unregister(const char *name)
Unregister a CDR handling engine.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
char userfield[AST_MAX_USER_FIELD]
#define CONFIG_STATUS_FILEUNCHANGED
#define ast_mutex_unlock(a)
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
void ast_cdr_busy(struct ast_cdr *cdr)
Busy a call.
struct ast_party_number number
Subscriber phone number.