host=127.0.0.1
port=5432
dbname=database_single
user=phonesystem
password=xxxxxxx
"DbHost": "127.0.0.1",
"DbPort": "5480",
"DbUser": "phonesystem",
"DbPassword": "XZg9CE3GJRCfh",
"DbName": "database_single"
{"query":"SELECT segment_id, segment_start_time, segment_end_time, segment_action_id, segment_type, src_id, src_extended_display_name, src_display_name, src_internal, src_external, src_dn_type, src_dn, src_caller_number, src_participant_id, src_rec_id, dst_id, dst_extended_display_name, dst_display_name, dst_internal, dst_external, dst_dn_type, dst_dn, dst_caller_number, dst_participant_id, dst_rec_id, call_time, call_answered FROM public.call_history_view where segment_action_id = '400' and src_dn_type = 0 order by segment_start_time desc",
"count":"2"
}
{
"result": [
[
"4292",
"6/13/2023 7:37:12 AM",
"6/13/2023 7:37:29 AM",
"400",
"1",
"6022",
"Charles Dickens (101)",
"Charles Dickens",
"True",
"False",
"0",
"101",
"Ext.101",
"6023",
"",
"6023",
"0629759787",
"0629759787",
"False",
"True",
"13",
"0629759787",
"0629759787",
"6024",
"",
"00:00:17",
"False"
],
[
"4282",
"6/12/2023 6:39:29 PM",
"6/12/2023 6:39:36 PM",
"400",
"1",
"6006",
"Charles Dickens (101)",
"Charles Dickens",
"True",
"False",
"0",
"101",
"Ext.101",
"6007",
"",
"6007",
"0629759787",
"0629759787",
"False",
"True",
"13",
"0629759787",
"0629759787",
"6008",
"",
"00:00:07",
"False"
]
]
}
{"query":"SELECT segment_start_time, src_extended_display_name, src_display_name, src_caller_number, dst_extended_display_name, dst_display_name, dst_caller_number, call_time FROM public.call_history_view where segment_action_id = 5 and dst_extended_display_name like '%IVR%' order by segment_start_time desc",
"count":"2"
}
{
"result": [
[
"6/12/2023 5:07:19 PM",
"381629759787:RS (381629759787)",
"381629759787:RS",
"381629759787",
"IVR (809)",
"RS Welcome",
"Ext.809",
"00:00:22"
],
[
"6/12/2023 5:04:29 PM",
"381629759787:RS (381629759787)",
"381629759787:RS",
"381629759787",
"IVR (809)",
"RS Welcome",
"Ext.809",
"00:00:33"
]
]
}
The main 3CX DB Views
SELECT q_num, time_start, time_end, ts_waiting, ts_polling, ts_servicing, ring_time, reason_noanswercode, reason_failcode, call_history_id, from_userpart, from_displayname, to_dn, cb_num, is_answered, is_callback
FROM public.callcent_queuecalls_view order by time_start desc;
SELECT * FROM callcent_queuecalls ORDER BY idcallcent_queuecalls DESC LIMIT 50
select
count(*) as sum,
dst_display_name
from(
select
distinct (c.call_id), c.dst_display_name
from public.cl_segments_view c
where cast(c.start_time as date)> (now() - '7 days'::interval)
and (c.dst_display_name in (select name FROM public.queue ) )
limit 100) as sub
group by dst_display_name
SELECT id_recording, cl_participants_id, recording_url, start_time, end_time, transcription, archived, archived_url, call_type
FROM public.recordings
order by start_time desc;