Legacy Dev Forum Posts

 View Only

Sign Up

Reporting data based on Conversation Details

  • 1.  Reporting data based on Conversation Details

    Posted 06-05-2025 18:05

    Ben_Carroll | 2017-02-14 15:08:18 UTC | #1

    I'm currently pulling down conversation data using "api.PostConversationsDetailsQueryWithHttpInfo(body)". Going through all the layers of data, conversation, participant, session, and segment, I'm trying to put together a few statistics but I'm having trouble figuring out what parts of the data represent what I need.

    Number of Calls between 3 and 5 minutes Number of Calls greater than 5 minutes Number of Calls to a phone number of a previous inbound call Number of Callbacks

    Is there any thing you can do to help me?


    tim.smith | 2017-02-14 17:46:44 UTC | #2

    For "Number of Calls between 3 and 5 minutes", the new views feature for the conversation aggregate queries should be able to handle this. Here's an example query that filters by a queue and returns a view with the tTalk metric between 3-5 minutes:

    {
      "interval": "2017-02-14T07:00:00.000Z/2017-02-15T07:00:00.000Z",
      "groupBy": [],
      "filter": {
        "type": "or",
        "predicates": [
          {
            "type": "dimension",
            "dimension": "queueId",
            "operator": "matches",
            "value": "4149d518-1a12-4d4f-a5f4-28069f8aa883"
          }
        ]
      },
      "views": [
        {
          "target": "tTalk",
          "function": "rangeBound",
          "name": "Between3and5minutes",
          "range": {
            "gt": 90000,
            "lt": 300000
          }
        }
      ]
    }

    A views query would also work for "Number of Calls greater than 5 minutes".

    Edit: Note that there is currently a limitation that there is no time statistic for the overall duration of a conversation that can be used with aggregate queries. This is planned to be added in the future under AR-4728. Views are limited to currently supported time metrics (start with a t). If none of the existing metrics serve your purpose, you'll need to execute detail queries and aggregate the data manually. With detail queries, it is possible to use a metric range conversation filter on the metric tConversationDuration.

    For "Number of Calls to a phone number of a previous inbound call", you'll want to use a conversation detail query and add a filter for ANI or DNIS matching the specific number you're looking for, as well as any other filters you need to refine the results to your specific scenario. There's no way to apply that filter to an aggregate query, so you'll have to get the detail results and count them yourself.

    For "Number of Callbacks", use a conversation detail query and add a filter for mediaType=callback. Unfortunately, there aren't callback aggregate metrics yet, so you'll have to use the detail query and count the results yourself.


    Ben_Carroll | 2017-02-14 18:39:51 UTC | #3

    I've taken the entirety of the conversation object and loaded it into a local database to allow for more detailed reporting. What does the filter "Between3and5minutes" actually query in the conversation object? What data item does "tTalk" look at? The only datetime data is ConversationStart and SegmentStart. Different segments within a single conversation have overlapping time ranges. What is it that actually represents the start and stop of a single phone call?


    tim.smith | 2017-02-14 19:59:39 UTC | #4

    Ben_Carroll, post:3, topic:920
    What does the filter "Between3and5minutes" actually query in the conversation object?

    That view will be returned as part of the result set and will return the metric specified in target. The range filter will include any conversations in the aggregate results where tTalk falls between 90000ms and 300000ms. Take a look at the views documentation for a more detailed explanation.

    Ben_Carroll, post:3, topic:920
    What data item does "tTalk" look at?

    The view looks at the tTalk statistic for the conversation. If you're asking what tTalk means, see the metrics documentation.

    Ben_Carroll, post:3, topic:920
    What is it that actually represents the start and stop of a single phone call?

    If you literally mean an individual phone call, then look at the segment data on a participant in the analytics detail query results (conversations[x].participants[x].sessions[x].segments where session.mediaType==voice). Each segment represents a part of the phone call with the segment's purpose specified in the segmentType property. To determine the duration of the call, measure from the earliest segmentStart timestamp for the participant's segments to the latest segmentEnd timestamp.

    If you mean the conversation object as a whole instead of an individual phone call, look at the conversationStart and conversationEnd properties on the conversation. That indicates when the conversation was created through when all participants' segments ended.


    system | 2017-08-28 19:32:07 UTC | #5


    This post was migrated from the old Developer Forum.

    ref: 920