1.1.0.rc-1-reports-and-dashboards
Tables
Calls
call_id = uniconnect call_history_id = 3cx (unique) tmp_call_id = 3cx (can be duplicate) type direction module_id module_data_id ...
Call Segments/Logs
call_id = uniconnect seq = ...
Call Summary
call_id user (agent) group (queue / ring group) customer (external party) hotline (did / dod) ivr (ivr / script / api) ringing_time talking_time queue_wating_time hold_time wrap_time recording_url ...
Active Calls (for Dashboard Purposes)
call_id = uniconnect call_history_id = 3cx (unique) tmp_call_id = 3cx (can be duplicate)
Data Flow
-
When calling the make call API from uniconnect
- Update active calls table
- call id
- call history id (if called using 3CX API, if called from Edge, this won't be there in this stage)
- Update active calls table
-
Updates from Edge
- When initiating calls
- When hold/unhold
- When mute/unmute
- When merging attended transfer
- When merging conference
-
Sync every second from 3cx
- updateActiveCallSegment
- On call end
findCallId(call_history_id, tmp_call_id){
if(!tmp_call_id && !call_history_id){
//insert into calls and get call_id
}
if(call_history_id){
//check if call history id in calls table, if found get call id
//else insert into calls and get call_id
}
get call id from calls table
}
updateActiveCallSegment(call_id, call_history_id, tmp_call_id, s .................)
{
if(!call_id){
call_id = findCallId(call_history_id, tmp_call_id)
}
upsert active call segement (call_id, active_connection_id)
upsert active calls (call_id)
}
deleteActiveCall(call_id){
sync from CDR => can we get from API
update call_segments (cdr + active_call_segements from active_call_segments)
update call_summary
update calls
delete from active_call_segements
delete from active_calls
}
endCall(call_id){
diff(cache, wrapperid);
foreach (diff){
trigger(call_disconnected) --> workflow if afte call updateActiveCallSegment(call_id, call_history_id, tmp_call_id, s, wraptime_started)
}
deleteActiveCall(diff if not in wraptime);
}
actions => updateActiveCallSegment, deleteActiveCall