Summary: How can I track the full journey of a call through the system, from the did log possibly through the IVR log to the closer log? More importantly, how can I figure out what happened to the calls that don't complete that journey?
Long version: (and sorry that it's still meandering after trying to condense it, I went down a lot of rabbit holes here)
I was asked by management what I though would be an easy enough question to answer: Why are there more total calls in the Inbound DID report than there are in any of the closer reports counting dispositions?
My initial assumption was callers hanging up at the IVR, and therefore never making it to an agent/queue. And/or hanging up so quickly that even that can't register.
But, I can't piece together the data to back it up after many hours of querying the DB trying to get anything sensible to add up.
I'm going to use real numbers but exclude PII to try to show what I've done so far:
DID inbound reports show 1471 total calls across all DIDs.
Any closer-type reports show 1271 calls with a disposition across all in-groups.
Inbound IVR report shows 1366 total calls across all IVRs. However, not all calls hit an IVR. Some sales calls from a specific ad campaign go directly to an in-group, meaning this number alone can't really be used for trying to find what happened to the calls.
I decide to start querying the DB directly to try to find some answers.
- Code: Select all
SELECT call_date, uniqueid FROM vicidial_did_log WHERE call_date >= '2024-12-11 00:00:00' and call_date <= '2024-12-11 23:59:59'
- Code: Select all
SELECT call_date, uniqueid FROM vicidial_closer_log WHERE call_date >= '2024-12-11 00:00:00' AND call_date <= '2024-12-11 23:59:59'
So, theoretically, closer_log should be a subset of did_log, right? I assumed (and later checked to be true) that call_date would not be the same, but uniqueid should be I would imagine.
- Code: Select all
(SELECT uniqueid FROM vicidial_did_log WHERE call_date >= '2024-12-11 00:00:00' and call_date <= '2024-12-11 23:59:59' )
EXCEPT
(SELECT uniqueid FROM vicidial_closer_log WHERE call_date >= '2024-12-11 00:00:00' AND call_date <= '2024-12-11 23:59:59')
and indeed, the same bit with INTERSECT yields 1075, which when added to 396 gets back to 1471.
So now, the calls that have a matching uniqueid are 196 less than the total calls that were dispositioned. How? Why? Does uniqueid get reassigned at some point?
So I try checking instead against live_inbound_log for IVR matches.
- Code: Select all
(SELECT uniqueid FROM vicidial_did_log WHERE call_date >= '2024-12-11 00:00:00' and call_date <= '2024-12-11 23:59:59' )
INTERSECT
(select uniqueid from live_inbound_log where start_time >= '2024-12-11 00:00:00' and start_time <= '2024-12-11 23:59:59')
What about my theory that the difference in the reports is from people dropping off at the IVR? Well, IVR - closer should be 200 if that were true.
- Code: Select all
(select distinct uniqueid from live_inbound_log where start_time >= '2024-12-11 00:00:00' and start_time <= '2024-12-11 23:59:59' )
EXCEPT
(SELECT uniqueid FROM vicidial_closer_log WHERE call_date >= '2024-12-11 00:00:00' and call_date <= '2024-12-11 23:59:59' )
Then I remember that did_log has a column did_route which is either CALLMENU or IN_GROUP. I decide to check the breakdown according to vicidial_did_log.
WHERE did_route='CALLMENU' yields 1333 calls (not 1366, which was something else unexpected, why would it be 33 off when it matched earlier when intersecting? Does did_route get updated in some scenarios?)
WHERE did_route='IN_GROUP' yields 131
I found 7 calls that went to NA_EXTEN as well, so total is 1471.
Alright, so next I check did_route=IN_GROUP against closer_log, as these should all be there unless something crazy happens, right?
- Code: Select all
(SELECT uniqueid FROM vicidial_did_log WHERE call_date >= '2024-12-11 00:00:00' and call_date <= '2024-12-11 23:59:59' AND did_route='IN_GROUP')
EXCEPT
(SELECT uniqueid FROM vicidial_closer_log WHERE call_date >= '2024-12-11 00:00:00' and call_date <= '2024-12-11 23:59:59' )
Anyway, this still leaves, I guess, 193 calls unaccounted for. I'm not sure what other things to try in order to figure out what happened to them.
I did other iterations of intersect/except between did_log, closer_log, and live_inbound but nothing that added up to anything that made sense to me.
Any ideas of other queries to try? Or completely different approaches? Heck, is there just a way to enable drop lists for calls that don't get past an IVR? Or is my thinking about this just incorrect in general?
Any insights at all appreciated. Thanks!