|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Call Detail Record (CDR) dialplan function" , .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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
|
static struct ast_module_info * | ast_module_info = &__mod_info |
|
static struct ast_app_option | cdr_func_options [128] = { [ 'f' ] = { .flag = OPT_FLOAT }, [ 'l' ] = { .flag = OPT_LAST }, [ 'r' ] = { .flag = OPT_RECURSIVE }, [ 's' ] = { .flag = OPT_SKIPLOCKED }, [ 'u' ] = { .flag = OPT_UNPARSED }, } |
|
static struct ast_custom_function | cdr_function |
|
Call Detail Record related dialplan functions.
- Author
- Anthony Minessale II
Definition in file func_cdr.c.
static int cdr_read |
( |
struct ast_channel * |
chan, |
|
|
const char * |
cmd, |
|
|
char * |
parse, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
static |
Definition at line 197 of file func_cdr.c.
References ast_cdr::answer, args, AST_APP_ARG, ast_app_parse_options(), AST_CDR_FLAG_LOCKED, ast_cdr_getvar(), ast_channel_lock, ast_channel_unlock, AST_DECLARE_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strlen_zero(), ast_test_flag, ast_tvdiff_us(), ast_tvnow(), ast_tvzero(), ast_channel::cdr, cdr_func_options, ast_cdr::end, ast_cdr::next, OPT_FLOAT, OPT_LAST, OPT_RECURSIVE, OPT_SKIPLOCKED, OPT_UNPARSED, and ast_cdr::start.
240 snprintf(buf,
len,
"%lf", hrtime);
242 snprintf(buf,
len,
"%lf", 0.0);
253 snprintf(buf,
len,
"%lf", hrtime);
static struct ast_app_option cdr_func_options[128]
#define ast_channel_lock(chan)
#define ast_test_flag(p, flag)
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
int ast_tvzero(const struct timeval t)
Returns true if the argument is 0,0.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int recur, int raw)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Responsible for call detail data.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
Structure used to handle boolean flags.
int64_t ast_tvdiff_us(struct timeval end, struct timeval start)
Computes the difference (in microseconds) between two struct timeval instances.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static int cdr_write |
( |
struct ast_channel * |
chan, |
|
|
const char * |
cmd, |
|
|
char * |
parse, |
|
|
const char * |
value |
|
) |
| |
|
static |
Definition at line 268 of file func_cdr.c.
References args, AST_APP_ARG, ast_app_parse_options(), ast_cdr_setaccount(), ast_cdr_setamaflags(), ast_cdr_setpeeraccount(), ast_cdr_setuserfield(), ast_cdr_setvar(), ast_channel_lock, ast_channel_unlock, AST_DECLARE_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strlen_zero(), ast_test_flag, ast_channel::cdr, cdr_func_options, ast_cdr::next, OPT_LAST, and OPT_RECURSIVE.
297 if (!strcasecmp(
args.variable,
"accountcode"))
299 else if (!strcasecmp(
args.variable,
"peeraccount"))
301 else if (!strcasecmp(
args.variable,
"userfield"))
303 else if (!strcasecmp(
args.variable,
"amaflags"))
int ast_cdr_setamaflags(struct ast_channel *chan, const char *amaflags)
Set AMA flags for channel.
static struct ast_app_option cdr_func_options[128]
int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int recur)
#define ast_channel_lock(chan)
#define ast_test_flag(p, flag)
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
int ast_cdr_setaccount(struct ast_channel *chan, const char *account)
Set account code, will generate AMI event.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
int ast_cdr_setuserfield(struct ast_channel *chan, const char *userfield)
Set CDR user field for channel (stored in CDR)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Responsible for call detail data.
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
int ast_cdr_setpeeraccount(struct ast_channel *chan, const char *account)
Set the peer account.
Structure used to handle boolean flags.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.