mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 11:42:27 +00:00
Whitespace and curly braces.
........ Merged revisions 397885 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -241,9 +241,11 @@ static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ast_test_flag(&flags, OPT_FLOAT) && (!strcasecmp("billsec", args.variable) || !strcasecmp("duration", args.variable))) {
|
||||
if (ast_test_flag(&flags, OPT_FLOAT)
|
||||
&& (!strcasecmp("billsec", args.variable) || !strcasecmp("duration", args.variable))) {
|
||||
long ms;
|
||||
double dtime;
|
||||
|
||||
if (sscanf(tempbuf, "%30ld", &ms) != 1) {
|
||||
ast_log(AST_LOG_WARNING, "Unable to parse %s (%s) from the CDR for channel %s\n",
|
||||
args.variable, tempbuf, ast_channel_name(chan));
|
||||
@@ -259,6 +261,7 @@ static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
|
||||
struct ast_tm tm;
|
||||
/* tv_usec is suseconds_t, which could be int or long */
|
||||
long int tv_usec;
|
||||
|
||||
if (sscanf(tempbuf, "%ld.%ld", &fmt_time.tv_sec, &tv_usec) != 2) {
|
||||
ast_log(AST_LOG_WARNING, "Unable to parse %s (%s) from the CDR for channel %s\n",
|
||||
args.variable, tempbuf, ast_channel_name(chan));
|
||||
@@ -269,6 +272,7 @@ static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
|
||||
ast_strftime(tempbuf, sizeof(*tempbuf), "%Y-%m-%d %T", &tm);
|
||||
} else if (!strcasecmp("disposition", args.variable)) {
|
||||
int disposition;
|
||||
|
||||
if (sscanf(tempbuf, "%8d", &disposition) != 1) {
|
||||
ast_log(AST_LOG_WARNING, "Unable to parse %s (%s) from the CDR for channel %s\n",
|
||||
args.variable, tempbuf, ast_channel_name(chan));
|
||||
@@ -278,6 +282,7 @@ static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
|
||||
strcpy(tempbuf, format_buf);
|
||||
} else if (!strcasecmp("amaflags", args.variable)) {
|
||||
int amaflags;
|
||||
|
||||
if (sscanf(tempbuf, "%8d", &amaflags) != 1) {
|
||||
ast_log(AST_LOG_WARNING, "Unable to parse %s (%s) from the CDR for channel %s\n",
|
||||
args.variable, tempbuf, ast_channel_name(chan));
|
||||
@@ -301,13 +306,15 @@ static int cdr_write(struct ast_channel *chan, const char *cmd, char *parse,
|
||||
AST_APP_ARG(options);
|
||||
);
|
||||
|
||||
if (ast_strlen_zero(parse) || !value || !chan)
|
||||
if (ast_strlen_zero(parse) || !value || !chan) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
if (!ast_strlen_zero(args.options))
|
||||
if (!ast_strlen_zero(args.options)) {
|
||||
ast_app_parse_options(cdr_func_options, &flags, NULL, args.options);
|
||||
}
|
||||
|
||||
if (!strcasecmp(args.variable, "accountcode")) {
|
||||
ast_log(AST_LOG_WARNING, "Using the CDR function to set 'accountcode' is deprecated. Please use the CHANNEL function instead.\n");
|
||||
|
Reference in New Issue
Block a user