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:0...@sipx.voip> where > start_time> '2010-03-01' ; > > In order to get all calls to<sip:0...@sipx.voip> starting from March > 1st > > or > > select * from cdrs where callee_aor is<sip:0...@sipx.voip> where > start_time> '2010-03-01' and start_time< '2010-03-04' ; > > In order to get all calls to<sip:0...@sipx.voip> 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:0...@sipx.voip>' or callee_aor like '%6154670...@sipx.voip>' or callee_aor like '%0...@sipx.voip>') 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 sipx-users@list.sipfoundry.org 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/