Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
ddf9dcaa
Commit
ddf9dcaa
authored
10 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
10 years ago
Browse files
Options
Downloads
Plain Diff
Merge "cdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8"
parents
25b67ed6
8886b724
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES
+6
-0
6 additions, 0 deletions
CHANGES
cdr/cdr_csv.c
+10
-0
10 additions, 0 deletions
cdr/cdr_csv.c
configs/samples/cdr.conf.sample
+2
-0
2 additions, 0 deletions
configs/samples/cdr.conf.sample
with
18 additions
and
0 deletions
CHANGES
+
6
−
0
View file @
ddf9dcaa
...
@@ -40,6 +40,12 @@ cdr_odbc
...
@@ -40,6 +40,12 @@ cdr_odbc
* Added a new configuration option, "newcdrcolumns", which enables use of the
* Added a new configuration option, "newcdrcolumns", which enables use of the
post-1.8 CDR columns 'peeraccount', 'linkedid', and 'sequence'.
post-1.8 CDR columns 'peeraccount', 'linkedid', and 'sequence'.
------------------
cdr_csv
------------------
* Added a new configuration option, "newcdrcolumns", which enables use of the
post-1.8 CDR columns 'peeraccount', 'linkedid', and 'sequence'.
Channel Drivers
Channel Drivers
------------------
------------------
...
...
This diff is collapsed.
Click to expand it.
cdr/cdr_csv.c
+
10
−
0
View file @
ddf9dcaa
...
@@ -58,6 +58,7 @@ static int accountlogs = 1;
...
@@ -58,6 +58,7 @@ static int accountlogs = 1;
static
int
loguniqueid
=
0
;
static
int
loguniqueid
=
0
;
static
int
loguserfield
=
0
;
static
int
loguserfield
=
0
;
static
int
loaded
=
0
;
static
int
loaded
=
0
;
static
int
newcdrcolumns
=
0
;
static
const
char
config
[]
=
"cdr.conf"
;
static
const
char
config
[]
=
"cdr.conf"
;
/* #define CSV_LOGUNIQUEID 1 */
/* #define CSV_LOGUNIQUEID 1 */
...
@@ -113,6 +114,7 @@ static int load_config(int reload)
...
@@ -113,6 +114,7 @@ static int load_config(int reload)
usegmtime
=
0
;
usegmtime
=
0
;
loguniqueid
=
0
;
loguniqueid
=
0
;
loguserfield
=
0
;
loguserfield
=
0
;
newcdrcolumns
=
0
;
if
(
!
(
v
=
ast_variable_browse
(
cfg
,
"csv"
)))
{
if
(
!
(
v
=
ast_variable_browse
(
cfg
,
"csv"
)))
{
ast_config_destroy
(
cfg
);
ast_config_destroy
(
cfg
);
...
@@ -129,7 +131,10 @@ static int load_config(int reload)
...
@@ -129,7 +131,10 @@ static int load_config(int reload)
loguniqueid
=
ast_true
(
v
->
value
);
loguniqueid
=
ast_true
(
v
->
value
);
}
else
if
(
!
strcasecmp
(
v
->
name
,
"loguserfield"
))
{
}
else
if
(
!
strcasecmp
(
v
->
name
,
"loguserfield"
))
{
loguserfield
=
ast_true
(
v
->
value
);
loguserfield
=
ast_true
(
v
->
value
);
}
else
if
(
!
strcasecmp
(
v
->
name
,
"newcdrcolumns"
))
{
newcdrcolumns
=
ast_true
(
v
->
value
);
}
}
}
}
ast_config_destroy
(
cfg
);
ast_config_destroy
(
cfg
);
return
1
;
return
1
;
...
@@ -241,6 +246,11 @@ static int build_csv_record(char *buf, size_t bufsize, struct ast_cdr *cdr)
...
@@ -241,6 +246,11 @@ static int build_csv_record(char *buf, size_t bufsize, struct ast_cdr *cdr)
/* append the user field */
/* append the user field */
if
(
loguserfield
)
if
(
loguserfield
)
append_string
(
buf
,
cdr
->
userfield
,
bufsize
);
append_string
(
buf
,
cdr
->
userfield
,
bufsize
);
if
(
newcdrcolumns
)
{
append_string
(
buf
,
cdr
->
peeraccount
,
bufsize
);
append_string
(
buf
,
cdr
->
linkedid
,
bufsize
);
append_int
(
buf
,
cdr
->
sequence
,
bufsize
);
}
/* If we hit the end of our buffer, log an error */
/* If we hit the end of our buffer, log an error */
if
(
strlen
(
buf
)
<
bufsize
-
5
)
{
if
(
strlen
(
buf
)
<
bufsize
-
5
)
{
/* Trim off trailing comma */
/* Trim off trailing comma */
...
...
This diff is collapsed.
Click to expand it.
configs/samples/cdr.conf.sample
+
2
−
0
View file @
ddf9dcaa
...
@@ -154,6 +154,8 @@ usegmtime=yes ; log date/time in GMT. Default is "no"
...
@@ -154,6 +154,8 @@ usegmtime=yes ; log date/time in GMT. Default is "no"
loguniqueid=yes ; log uniqueid. Default is "no"
loguniqueid=yes ; log uniqueid. Default is "no"
loguserfield=yes ; log user field. Default is "no"
loguserfield=yes ; log user field. Default is "no"
accountlogs=yes ; create separate log file for each account code. Default is "yes"
accountlogs=yes ; create separate log file for each account code. Default is "yes"
;newcdrcolumns=yes ; Enable logging of post-1.8 CDR columns (peeraccount, linkedid, sequence).
; Default is "no".
;[radius]
;[radius]
;usegmtime=yes ; log date/time in GMT
;usegmtime=yes ; log date/time in GMT
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment