[asterisk-bugs] [JIRA] (ASTERISK-27165) CDR: CDR(start, u) function won't work in cdr_custom config

Asterisk Team (JIRA) noreply at issues.asterisk.org
Fri Oct 13 12:59:32 CDT 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-27165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asterisk Team updated ASTERISK-27165:
-------------------------------------

    Target Release Version/s: 14.7.0

> CDR: CDR(start,u) function won't work in cdr_custom config
> ----------------------------------------------------------
>
>                 Key: ASTERISK-27165
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27165
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/cdr_custom
>    Affects Versions: 14.6.0
>            Reporter: Jacek Konieczny
>      Target Release: 14.7.0, 13.18.0
>
>
> We have been using:
> {noformat}
> ${CSV_QUOTE(${STRFTIME(${CDR(start,u)},GMT,%Y-%m-%d %H:%M:%S)})}
> {noformat}
> in out cdr_custom config to force GMT timestamps in the CDR. 
> This used to work properly with Asterisk 13. Recently, most probably after upgrade to Asterisk 14, instead of returning proper date this shows some unexpected '1970-01-01' timestamps.
> To check what exactly is failing I have tried:
> {noformat}
> [mappings]
> Master.csv => ${CDR(start)},${CDR(start,u)},${STRFTIME(${CDR(start,u)},GMT,%Y-%m-%d %H:%M:%S)},${CSV_QUOTE(${STRFTIME(${CDR(start,u)},GMT,%Y-%m-%d %H:%M:%S)})}
> {noformat}
> And got CDR records like these:
> {noformat}
> 2017-07-31 10:27:16,2017-07-31 10:27:16,1970-01-01 00:33:37,"1970-01-01 00:33:37"
> 2017-07-31 10:30:47,2017-07-31 10:30:47,1970-01-01 00:33:37,"1970-01-01 00:33:37"
> 2017-07-31 10:30:46,2017-07-31 10:30:46,1970-01-01 00:33:37,"1970-01-01 00:33:37"
> 2017-07-31 10:30:43,2017-07-31 10:30:43,1970-01-01 00:33:37,"1970-01-01 00:33:37"
> {noformat}
> Please note how the second field is a 'human-readable' date instead of unformatted timestamp we should get using the 'u' option.
> I have also tried to use the CDR(start,u) function in the dialplan:
> {noformat}
> exten => 200,1,Answer
> exten => 200,n,Verbose(1,Parsed: ${CDR(start)})
> exten => 200,n,Verbose(1,Unparsed: ${CDR(start,u)})
> {noformat}
> … and, strangely enough, it worked properly:
> {noformat}
>  Parsed: 2017-07-31 10:57:34
>  Unparsed: 1501491454.043537
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list