On 3/3/2010 1:51 PM, Raymond Dans wrote: > > The changes in 4.2 to the CDR records are mostly related to new fields > being added. There are some other types of changes to existing fields > (termination) but they're pretty minor and shouldn't impact you. > > For your sql query regarding the dates, I typically use something like: > > select * from cdrs where callee_aor is<sip:[email protected]> where > start_time> '2010-03-01' ; > > In order to get all calls to<sip:[email protected]> starting from March > 1st > > or > > select * from cdrs where callee_aor is<sip:[email protected]> where > start_time> '2010-03-01' and start_time< '2010-03-04' ; > > In order to get all calls to<sip:[email protected]> from March 1st to > March 3rd (excludes March 4th) > > > Thanks! I just about have it. This may not be the most elegant way to do it, but it is working.
psql -H -d SIPXCDR -U postgres -c "select caller_aor,callee_aor,start_time,end_time,end_time-start_time as "Duration" from cdrs where (caller_aor = '<sip:[email protected]>' or callee_aor like '%[email protected]>' or callee_aor like '%[email protected]>') and start_time > current_date - 7;" This gets all calls in the last week to or from extension 0142 which has DID alias 6154670172. _______________________________________________ sipx-users mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipx-users Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-users sipXecs IP PBX -- http://www.sipfoundry.org/
