Skip to content

Sum total time of inbound / outbound calls

0

Hello, I am working with the historical metrics provided by Amazon Connect. I would to know if is there any way to get the sum of total time for inbound calls and outbound calls separated. Thanks in advance.

asked 2 years ago998 views

2 Answers
0

1. Using Amazon Connect CTR data:

CTR records store detailed information about each contact, including the type of call (inbound or outbound) and the duration of the call.

Steps:

  • Access CTR data: You can query the CTR data directly from Amazon S3 if you've set up CTRs to be stored there, or access them using Amazon Athena.
  • Identify Call Type: Use the InitiationMethod field to distinguish between inbound and outbound calls:
    • Inbound: INBOUND *Outbound: OUTBOUND
  • Call Duration: Use the AgentInteractionDuration field (or other relevant fields like CustomerHoldDuration, depending on what you're summing) to get the time of the interaction.

Example SQL query for Athena:

SELECT 
    InitiationMethod,
    SUM(AgentInteractionDuration) as TotalCallDuration
FROM 
    "your_ctr_table"
WHERE 
    InitiationMethod IN ('INBOUND', 'OUTBOUND')
GROUP BY 
    InitiationMethod

This query will return the total time (in seconds) of inbound and outbound calls separately.

2. Using Amazon Connect Historical Metrics API:

You can also use the Amazon Connect GetMetricData API to request historical metrics on calls and filter by contact types (inbound/outbound).

  • Use the GET /metrics/historical API endpoint.
  • In the request payload, include the appropriate Metrics for CONTACTS_HANDLED, HANDLE_TIME, or CONTACTS_ABANDONED, etc., based on your needs.
  • You can segment results by ContactType to filter inbound and outbound calls.

3. Visualization via Amazon Connect Reports:

If you're using the Amazon Connect UI for reports, the Historical Metrics Reports allow you to customize the filters:

  • You can filter by inbound/outbound contact types.
  • You can select the desired metrics (e.g., Agent Handle Time) for both inbound and outbound calls separately and sum them.
EXPERT

answered 2 years ago

  • Hello, thank you for your response. I was working on step 2, as I’m implementing my solution using the Amazon Connect Historical Metrics API. However, I'm encountering an issue: it's not possible to retrieve the total sum of handle time for inbound or outbound contacts. The HANDLE_TIME metric only provides the average, not the total sum.

0

Step 1: Get Historical Metrics Data for Inbound and Outbound Calls Use the GetMetricData API to retrieve the CONTACTS_HANDLED and HANDLE_TIME metrics, filtering by the ContactType (inbound or outbound).

Step 2: Calculate Total Handle Time Use the following formula to calculate the total handle time:

Total Handle Time = Average Handle Time (HANDLE_TIME) * Number of Contacts Handled (CONTACTS_HANDLED)

Example of the Request Payload for the GetMetricData API

You can request both HANDLE_TIME and CONTACTS_HANDLED in a single API call. Here’s an example request:

{
    "InstanceId": "your_instance_id",
    "StartTime": "2023-09-01T00:00:00Z",
    "EndTime": "2023-09-30T23:59:59Z",
    "Filters": {
        "Channels": ["VOICE"],
        "Queues": ["your_queue_id"]
    },
    "Groupings": ["QUEUE"],
    "HistoricalMetrics": [
        {
            "Name": "HANDLE_TIME",
            "Statistic": "AVG",
            "Unit": "SECONDS"
        },
        {
            "Name": "CONTACTS_HANDLED",
            "Statistic": "SUM",
            "Unit": "COUNT"
        }
    ]
}

In the response, you’ll get both metrics (HANDLE_TIME and CONTACTS_HANDLED). You can then use the formula to calculate the total handle time for inbound and outbound calls.

Make sure to apply filters for ContactType in your request or use data from your CTR records (as you mentioned earlier) to differentiate between inbound and outbound calls. This way, you can ensure you’re calculating the total for each call type separately.

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.