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
8966c8ec
Commit
8966c8ec
authored
8 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "cdr_mysql: fix UTC support"
parents
9ef0eb64
d3ddf4b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addons/cdr_mysql.c
+8
-3
8 additions, 3 deletions
addons/cdr_mysql.c
configs/samples/cdr_mysql.conf.sample
+4
-1
4 additions, 1 deletion
configs/samples/cdr_mysql.conf.sample
with
12 additions
and
4 deletions
addons/cdr_mysql.c
+
8
−
3
View file @
8966c8ec
...
...
@@ -245,7 +245,7 @@ db_reconnect:
struct
ast_tm
tm
;
char
timestr
[
128
];
ast_localtime
(
&
tv
,
&
tm
,
ast_str_strlen
(
cdrzone
)
?
ast_str_buffer
(
cdrzone
)
:
NULL
);
ast_strftime
(
timestr
,
sizeof
(
timestr
),
"%Y-%m-%d %T"
,
&
tm
);
ast_strftime
(
timestr
,
sizeof
(
timestr
),
DATE_FORMAT
,
&
tm
);
value
=
ast_strdupa
(
timestr
);
cdrname
=
"calldate"
;
}
else
{
...
...
@@ -260,8 +260,7 @@ db_reconnect:
/* Need the type and value to determine if we want the raw value or not */
if
(
entry
->
staticvalue
)
{
value
=
ast_strdupa
(
entry
->
staticvalue
);
}
else
if
((
!
strcmp
(
cdrname
,
"start"
)
||
!
strcmp
(
cdrname
,
"answer"
)
||
}
else
if
((
!
strcmp
(
cdrname
,
"answer"
)
||
!
strcmp
(
cdrname
,
"end"
)
||
!
strcmp
(
cdrname
,
"disposition"
)
||
!
strcmp
(
cdrname
,
"amaflags"
))
&&
...
...
@@ -273,6 +272,12 @@ db_reconnect:
strstr
(
entry
->
type
,
"numeric"
)
||
strstr
(
entry
->
type
,
"fixed"
)))
{
ast_cdr_format_var
(
cdr
,
cdrname
,
&
value
,
workspace
,
sizeof
(
workspace
),
1
);
}
else
if
(
!
strcmp
(
cdrname
,
"start"
))
{
struct
ast_tm
tm
;
char
timestr
[
128
];
ast_localtime
(
&
cdr
->
start
,
&
tm
,
ast_str_strlen
(
cdrzone
)
?
ast_str_buffer
(
cdrzone
)
:
NULL
);
ast_strftime
(
timestr
,
sizeof
(
timestr
),
DATE_FORMAT
,
&
tm
);
value
=
ast_strdupa
(
timestr
);
}
else
if
(
!
strcmp
(
cdrname
,
"calldate"
))
{
/* Skip calldate - the value has already been dup'd */
}
else
{
...
...
This diff is collapsed.
Click to expand it.
configs/samples/cdr_mysql.conf.sample
+
4
−
1
View file @
8966c8ec
...
...
@@ -18,7 +18,10 @@
;user=asteriskcdruser
;port=3306
;sock=/tmp/mysql.sock
;timezone=UTC ; Previously called usegmtime
; By default CDRs are logged in the system's time zone
;cdrzone=UTC ; log CDRs with UTC
;usegmtime=yes ;log date/time in GMT. Default is "no"
;cdrzone=America/New_York ; or use a specific time zone
;
; If your system's locale differs from mysql database character set,
; cdr_mysql can damage non-latin characters in CDR variables. Use this
...
...
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