[asterisk-bugs] [JIRA] Closed: (ASTERISK-19860) Wrong CDR duration values because of dependency to CDR write time especially in cdr batch mode

Matt Jordan (JIRA) noreply at issues.asterisk.org
Fri Aug 24 08:42:07 CDT 2012


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

Matt Jordan closed ASTERISK-19860.
----------------------------------

    Resolution: Fixed

> Wrong CDR duration values because of dependency to CDR write time especially in cdr batch mode
> ----------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-19860
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-19860
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/General
>    Affects Versions: 1.8.11.1
>            Reporter: Thomas Arimont
>            Assignee: Matt Jordan
>
> Our CDR statistis contain lots of items with wrong duration values where the CDR disposition is 'BUSY'. 
> Duration values in connection with the disposition 'BUSY' however should either
> a) be set to (approx.) 0 if a call is rejected immediately (destination not found, channel unavailable, and so on) 
> or
> b) be set to the elapsed ringing time if the call is rejected by the user/endpoint
> I guess that someone has tried to resolve some problematical cases where a cdr end time was not written due to some reason.
> This is done in the function ast_cdr_getvar() (cdr.c) by simply overwriting the cdr duration with a new calculated value based on the cdr write time as a substitute for the missing cdr end time. 
> Especially in cdr batch mode the actual time of writing of a cdr can widely differ from the (missing) end time and this finally leads to the inaccurate values. 
> {noformat}
> void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int recur, int raw)
> {
> ...
> 	else if (!strcasecmp(name, "duration"))
> 		snprintf(workspace, workspacelen, "%ld", cdr->duration ? cdr->duration : (long)ast_tvdiff_ms(ast_tvnow(), cdr->start) / 1000);
> ...
> }
> {noformat}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list