[Asterisk-Users] CDR Output

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Tue Mar 4 12:41:03 MST 2003


On Tuesday 04 March 2003 01:12 pm, Steven Critchfield wrote:
> On Tue, 2003-03-04 at 12:57, Matthew S. Hill wrote:
> > I am pushing all the cdr info to a MySQL database on a separate
> > machine. I have noticed that the duration times for all calls are
> > recorded in seconds, by Asterisk. Is there a way to set the
> > recorded call duration to a decimal representation of minutes? ie
> > 90 sec = 1.5 min. My extraction process would be a little simpler
> > if the data dumped into the database were minutes and not
> > seconds.
>
> It is opensource, and all you are looking at is changing a printf
> statement to output duration/60 and change the type so it can
> handle the decimal.
>
> Just a friendly jab, not a start to a flame war.
>
> If you where on postgres you could just create a view that showed
> duration as duration/60. I believe there is even another function
> in postgres that would allow you to round it to the precision you
> are comfortable with seeing.
>
> Not to mention it would have been possible to create a trigger on
> insert that did the conversion for you so that by the time the data
> was stored it was the way you wanted it.

Or just change the field in the SELECT clause to:
	duration/60 AS duration

-Tilghman




More information about the asterisk-users mailing list