Description
The table stores information about current (not yet completed) connections.
Structure
|
column_name |
data_type |
description |
|---|---|---|
|
id |
uuid |
Unique record identifier. |
|
direction |
character varying |
Enumeration (see “direction” enumeration). |
|
destination |
character varying |
Destination number. The number dialed on the device. |
|
parent_id |
uuid |
Reference to the key of the main record in this table. If the field is empty, this record is the A side of the call. If the field is filled in, this record is the B side of the call. |
|
state |
character varying |
Enumeration (see “state” enumeration). |
|
app_id |
character varying |
System field. Identifier of the service that handles the call. |
|
from_type |
character varying |
Call initiator type: user, member, dest. |
|
from_name |
character varying |
Call initiator name. |
|
from_number |
character varying |
Call initiator number. |
|
from_id |
character varying |
User identifier key (see wbt_user), if the call initiator is a system user. |
|
to_type |
character varying |
Call recipient type: user, member, dest. |
|
to_name |
character varying |
Call recipient name. |
|
to_number |
character varying |
Call recipient number. |
|
to_id |
character varying |
User identifier key (see wbt_user), if the call recipient is a system user. |
|
payload |
jsonb |
Channel variables in JSON format. |
|
domain_id |
bigint |
Domain identifier. |
|
hold_sec |
integer |
Total line hold time in seconds. |
|
cause |
character varying |
Enumeration of call termination causes (see Hangup cause). |
|
sip_code |
smallint |
SIP response code. |
|
bridged_id |
uuid |
Reference to the key of the main record in this table that the connection was made with. |
|
user_id |
bigint |
User identifier key (see wbt_user), if the call initiator is a system user. |
|
gateway_id |
bigint |
Gateway identifier key (see sip_gateway). |
|
queue_id |
integer |
Queue identifier key (see cc_queue). |
|
agent_id |
integer |
Agent identifier key (see cc_agent). |
|
team_id |
integer |
Team identifier key (see cc_team). |
|
attempt_id |
bigint |
Dialer attempt identifier key (see cc_member_attempt). |
|
member_id |
bigint |
Dialer member identifier key (see cc_member). |
|
type |
character varying |
Connection type (see “type” enumeration). |
|
timestamp |
timestamp with time zone |
Date and time with time zone of the last successful call event. |
|
answered_at |
timestamp with time zone |
Date and time with time zone when the call was answered (start of call billing). |
|
bridged_at |
timestamp with time zone |
Date and time with time zone when the record was connected (answered by side B). |
|
hangup_at |
timestamp with time zone |
Date and time with time zone when the call ended. |
|
created_at |
timestamp with time zone |
Date and time with time zone when the call was created. |
|
hangup_by |
character varying |
Who ended the call: side A or B. |
|
transfer_from |
uuid |
Reference to the key of the main record in this table that the call was transferred from. |
|
transfer_to |
uuid |
Reference to the key of the main record in this table that the call was transferred to. |
|
amd_result |
character varying |
AMD result. |
|
amd_duration |
interval |
Detection time in seconds. |
|
tags |
ARRAY |
Tags. |
|
region_id |
integer |
Identifier of the region the Agent works from. |
|
grantee_id |
integer |
System field. Identifier of the user group that has access to this call. |
|
hold |
jsonb |
Information about the duration, start, and end of the call hold. |
|
params |
jsonb |
System field. |
|
blind_transfer |
character varying |
Number to which the blind transfer is made. |
|
talk_sec |
integer |
Talk time in seconds. |
|
amd_ai_result |
character varying |
AI AMD result. |
|
amd_ai_logs |
ARRAY |
Array of detection options for this call. |
|
amd_ai_positive |
boolean |
|
|
contact_id |
bigint |
Contact identifier. |
|
schema_ids |
ARRAY |
Array of identifiers of the schemas used in this call. |
“direction” enumeration
|
name |
description |
|---|---|
|
inbound |
Inbound |
|
outbound |
Outbound |
“state” enumeration
|
name |
description |
|---|---|
|
ringing |
Ringing. |
|
active |
Connection to the system. |
|
bridge |
The member is talking to the Agent. |
|
hold |
Hold. |
|
hangup |
Call ended. |
“type” enumeration
|
name |
description |
|---|---|
|
call |
Call |
|
chat |
Chat |
|
task |
Task |
Query example
Display the caller’s number and the time on hold:
select from_number,
case when state = 'hold' then extract(epoch from now() - c."timestamp") else hold_sec end hold_sec
from call_center.cc_calls c;