Skip to content

Missed Call Report #1311

@dgershman

Description

@dgershman

There was a request for a better way to see missed calls.

SELECT b.*
FROM conference_participants a
INNER JOIN records b ON a.callsid = b.callsid
WHERE a.conferencesid IN (
    SELECT b.conferencesid    
    FROM records_events a         
    INNER JOIN (             
        SELECT 
            re.callsid, 
            cp.conferencesid, 
            IFNULL(re.service_body_id, 0) AS service_body_id             
        FROM records_events re             
        INNER JOIN conference_participants cp ON re.callsid = cp.callsid  
        WHERE re.event_time BETWEEN '2024-12-27' AND '2025-01-25'         
        GROUP BY re.callsid, cp.conferencesid, re.service_body_id         
    ) b ON a.callsid = b.callsid       
    WHERE a.event_id IN (7, 8, 12) 
    AND b.service_body_id = 6       
    GROUP BY a.service_body_id, b.conferencesid
    HAVING SUM(CASE WHEN a.event_id = 12 THEN 1 ELSE 0 END) = 0
);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions