Created
October 20, 2017 12:18
-
-
Save evmorov/54bb3affc04dd8d72bd25c46293ef2e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- call_direction: направление вызова: | |
-- 0 – внутренний (между двумя абонентами ВАТС), | |
-- 1 – входящий (от внешнего номера абоненту ВАТС), | |
-- 2 – исходящий (от абонента ВАТС на внешний номер). | |
-- entry_result: результат вызова. | |
-- 1 - звонок успешен и разговор состоялся, | |
-- 0 - звонок пропущен, разговор не состоялся. | |
-- line_number: линия ВАТС, через которую прошел вызов. Подставляется в зависимости от направления вызова: | |
-- - если внутренний вызов – не передается. | |
-- - если входящий вызов – линия (номер), на который поступил звонок. | |
-- - если исходящий вызов – линия (номер), через которую звонок вышел из ВАТС. | |
SELECT COUNT(*) | |
FROM mango_events_summaries | |
WHERE raw->>'call_direction' = '1' | |
AND raw->>'line_number' IN ('71112223344', '79998887766') | |
AND raw->>'entry_result' = '1' | |
AND created_at BETWEEN '2017/09/21' AND '2018/10/20' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment