public.vwrealtimeuserconv

public.vwrealtimeuserconv

Description

Real-time user conversation data

Table Definition

CREATE VIEW vwrealtimeuserconv AS (
 SELECT ud.conversationid,
    ud.media,
    ud.queueid,
    ud.direction,
    ud.conversationstate,
        CASE
            WHEN ((ud.conversationstate)::text = 'dialing'::text) THEN 'DIAL'::text
            WHEN (ud.acwstate = true) THEN 'ACW'::text
            WHEN (ud.heldstate = true) THEN 'HELD'::text
            WHEN ((ud.conversationstate)::text = 'alerting'::text) THEN 'ALERT'::text
            WHEN ((ud.conversationstate)::text = 'contacting'::text) THEN 'CONTACT'::text
            ELSE 'TALKING'::text
        END AS convstatus,
        CASE
            WHEN ((ud.conversationstate)::text = 'dialing'::text) THEN datediff('second'::character varying, ud.updated, timezone('utc'::text, now()))
            WHEN (ud.acwstate = true) THEN datediff('second'::character varying, ud.acwtime, timezone('utc'::text, now()))
            WHEN (ud.heldstate = true) THEN datediff('second'::character varying, ud.heldtime, timezone('utc'::text, now()))
            WHEN ((ud.conversationstate)::text = 'alerting'::text) THEN datediff('second'::character varying, ud.updated, timezone('utc'::text, now()))
            ELSE datediff('second'::character varying, ud.talktime, timezone('utc'::text, now()))
        END AS convstatustime,
        CASE
            WHEN ((ud.conversationstate)::text = 'dialing'::text) THEN ((datediff('second'::character varying, ud.updated, timezone('utc'::text, now())))::numeric / 86400.00)
            WHEN (ud.acwstate = true) THEN ((datediff('second'::character varying, ud.acwtime, timezone('utc'::text, now())))::numeric / 86400.00)
            WHEN (ud.heldstate = true) THEN ((datediff('second'::character varying, ud.heldtime, timezone('utc'::text, now())))::numeric / 86400.00)
            WHEN ((ud.conversationstate)::text = 'alerting'::text) THEN ((datediff('second'::character varying, ud.updated, timezone('utc'::text, now())))::numeric / 86400.00)
            ELSE ((datediff('second'::character varying, ud.talktime, timezone('utc'::text, now())))::numeric / 86400.00)
        END AS convstatustimeday,
    ud.acwstate,
    ud.acwtime,
    ud.heldstate,
    ud.heldtime,
    ud.talktime
   FROM userrealtimeconvdata ud
)

Columns

Name Type Default Nullable Children Parents Comment
conversationid varchar(50) true GUID of the conversation
media varchar(50) true Type of media in the conversation
queueid varchar(50) true GUID of the associated queue
direction varchar(50) true Direction of the conversation
conversationstate varchar(50) true State of the conversation
convstatus text true Status of the conversation
convstatustime integer true Time of the conversation status
convstatustimeday numeric true Duration of the conversation status in days
acwstate boolean true ACW (After Call Work) state
acwtime timestamp without time zone true Time of ACW state
heldstate boolean true Held state
heldtime timestamp without time zone true Time of held state
talktime timestamp without time zone true Talk time in the conversation

Referenced Tables

Name Columns Comment Type
public.userrealtimeconvdata 32 User Real Time Conversation Data BASE TABLE

    • Related Articles

    • public.participantattributesdynamic

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(50) false conversationid varchar(50) false conversationstartdate timestamp without time zone false conversationstartdateltc timestamp without time zone true ...
    • public.evalquestiondata

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(50) false evaluationid varchar(50) false evaluationformid varchar(50) false questiongroupid varchar(50) true questionid varchar(50) true answerid varchar(50) true ...
    • public.userpresencedetaileddata

      Description User Presence Detailed Data Columns Name Type Default Nullable Children Parents Comment keyid varchar(255) false Primary Key userid varchar(50) true Agent GUID starttime timestamp without time zone false Start Time (UTC) starttimeltc ...
    • public.userinteractionpresencedetaileddata

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(255) false userid varchar(50) true starttime timestamp without time zone false starttimeltc timestamp without time zone true endtime timestamp without time zone ...
    • public.userpresencedata

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(255) false id varchar(50) true userid varchar(50) true startdate timestamp without time zone false startdateltc timestamp without time zone true timetype ...