#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>
#include <pthread.h>
Include dependency graph for cdr.c:
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_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. | |
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 121 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.
Definition at line 404 of file cdr.c. References AST_CDR_BILLING, AST_CDR_DOCUMENTATION, and AST_CDR_OMIT.
|
|
Answer a call.
Definition at line 144 of file cdr.c. References ast_cdr::answer, AST_CDR_ANSWERED, ast_log(), ast_cdr::channel, ast_cdr::disposition, LOG_WARNING, and ast_cdr::posted. Referenced by ast_answer(), and ast_read().
|
|
Definition at line 361 of file cdr.c. References ast_channel::cdr.
|
|
Busy a call.
Definition at line 159 of file cdr.c. References AST_CDR_BUSY, ast_log(), ast_cdr::channel, ast_cdr::disposition, LOG_WARNING, and ast_cdr::posted. Referenced by ast_cdr_disposition().
|
|
Disposition to a string.
Definition at line 313 of file cdr.c. 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_*.
Definition at line 182 of file cdr.c. References AST_CAUSE_BUSY, AST_CAUSE_FAILURE, AST_CAUSE_NORMAL, AST_CAUSE_NOTDEFINED, ast_cdr_busy(), ast_cdr_failed(), ast_log(), and LOG_WARNING. Referenced by __ast_request_and_dial().
|
|
End a call.
Definition at line 299 of file cdr.c. References ast_log(), ast_cdr::channel, ast_cdr::end, LOG_WARNING, ast_cdr::posted, and ast_cdr::start. Referenced by __ast_request_and_dial(), ast_cdr_reset(), ast_hangup(), and ast_read().
|
|
Fail a call.
Definition at line 171 of file cdr.c. References AST_CDR_FAILED, ast_log(), ast_cdr::channel, ast_cdr::disposition, LOG_WARNING, and ast_cdr::posted. Referenced by __ast_request_and_dial(), and ast_cdr_disposition().
|
|
Flags to a string.
Definition at line 329 of file cdr.c. References AST_CDR_BILLING, AST_CDR_DOCUMENTATION, and AST_CDR_OMIT.
|
|
Free a record.
Definition at line 106 of file cdr.c. References ast_log(), ast_cdr::channel, ast_cdr::end, free, LOG_WARNING, ast_cdr::posted, and ast_cdr::start. Referenced by ast_hangup().
|
|
Initialize based on a channel.
Definition at line 256 of file cdr.c. 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_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::src, ast_cdr::uniqueid, and ast_channel::uniqueid. Referenced by __ast_request_and_dial(), and ast_pbx_run().
|
|
Post the detail record.
Definition at line 417 of file cdr.c. References ast_cdr::answer, ast_log(), ast_mutex_lock, ast_mutex_unlock, ast_cdr::billsec, ast_cdr::channel, ast_cdr::duration, ast_cdr::end, LOG_WARNING, ast_cdr::posted, and ast_cdr::start. Referenced by ast_cdr_reset(), and ast_hangup().
|
|
Register a CDR handling engine.
Definition at line 49 of file cdr.c. References ast_log(), ast_mutex_lock, ast_mutex_unlock, LOG_WARNING, and malloc.
|
|
Reset the detail record, optionally posting it first.
Definition at line 445 of file cdr.c. 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::posted, and ast_cdr::start.
|
|
Definition at line 342 of file cdr.c. References ast_channel::accountcode, and ast_channel::cdr. Referenced by __ast_request_and_dial().
|
|
Set the last executed application.
Definition at line 217 of file cdr.c. References ast_log(), ast_cdr::channel, ast_cdr::lastapp, ast_cdr::lastdata, LOG_WARNING, and ast_cdr::posted. Referenced by __ast_request_and_dial(), and pbx_exec().
|
|
Initialize based on a channel.
Definition at line 233 of file cdr.c. References ast_channel::ani, ast_callerid_parse(), AST_MAX_EXTENSION, ast_shrink_phone_number(), ast_channel::callerid, ast_cdr::clid, and ast_cdr::src. Referenced by ast_set_callerid().
|
|
Set the destination channel, if there was one.
Definition at line 206 of file cdr.c. References ast_log(), ast_cdr::channel, ast_cdr::dstchannel, LOG_WARNING, and ast_cdr::posted.
|
|
Definition at line 352 of file cdr.c. References ast_channel::cdr.
|
|
Start a call.
Definition at line 131 of file cdr.c. References ast_log(), ast_cdr::channel, LOG_WARNING, ast_cdr::posted, and ast_cdr::start. Referenced by __ast_request_and_dial(), ast_cdr_reset(), and ast_pbx_run().
|
|
Unregister a CDR handling engine.
Definition at line 84 of file cdr.c. References ast_mutex_lock, ast_mutex_unlock, ast_verbose(), free, option_verbose, and VERBOSE_PREFIX_2.
|
|
Definition at line 373 of file cdr.c. References ast_channel::accountcode, ast_channel::ani, ast_callerid_parse(), AST_MAX_EXTENSION, ast_shrink_phone_number(), ast_channel::callerid, ast_channel::cdr, ast_channel::context, and ast_channel::exten. Referenced by __ast_request_and_dial(), and ast_pbx_run().
|
|
|
|
Definition at line 31 of file cdr.c. Referenced by ast_channel_alloc(). |
|
Definition at line 30 of file cdr.c. Referenced by ast_cdr_init(), and ast_channel_alloc(). |