Hey folks! I have some weird results I am getting when querying my CDR table from asteriskcdrdb. I am using this query
SELECT
calldate AS Timestamp,
clid AS Caller,
src AS Source,
dst AS Destination,
SEC_TO_TIME(duration) AS Duration,
uniqueid AS ID_if_needed
FROM asteriskcdrdb.cdr WHERE src LIKE '66%' AND calldate >
date_sub(now(),
interval 24 HOUR) GROUP BY ID_if_needed,
ID_if_needed ORDER BY Timestamp DESC,
ID_if_needed DESC
I get some results from this. I would think I should see any extension starting with “66” from that past day with this query.
When I go and look inside ucp at one of my extensions that don’t show up in this query at all for its call history I see lots of calls. So I am confused if are they being stored somewhere else I don’t know about somehow? Or maybe my query is somehow weird but its not too complex a query it seems like.
Have you done a more basic query to test that it works? As in, I got everything that started with 66 and in the last 24 hours? Also, why are you grouping by the same thing twice? GROUP BY ID_if_needed,ID_if_needed
well trying something like this sudo mysql -e "select * from asteriskcdrdb.cdr where src LIKE '6674' AND calldate > date_sub(now(), interval 10 DAY)"
Does pull something for that extension but for like over a week ago. There is 100’s more calls for that extension in its history. I only get 3 results for this query for that extension so that makes no sense.