Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select h.user_id,
- count(*) filter ( where cq.type = 1 and h.bridged_at isnull and h.parent_id notnull and h.hangup_by = 'B' ) "abandoned agent inbound queue"
- from call_center.cc_calls_history h
- left join call_center.cc_queue cq on h.queue_id = cq.id
- left join call_center.cc_member_attempt_history cc on cc.agent_call_id = h.id
- where h.domain_id = $domain_id and h.created_at between $__timeFrom()::timestamptz and $__timeTo()::timestamptz
- and h.user_id in (
- select distinct agents.user_id
- from agents
- )
- group by h.user_id
Advertisement
Add Comment
Please, Sign In to add comment