Re: [asterisk-users] CDR with unix time.

2011-02-16 Thread Robert Thomas
What module are you using?

I have the cdr_mysql_addon.so module, and I can define alias for the
collums. I have an alias for start and end variable, and they both get
recorded as Unix EPOCH integers values on mysql. In Asterisk1.8 the collum
duration and billsec have milisec durations if you include the hrtimers
option.



On Sun, Feb 13, 2011 at 6:59 PM, Tilghman Lesher wrote:

> On Thursday 10 February 2011 12:33:40 Rodrigo Lang wrote:
> > 2011/2/10 Tilghman Lesher 
> >
> > > On Thursday 10 February 2011 06:13:38 Rodrigo Lang wrote:
> > > > I wonder if it is possible, without touching the source code, to
> > > > Asterisk save the cdr with date in unix time instead of the default
> > > > date. It's possible?
> > >
> > > The answer is, it depends upon the backend version you're using.  With
> > > cdr_pgsql and cdr_mysql from 1.6.2 forward, if the column type is
> > > integer or float, then the unix timestamp will be used.
> >
> > Without any modification? Only with the column type, Asterisk will
> > modify the common date to unix time?
>
> The idea behind this is that we don't want to lose any information.  Thus,
> if the datatype is numeric, then the only way to ensure that we don't lose
> information during the insert is to set the data to a unixtime format.
> Note that we can even store fractions of a second in this way, if the
> column type supports it (i.e. decimal or float).
>
> --
> Tilghman
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>   http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
Robert
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] CDR with unix time.

2011-02-13 Thread Tilghman Lesher
On Thursday 10 February 2011 12:33:40 Rodrigo Lang wrote:
> 2011/2/10 Tilghman Lesher 
> 
> > On Thursday 10 February 2011 06:13:38 Rodrigo Lang wrote:
> > > I wonder if it is possible, without touching the source code, to
> > > Asterisk save the cdr with date in unix time instead of the default
> > > date. It's possible?
> > 
> > The answer is, it depends upon the backend version you're using.  With
> > cdr_pgsql and cdr_mysql from 1.6.2 forward, if the column type is
> > integer or float, then the unix timestamp will be used.
> 
> Without any modification? Only with the column type, Asterisk will
> modify the common date to unix time?

The idea behind this is that we don't want to lose any information.  Thus,
if the datatype is numeric, then the only way to ensure that we don't lose
information during the insert is to set the data to a unixtime format.
Note that we can even store fractions of a second in this way, if the
column type supports it (i.e. decimal or float).

-- 
Tilghman

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] CDR with unix time.

2011-02-11 Thread Rodrigo Lang
2011/2/10 Tilghman Lesher 

> On Thursday 10 February 2011 06:13:38 Rodrigo Lang wrote:
> > I wonder if it is possible, without touching the source code, to
> > Asterisk save the cdr with date in unix time instead of the default
> > date. It's possible?
>
> The answer is, it depends upon the backend version you're using.  With
> cdr_pgsql and cdr_mysql from 1.6.2 forward, if the column type is integer
> or float, then the unix timestamp will be used.
>

Hi. I tested in the version 1.6.0 and works fine.

Thanks a lot.


Best regards,
-- 
Rodrigo Lang
Opening your mind - Just another Open Source
site
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] CDR with unix time.

2011-02-10 Thread Rodrigo Lang
2011/2/10 Tilghman Lesher 

> On Thursday 10 February 2011 06:13:38 Rodrigo Lang wrote:
> > I wonder if it is possible, without touching the source code, to
> > Asterisk save the cdr with date in unix time instead of the default
> > date. It's possible?
>
> The answer is, it depends upon the backend version you're using.  With
> cdr_pgsql and cdr_mysql from 1.6.2 forward, if the column type is integer
> or float, then the unix timestamp will be used.
>
>
Without any modification? Only with the column type, Asterisk will modify
the common date to unix time?

I use mysql.


The uniqueid don't work because i use ForkCDR.


The reason I want this change is because of the size of the tables. The
SELECT is extremely slow when searching for common date. With unix time the
search is from 60 to 80 percent faster.


Thanks a lot.
-- 
Rodrigo Lang
Opening your mind - Just another Open Source
site
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] CDR with unix time.

2011-02-10 Thread Tilghman Lesher
On Thursday 10 February 2011 07:41:56 Mindaugas Kezys wrote:
> On Thursday 10 February 2011 06:13:38 Rodrigo Lang wrote:
> > I wonder if it is possible, without touching the source code, to
> > Asterisk save the cdr with date in unix time instead of the default
> > date. It's possible?
>
> Just use uniqueid, which is exactly what you want. No modification is
> necessary.

That only works if a) he only wants the start time in unixtime, and b) if
he's not using ForkCDR, which causes CDRs to start at times after the
channel was created.

-- 
Tilghman

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] CDR with unix time.

2011-02-10 Thread Tilghman Lesher
On Thursday 10 February 2011 06:13:38 Rodrigo Lang wrote:
> I wonder if it is possible, without touching the source code, to
> Asterisk save the cdr with date in unix time instead of the default
> date. It's possible?

The answer is, it depends upon the backend version you're using.  With
cdr_pgsql and cdr_mysql from 1.6.2 forward, if the column type is integer
or float, then the unix timestamp will be used.

-- 
Tilghman

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] CDR with unix time.

2011-02-10 Thread Mindaugas Kezys
Just use uniqueid, which is exactly what you want. No modification is
necessary.

 

Regards,

Mindaugas Kezys

 

Kolmisoft UAB 

VoIP Billing Solutions

e-mail: i...@kolmisoft.com

URL: http://www.kolmisoft.com

Find us on Facebook
<http://www.facebook.com/pages/Vilnius-Lithuania/Kolmisoft/106746839379147> 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Rodrigo Lang
Sent: Thursday, February 10, 2011 2:14 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] CDR with unix time.

 

Good morning everyone.

I wonder if it is possible, without touching the source code, to Asterisk
save the cdr with date in unix time instead of the default date. It's
possible?


Thanks in advance,
-- 
Rodrigo Lang
Opening your mind - Just another Open Source site
<http://openingyourmind.wordpress.com/> 

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] CDR with unix time.

2011-02-10 Thread Faisal Hanif
Well. I suggest to use DB function instead of modifying asterisk source. You 
can add one additional column and write and after-insert trigger in your cdrs 
table which convert dattime to your required format and update the value of 
added column.

From: Rodrigo Lang 
Sent: Thursday, February 10, 2011 5:13 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion 
Subject: [asterisk-users] CDR with unix time.

Good morning everyone.

I wonder if it is possible, without touching the source code, to Asterisk save 
the cdr with date in unix time instead of the default date. It's possible?


Thanks in advance,
-- 
Rodrigo Lang
Opening your mind - Just another Open Source site





--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] CDR with unix time.

2011-02-10 Thread Rodrigo Lang
Good morning everyone.

I wonder if it is possible, without touching the source code, to Asterisk
save the cdr with date in unix time instead of the default date. It's
possible?


Thanks in advance,
-- 
Rodrigo Lang
Opening your mind - Just another Open Source
site
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users