[asterisk-users] Cdr problem

Mark Michelson mmichelson at digium.com
Mon Mar 9 15:03:07 CDT 2009


Anthony Francis wrote:
> Tilghman Lesher wrote:
>> On Friday 06 March 2009 11:24:46 pm Hooman Peiro wrote:
>>   
>>> hi,
>>> I'm working with asterisk on a project and I found a problem with cdr_odbc.
>>> As we know, after answering each call a cdr event is raised which is saved
>>> in cdr_csv and cdr_odbc. but here my point is on cdr_odbc. some
>>> information, including start_time and end_time is given by cdr event but
>>> the problem is that these two information(start_time and end_time) is not
>>> getting save in cdr_odbc. I checked the source code and I found that by
>>> default it's not doing so. I need to query these two information, start
>>> time and end time, from cdr_odbc and I need your help.
>>> thanks
>>>     
>>
>> You are partially incorrect.  The start time is indeed stored in the CDR,
>> although the column name is 'calldate'.  As for the end time, it can be
>> derived by adding 'duration' (which is in whole seconds) to the 'calldate'
>> column.
>>
>> Another solution that allows for retrieving both columns with their native
>> names (or completely different names, whatever you map it to) is to use
>> cdr_adaptive_odbc in 1.6.0 and higher.
>>
>>   
> I have often thought, wouldn't it be better if the cdr config files 
> allowed you to specify column names i.e.
> calldate => callstart_datetime
> 
> Or whatever, the basic format being asteriskfieldname => db columnname.
> 
> Just an idea..
> 
> Anthony Francis
> 

This suggestion of yours is exactly what cdr_adaptive_odbc that Tilghman 
suggested does. If you're using Asterisk 1.6.0 or higher, take a look at 
configs/cdr_adaptive_odbc.conf.sample for some examples.

Mark Michelson



More information about the asterisk-users mailing list