#include <asterisk/lock.h>
#include <asterisk/channel.h>
#include <asterisk/cdr.h>
#include <asterisk/logger.h>
#include <asterisk/callerid.h>
#include <asterisk/causes.h>
#include <asterisk/options.h>
#include <asterisk/utils.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | ast_cdr_beitem |
Functions | |
AST_MUTEX_DEFINE_STATIC (cdrlock) | |
int | ast_cdr_register (char *name, char *desc, ast_cdrbe be) |
Register a CDR handling engine. | |
void | ast_cdr_unregister (char *name) |
Unregister a CDR handling engine. | |
void | ast_cdr_free (struct ast_cdr *cdr) |
Free a record. | |
ast_cdr * | ast_cdr_alloc (void) |
Allocate a record. | |
void | ast_cdr_start (struct ast_cdr *cdr) |
Start a call. | |
void | ast_cdr_answer (struct ast_cdr *cdr) |
Answer a call. | |
void | ast_cdr_busy (struct ast_cdr *cdr) |
Busy a call. | |
void | ast_cdr_failed (struct ast_cdr *cdr) |
Fail a call. | |
int | ast_cdr_disposition (struct ast_cdr *cdr, int cause) |
Save the result of the call based on the AST_CAUSE_*. | |
void | ast_cdr_setdestchan (struct ast_cdr *cdr, char *chann) |
Set the destination channel, if there was one. | |
void | ast_cdr_setapp (struct ast_cdr *cdr, char *app, char *data) |
Set the last executed application. | |
int | ast_cdr_setcid (struct ast_cdr *cdr, struct ast_channel *c) |
Initialize based on a channel. | |
int | ast_cdr_init (struct ast_cdr *cdr, struct ast_channel *c) |
Initialize based on a channel. | |
void | ast_cdr_end (struct ast_cdr *cdr) |
End a call. | |
char * | ast_cdr_disp2str (int disposition) |
Disposition to a string. | |
char * | ast_cdr_flags2str (int flag) |
Flags to a string. | |
int | ast_cdr_setaccount (struct ast_channel *chan, char *account) |
int | ast_cdr_setamaflags (struct ast_channel *chan, char *flag) |
int | ast_cdr_setuserfield (struct ast_channel *chan, char *userfield) |
int | ast_cdr_appenduserfield (struct ast_channel *chan, char *userfield) |
int | ast_cdr_update (struct ast_channel *c) |
int | ast_cdr_amaflags2int (char *flag) |
Convert a string to a detail record AMA flag. | |
void | ast_cdr_post (struct ast_cdr *cdr) |
Post the detail record. | |
void | ast_cdr_reset (struct ast_cdr *cdr, int post) |
Reset the detail record, optionally posting it first. | |
void | ast_cdr_append (struct ast_cdr *cdr, struct ast_cdr *newcdr) |
Variables | |
int | ast_default_amaflags = AST_CDR_DOCUMENTATION |
char | ast_default_accountcode [20] = "" |
|
Allocate a record. Returns a malloc'd ast_cdr structure, returns NULL on error (malloc failure) Definition at line 124 of file cdr.c. References malloc. Referenced by __ast_request_and_dial(), and ast_pbx_run().
|
|
Convert a string to a detail record AMA flag.
References AST_CDR_BILLING, AST_CDR_DOCUMENTATION, and AST_CDR_OMIT. Referenced by ast_cdr_setamaflags().
|
|
Answer a call.
References ast_cdr::answer, AST_CDR_ANSWERED, AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_cdr::channel, ast_cdr::disposition, LOG_WARNING, and ast_cdr::next. Referenced by ast_answer(), and ast_read().
|
|
Definition at line 523 of file cdr.c. References ast_log(), LOG_ERROR, and ast_cdr::next.
|
|
Definition at line 404 of file cdr.c. References AST_CDR_FLAG_LOCKED, ast_cdr_has_flag, and ast_channel::cdr.
|
|
Busy a call.
References AST_CDR_BUSY, AST_CDR_FLAG_LOCKED, AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_cdr::channel, ast_cdr::disposition, LOG_WARNING, and ast_cdr::next. Referenced by ast_cdr_disposition().
|
|
Disposition to a string.
References AST_CDR_ANSWERED, AST_CDR_BUSY, AST_CDR_FAILED, and AST_CDR_NOANSWER.
|
|
Save the result of the call based on the AST_CAUSE_*.
References AST_CAUSE_BUSY, AST_CAUSE_FAILURE, AST_CAUSE_NORMAL, AST_CAUSE_NOTDEFINED, ast_cdr_busy(), ast_cdr_failed(), ast_log(), LOG_WARNING, and ast_cdr::next. Referenced by __ast_request_and_dial().
|
|
End a call.
References AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_cdr::channel, ast_cdr::end, LOG_WARNING, ast_cdr::next, and ast_cdr::start. Referenced by __ast_request_and_dial(), ast_cdr_reset(), ast_hangup(), and ast_read().
|
|
Fail a call.
References AST_CDR_FAILED, AST_CDR_FLAG_LOCKED, AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_cdr::channel, ast_cdr::disposition, LOG_WARNING, and ast_cdr::next. Referenced by __ast_request_and_dial(), and ast_cdr_disposition().
|
|
Flags to a string.
References AST_CDR_BILLING, AST_CDR_DOCUMENTATION, and AST_CDR_OMIT.
|
|
Free a record. Definition at line 106 of file cdr.c. References AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_cdr::channel, ast_cdr::end, free, LOG_WARNING, ast_cdr::next, and ast_cdr::start. Referenced by ast_hangup().
|
|
Initialize based on a channel.
References ast_channel::_state, ast_cdr::accountcode, ast_channel::accountcode, ast_channel::amaflags, ast_cdr::amaflags, ast_channel::ani, ast_callerid_parse(), AST_CDR_ANSWERED, AST_CDR_FLAG_LOCKED, ast_cdr_has_flag, AST_CDR_NOANSWER, ast_default_amaflags, ast_log(), AST_MAX_EXTENSION, ast_shrink_phone_number(), AST_STATE_UP, ast_channel::callerid, ast_cdr::channel, ast_cdr::clid, ast_channel::context, ast_cdr::dcontext, ast_cdr::disposition, ast_cdr::dst, ast_channel::exten, LOG_WARNING, ast_channel::name, ast_cdr::next, ast_cdr::src, ast_cdr::uniqueid, and ast_channel::uniqueid. Referenced by __ast_request_and_dial(), and ast_pbx_run().
|
|
Post the detail record.
References ast_cdr::answer, ast_cdr_add_flag, AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_mutex_lock, ast_mutex_unlock, ast_cdr::billsec, ast_cdr::channel, ast_cdr::duration, ast_cdr::end, LOG_WARNING, ast_cdr::next, and ast_cdr::start. Referenced by ast_cdr_reset(), and ast_hangup().
|
|
Register a CDR handling engine.
References ast_cdrbe, ast_log(), ast_mutex_lock, ast_mutex_unlock, LOG_WARNING, and malloc.
|
|
Reset the detail record, optionally posting it first.
References ast_cdr::answer, ast_cdr_end(), AST_CDR_NOANSWER, ast_cdr_post(), ast_cdr_start(), ast_cdr::billsec, ast_cdr::disposition, ast_cdr::duration, ast_cdr::end, ast_cdr::flags, ast_cdr::next, and ast_cdr::start.
|
|
Definition at line 367 of file cdr.c. References ast_channel::accountcode, AST_CDR_FLAG_LOCKED, ast_cdr_has_flag, and ast_channel::cdr. Referenced by __ast_request_and_dial().
|
|
Definition at line 380 of file cdr.c. References ast_cdr_amaflags2int(), and ast_channel::cdr.
|
|
Set the last executed application.
References AST_CDR_FLAG_LOCKED, AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_cdr::channel, ast_cdr::lastapp, ast_cdr::lastdata, LOG_WARNING, and ast_cdr::next. Referenced by __ast_request_and_dial(), and pbx_exec().
|
|
Initialize based on a channel.
References ast_channel::ani, ast_callerid_parse(), AST_CDR_FLAG_LOCKED, ast_cdr_has_flag, AST_MAX_EXTENSION, ast_shrink_phone_number(), ast_channel::callerid, ast_cdr::clid, ast_cdr::next, and ast_cdr::src. Referenced by ast_set_callerid().
|
|
Set the destination channel, if there was one.
References AST_CDR_FLAG_LOCKED, AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_cdr::channel, ast_cdr::dstchannel, LOG_WARNING, and ast_cdr::next.
|
|
Definition at line 392 of file cdr.c. References AST_CDR_FLAG_LOCKED, ast_cdr_has_flag, and ast_channel::cdr.
|
|
Start a call.
References AST_CDR_FLAG_LOCKED, AST_CDR_FLAG_POSTED, ast_cdr_has_flag, ast_log(), ast_cdr::channel, LOG_WARNING, ast_cdr::next, and ast_cdr::start. Referenced by __ast_request_and_dial(), ast_cdr_reset(), and ast_pbx_run().
|
|
Unregister a CDR handling engine.
References ast_mutex_lock, ast_mutex_unlock, ast_verbose(), free, option_verbose, and VERBOSE_PREFIX_2.
|
|
Definition at line 419 of file cdr.c. References ast_channel::accountcode, ast_channel::ani, ast_callerid_parse(), AST_CDR_FLAG_LOCKED, ast_cdr_has_flag, AST_MAX_EXTENSION, ast_shrink_phone_number(), ast_channel::callerid, ast_channel::cdr, ast_channel::context, ast_channel::exten, ast_channel::macrocontext, and ast_channel::macroexten. Referenced by __ast_request_and_dial(), and ast_pbx_run().
|
|
|
|
Definition at line 30 of file cdr.c. Referenced by ast_channel_alloc(). |
|
Definition at line 29 of file cdr.c. Referenced by ast_cdr_init(), and ast_channel_alloc(). |