Question

I am trying to figure out which table/column stores the information about the number of outgoing calls an agent has made. I can get the total number of incoming calls using the query below, but I am not sure about how to get total outgoing calls. The database is MySQL and the application is Shoretel.

Any help would be greatly appreciated!

SELECT  sum(a_acd_answered) FROM ecc.agent, ecc.agnto where agent.agent_id = agnto.agent_id and a_date >= ''2014-03-09'' and a_date <= ''2014-03-15'' and agnto.agent_id = 9'
Was it helpful?

Solution

If you want to know the statistical number, then here is the query:

Select
  (sum(ag.a_nacd_out)+sum(ag.a_internal_nacd_out)+sum(ag.a_external_nacd_out))Outbound
from ecc.agnto ag
join ecc.agent a on a.agent_id=ag.agent_id

where a.agent_id=57
and a_date between '2014-01-01' and '2014-01-10'
group by  a.agent_id;

If you want to know the call details info, then it is better to use shorewarecdr schema by agent extension. Check the below query.

SELECT ID,CallerID,StartTime,EndTime,Extension,DialedNumber,CallType 
FROM 
shorewarecdr.`call`
where 
Extension=1331 
and date(StartTime) between '2014-01-01' and '2014-01-01'
and CallType=3;

Note: CallType=3 is for outbound.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top