26 #ifndef _ASTERISK_CDR_H
27 #define _ASTERISK_CDR_H
72 #define AST_MAX_USER_FIELD 256
73 #define AST_MAX_ACCOUNT_CODE 45
136 void ast_cdr_getvar(
struct ast_cdr *cdr,
const char *
name,
char **ret,
char *workspace,
int workspacelen,
int recur,
int raw);
int ast_cdr_setamaflags(struct ast_channel *chan, const char *amaflags)
Set AMA flags for channel.
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)
int ast_cdr_isset_unanswered(void)
Main Channel structure associated with a channel.
char accountcode[AST_MAX_ACCOUNT_CODE]
void ast_cdr_failed(struct ast_cdr *cdr)
Fail a call.
The data tree to be returned by the callbacks and managed by functions local to this file...
#define AST_MAX_USER_FIELD
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.
void ast_cdr_end(struct ast_cdr *cdr)
End a call.
int ast_cdr_appenduserfield(struct ast_channel *chan, const char *userfield)
Append to CDR user field for channel (stored in CDR)
char dcontext[AST_MAX_EXTENSION]
int ast_cdr_setaccount(struct ast_channel *chan, const char *account)
Set account code, will generate AMI event.
#define AST_MAX_ACCOUNT_CODE
struct ast_cdr * ast_cdr_dup(struct ast_cdr *cdr)
Duplicate a record.
void ast_cdr_setdisposition(struct ast_cdr *cdr, long int disposition)
Set the disposition for a call.
char * ast_cdr_flags2str(int flags)
int(* ast_cdrbe)(struct ast_cdr *cdr)
CDR backend callback.
int ast_cdr_data_add_structure(struct ast_data *tree, struct ast_cdr *cdr, int recur)
int ast_cdr_setuserfield(struct ast_channel *chan, const char *userfield)
Set CDR user field for channel (stored in CDR)
void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int recur, int raw)
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)
int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
Register a CDR handling engine.
General Asterisk PBX channel definitions.
#define AST_MAX_EXTENSION
void ast_cdr_answer(struct ast_cdr *cdr)
Answer a call.
char ast_default_accountcode[AST_MAX_ACCOUNT_CODE]
void ast_cdr_setanswer(struct ast_cdr *cdr, struct timeval t)
Set the answer time for a call.
char dst[AST_MAX_EXTENSION]
char channel[AST_MAX_EXTENSION]
struct ast_cdr * ast_cdr_dup_unique_swap(struct ast_cdr *cdr)
Duplicate a record and increment the sequence number of the old record.
int ast_cdr_update(struct ast_channel *chan)
Update CDR on a channel.
int ast_cdr_engine_reload(void)
Reload the configuration file cdr.conf and start/stop CDR scheduling thread.
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.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
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...
void ast_cdr_specialized_reset(struct ast_cdr *cdr, struct ast_flags *flags)
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.
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.
Structure used to handle boolean flags.
char src[AST_MAX_EXTENSION]
char peeraccount[AST_MAX_ACCOUNT_CODE]
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.
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.
void ast_cdr_free(struct ast_cdr *cdr)
Free a CDR record.
int check_cdr_enabled(void)
Return TRUE if CDR subsystem is enabled.
char clid[AST_MAX_EXTENSION]
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)
int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *chan)
Initialize based on a channel.
struct ast_cdr * ast_cdr_alloc(void)
Allocate a CDR record.
void ast_cdr_unregister(const char *name)
Unregister a CDR handling engine.
char userfield[AST_MAX_USER_FIELD]
void ast_cdr_busy(struct ast_cdr *cdr)
Busy a call.