[asterisk-users] queue log vs. cdr

Atis Lezdins atis at iq-labs.net
Thu Mar 13 09:55:46 CDT 2008


On 3/13/08, Vieri <rentorbuy at yahoo.com> wrote:
> Hi,
>
>  Surely, I must be overlooking something. If I run the
>  following SQL queries I don't get the same number of
>  rows. Is this coherent?
>
>  mysql> select * from queue_log where queuename =
>  '4010' and FROM_UNIXTIME(time) between 20080308000000
>  and 20080313145900 group by callid;
>
>  357 rows in set (0.01 sec)
>
>  mysql> select * from cdr where dst = 4010 and calldate
>  between 20080308000000 and 20080313145900 group by
>  uniqueid;
>
>  219 rows in set (0.19 sec)
>
>  Thanks!
>

Hmm, didn't knew that queue_log can be written into MySQL.. that's
something useful for me :)

Is callid in queue_log the same uniqueid? You can do something like this:

CREATE TEMPORARY TABLE a TYPE=MEMORY select * from queue_log where
queuename =  '4010' and FROM_UNIXTIME(time) between 20080308000000
and 20080313145900 group by callid;

CREATE TEMPORARY TABLE b TYPE=MEMORY select * from cdr where dst =
4010 and calldate between 20080308000000 and 20080313145900 group by
uniqueid;

and then compare:

SELECT * FROM a WHERE callid NOT IN (SELECT uniqueid FROM b)
SELECT * FROM b WHERE uniqueid NOT IN (SELECT callid FROM a)

Regards,
Atis



-- 
Atis Lezdins,
VoIP Project Manager / Developer,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-users mailing list