What makes up Total Offered calls?

We have a report that shows several metrics and are having an issue with accounting for all of the calls.
Where else could these calls be?
The abandoned calls consist of abandoned and calls that ended error.
We checked transferred calls and that metric was 0, and I am not sure if that would count in this total or not. What other metric would make up the offered calls?

If it's an interval report, these are usually calls that have overflowed to the next or from the previous interval.
So you could have 10 calls offered in interval t0, of which 9 were answered in that interval and the 10th was only answered in interval t1. And vice versa...
Maybe this explains?

We do use an interval to gather this information. We currently use the times the phone line are open for the interval. We increased this to the whole day and are still running into the same issue.

Can you post some details about the query/queries you're using? It would be helpful to know what resources you're calling and the actual query bodies/response elements you're using to get this data.

I m using Lists of AnalyticsQueryPredicate and AnalyticsQueryClause objects to build an AnalyticsQueryFilter. I then build a AggregationQuery using a hardcoded time interval, the AnalyticsQueryFilter object, and another list of AggregationQuery object that contains a groupby which groups the return by queueid.

I then loop through the metrics that are returned and use a case statement to select the attributes I need to do calculations or add to the grid.

It's going to take a bit of legwork to figure out exactly why they aren't adding up. The general idea is that you'll have to get the raw conversation details that meet the criteria for your aggregate query and tabulate them by hand to find out what's missing.

You'll probably want to use AnalyticsApi.PostConversationsDetailsQuery(query) to get the conversations for the same criteria. The segment data you'll need to determine how to tabulate the calls will most likely be found in AnalyticsConversationQueryResponse.Conversations[x].Participants[x].Sessions[x].Segments[x].

Hi I am another developer working on this issue and was hoping you would be able to help me out. I tried your above suggestion of getting the raw conversation details so I can try and see where the missing calls are going, but I cant find any information in the return data to help me accomplish that.

To start I hardcoded a time interval to 5 days ago from 8 AM to 5 PM. This was the only parameter I passed to the ConversationQuery object to start. This returned 25 AnalyticsConversation objects, as expected, that I started to parse through to see what information was returned. I couldn't find anything except basic information such as names, start and end times, and id's, so I built a ConversationFilter to target a specific conversation by the ID hoping more information may be returned for an individual object. Unfortunately there was still not enough information in the AnalyticsConversation object returned for me to analyze my previous problem.

I was hoping you would be able to tell me if there is anything else I can add to the query which will help return more information about the conversation such as queueid? Also which attribute of the Segment option would be able to tell me if the call was answered, abandoned, errored, etc.?

Ive included a screenshot to show what is included in one of the Segments objects of the conversation.

Thanks

For this particular segment, look at the SegmentType property. It is Ivr. This means that the segment is referring to the time that the call was in the IVR before it was routed to a queue, so there will be no queue id. You'll need to look at additional segments for the conversation to determine what queue the call was in for each segment and ultimately find out when and why the call disconnected.

You may also be able to use the UI for this task, as that might be easier. Check out the Interaction Detail view, particularly the timeline tab.

I'm trying to get the call history now so I can parse through the calls and see if I can find the missing ones. I am trying to use the GetCallsHistory function from the ConversationsAPI but it errors out whenever the page is loading. Ive tried taking the pageNumber and pageSize out of the call so they would be set to the default and that gave me the same result. Ive also passed variables for these parameters with the same error. Do you see anything wrong with my code that would cause this error?

Error Message: "
Error calling GetCallsHistory: {"status":400,"code":"bad.request","message":"Invalid page number 0 is less than 1.","contextId":"383ab0bc-dd27-4392-b36d-0b51174cf819","details":[],"errors":[]}
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: ININ.PureCloudApi.Client.ApiException: Error calling GetCallsHistory: {"status":400,"code":"bad.request","message":"Invalid page number 0 is less than 1.","contextId":"383ab0bc-dd27-4392-b36d-0b51174cf819","details":[],"errors":[]}
"

Thanks

The GET /api/v2/conversations/calls/history resource only gets the call history for the authenticated user. When you have no call history, it throws an error. This should return an empty result set instead. I've logged CS-580 to fix that issue.

Now, maybe you've guessed that this resource probably isn't what you want to use here. Because that resource will only give you the call history for the authenticated user that is making the request, the data returned will be of little use when looking for queue data.

Alright that explains why I was getting that error.

I'm trying a new way to loop through the conversations to try and find my missing calls for the interval, but I'm not sure if I'm returning the right data for me to track the calls correctly.

First im using the AnalyticsAPI and the PostConversationsDetailsQuery function to return all conversations over this time interval. From here im looping through the returned conversations and using the returned conversationid to call the GetCallsCallId function from the ConversationsAPI. This returns a CallConversation object which includes information about the participants. Is it possible to tell from this data whether the call was offered and if it was what happened after it was offered(answered, abandoned, or errored).

Thanks

I'm also trying to track the calls through the segments as you had suggested before. Right now i'm using the PostConversationsDetailsQuery to return the conversations. From here there are multiple nested loops to get to the segments where I loop through them to see if there is ever a queueID in any of the segments. I have a counter to keep track of how many conversations are returned in total then another counter to tell whether or not a conversation ever has a queueid assigned in any of the segments. The numbers I got were 516 total conversations 450 of which had a queueid assigned to it somewhere in one of the segments. This doesn't match the number that is returned from the AnalyticsAPI function PostConversationsAggregatesQuery for the total amount of offered calls which is 427. So my next question is if a conversation is assigned a queueid at some point in the call does this mean that it was "offered".

Thanks.

More code from Dan:

I build a filter but took it out of the ConversationQuery I just didn’t take it out of the code.

'This Is to get individual conversation statistics
        Dim aTest As AnalyticsApi = New AnalyticsApi()
        Dim predListTest As List(Of AnalyticsQueryPredicate) = New List(Of AnalyticsQueryPredicate)
        Dim predTest As AnalyticsQueryPredicate = New AnalyticsQueryPredicate(AnalyticsQueryPredicate.TypeEnum.Dimension, AnalyticsQueryPredicate.DimensionEnum.Conversationid, Value:="5380858d-71a8-4a55-9fd4-d75d9cd63b34")
        predListTest.Add(predTest)
        Dim clstest As AnalyticsQueryClause = New AnalyticsQueryClause(AnalyticsQueryClause.TypeEnum.And, predListTest)
        Dim clsListtest As List(Of AnalyticsQueryClause) = New List(Of AnalyticsQueryClause)
        clsListtest.Add(clstest)
        Dim qryListTest As List(Of AnalyticsQueryFilter) = New List(Of AnalyticsQueryFilter)
        Dim qrytest As AnalyticsQueryFilter = New AnalyticsQueryFilter(AnalyticsQueryFilter.TypeEnum.And, clsListtest)
        qryListTest.Add(qrytest)
        Dim pgS As Integer = 100
        Dim intPageNum As Integer = 1
        Dim boolLoop As Boolean = True
        Dim totalConvs As Integer = 0
        Dim totalConvswithQueue As Integer = 0
        Dim page As PagingSpec = New PagingSpec(100, intPageNum)
        Dim bTest As ConversationQuery = New ConversationQuery(strInterval, Paging:=page)
        ', ConversationFilters:=qryListTest
        Dim aConvQR As AnalyticsConversationQueryResponse = aTest.PostConversationsDetailsQuery(bTest)
        Dim convAPI As ConversationsApi = New ConversationsApi()
        For Each conversation As AnalyticsConversation In aConvQR.Conversations
            Dim boolAdded As Boolean = False
            totalConvs += 1
            For Each part In conversation.Participants
                For Each sesh In part.Sessions
                    For Each seg In sesh.Segments
                        If seg.QueueId IsNot Nothing Then
                            If boolAdded = False Then
                                totalConvswithQueue += 1
                                boolAdded = True
                            End If
                        End If
                    Next
                Next
            Next
            'Dim testConv As CallConversation = convAPI.GetCallsCallId(conversation.ConversationId)
        Next
        While boolLoop
            If aConvQR.Conversations.Count = 100 Then
                intPageNum += 1
                page = New PagingSpec(100, intPageNum)
                bTest = New ConversationQuery(strInterval, Paging:=page)
                aConvQR = aTest.PostConversationsDetailsQuery(bTest)
                For Each conversation As AnalyticsConversation In aConvQR.Conversations
                    Dim boolAdded As Boolean = False
                    totalConvs += 1
                    For Each part In conversation.Participants
                        For Each sesh In part.Sessions
                            For Each seg In sesh.Segments
                                If seg.QueueId IsNot Nothing Then
                                    If boolAdded = False Then
                                        totalConvswithQueue += 1
                                        boolAdded = True
                                    End If
                                End If
                            Next
                        Next
                    Next
                    'Dim testConv As CallConversation = convAPI.GetCallsCallId(conversation.ConversationId)
                Next
            Else
                boolLoop = False
            End If
        End While

Then This is how I get the offered calls I just took a little chunk of it out so there wasn’t all the code that builds the rad grid in here

Dim analytics As AnalyticsApi = New AnalyticsApi
                    'Dim qObservQuery As ObservationQuery = New ObservationQuery()
                    'Dim aqf As AnalyticsQueryFilter = New AnalyticsQueryFilter()
                    'Dim metricsList As List(Of ObservationQuery.MetricsEnum) = New List(Of ObservationQuery.MetricsEnum)
                    ''Dim pred As AnalyticsQueryPredicate = New AnalyticsQueryPredicate(AnalyticsQueryPredicate.TypeEnum.Metric, AnalyticsQueryPredicate.MetricEnum.Oservicelevel, Value:="")
                    'Dim metEnum As ObservationQuery.MetricsEnum = ObservationQuery.MetricsEnum.Oservicelevel
                    'metricsList.Add(metEnum)

                    Dim queueStats As AggregateQueryResponse = New AggregateQueryResponse
                    'Dim queueStats As QualifierMappingObservationQueryResponse = New QualifierMappingObservationQueryResponse
                    Dim body As AggregationQuery = New AggregationQuery()
                    'Dim body As ObservationQuery
                    Dim predList As List(Of AnalyticsQueryPredicate) = New List(Of AnalyticsQueryPredicate)
                    'Dim pred As AnalyticsQueryPredicate = New AnalyticsQueryPredicate(AnalyticsQueryPredicate.TypeEnum.Metric, AnalyticsQueryPredicate.MetricEnum.Oservicelevel, Value:="")
                    Dim pred As AnalyticsQueryPredicate = New AnalyticsQueryPredicate(AnalyticsQueryPredicate.TypeEnum.Dimension, AnalyticsQueryPredicate.DimensionEnum.Queueid, Value:=queueRow("ininID"))
                    predList.Add(pred)
                    Dim cls As AnalyticsQueryClause = New AnalyticsQueryClause(AnalyticsQueryClause.TypeEnum.And, predList)
                    Dim clsList As List(Of AnalyticsQueryClause) = New List(Of AnalyticsQueryClause)
                    clsList.Add(cls)
                    Dim qry As AnalyticsQueryFilter = New AnalyticsQueryFilter(AnalyticsQueryFilter.TypeEnum.And, clsList)
                    Dim groupBy As List(Of AggregationQuery.GroupByEnum) = New List(Of AggregationQuery.GroupByEnum)
                    groupBy.Add(AggregationQuery.GroupByEnum.Queueid)
                    body = New AggregationQuery(strInterval, Filter:=qry, GroupBy:=groupBy)
                    'body = New ObservationQuery(qry, Nothing)
                    ', GroupBy:=groupBy
                    queueStats = analytics.PostConversationsAggregatesQuery(body)
                    'queueStats = analytics.PostQueuesObservationsQuery(body)
                    Dim test2 As String = ""
                    If Not queueStats.Results Is Nothing Then
                        Dim totalAbandoned As Integer = 0
                        Dim offeredCalls As Integer = 0
                        Dim servLevelBool As Boolean = False
                        Dim tTimeBool As Boolean = False
                        Dim hTimeBool As Boolean = False
                        Dim asaTimeBool As Boolean = False
                        Dim acwTimeBool As Boolean = False
                        Dim ahtTimeBool As Boolean = False
                        Dim totalTransfered As Integer = 0
                        Dim serviceLevelDub As Double = 0
                        For i = 0 To queueStats.Results(0).Data(0).Metrics.Count - 1
                            Select Case queueStats.Results(0).Data(0).Metrics(i).Metric.Value.ToString.ToLower
                                Case "tabandon"
                                    totalAbandoned += queueStats.Results(0).Data(0).Metrics(i).Stats.Count
                                Case "noffered"
                                    row("OfferedCalls") = queueStats.Results(0).Data(0).Metrics(i).Stats.Count
                                    offeredCalls = queueStats.Results(0).Data(0).Metrics(i).Stats.Count

Per Dan:

We were able to identify a Conversation that was giving us problems ConversationID: 6ec6914f-0b52-4a1d-bf2a-5b9fbd0127f9 QueueID: b240f0fd-c75a-4612-bde7-f91566cb0f54. This is returned in the API call but does not show up as an interaction in PureCloud Web App. Do you have any additional details on the call or would you know why this is happening?

Thanks

I do not have access to any customer data. Can you post the raw JSON output from GET /api/v2/analytics/conversations/6ec6914f-0b52-4a1d-bf2a-5b9fbd0127f9/details? Using Postman will probably be easier than trying to get this from the SDK.

{ "conversationId": "6ec6914f-0b52-4a1d-bf2a-5b9fbd0127f9", "conversationStart": "2016-07-14T19:29:09.203Z", "participants": [ { "participantId": "e1552580-2829-459e-98cc-20d185ee353f", "participantName": "Unavailable", "purpose": "customer", "sessions": [ { "mediaType": "voice", "sessionId": "55c31520-542a-492c-a648-e3ece8a8dccd", "ani": "sip:Restricted@10.1.160.5", "direction": "inbound", "dnis": "tel:+17243733032", "segments": [ { "segmentStart": "2016-07-14T19:29:09.203Z", "segmentEnd": "2016-07-14T19:29:09.223Z", "segmentType": "system", "conference": false }, { "segmentStart": "2016-07-14T19:29:09.223Z", "segmentEnd": "2016-07-14T19:32:14.808Z", "segmentType": "interact", "properties": [ { "propertyType": "uuid", "property": "recordingId", "value": "a3be38aa-9d53-4a1f-bce0-1ca5a874d39a" } ], "q850ResponseCodes": [ 16 ], "conference": false } ] } ] }, { "participantId": "da134caa-0e42-42a8-9313-e9e94282255b", "participantName": "Greenville PA", "purpose": "ivr", "sessions": [ { "mediaType": "voice", "sessionId": "da94f0c9-6f45-438d-8048-35362eb7cbec", "ani": "sip:Restricted@10.1.160.5", "direction": "inbound", "segments": [ { "segmentStart": "2016-07-14T19:29:09.215Z", "segmentEnd": "2016-07-14T19:29:09.219Z", "segmentType": "system", "conference": false }, { "segmentStart": "2016-07-14T19:29:09.219Z", "segmentEnd": "2016-07-14T19:29:37.065Z", "segmentType": "ivr", "conference": false } ] } ] }, { "participantId": "c5928aba-c97a-4b10-b3ed-580ee0aa5cb6", "participantName": "Pro - RMA", "purpose": "acd", "sessions": [ { "mediaType": "voice", "sessionId": "41953c63-8061-4d19-88cf-2ca3a9c6d5fc", "ani": "sip:Restricted@10.1.160.5", "direction": "inbound", "segments": [ { "segmentStart": "2016-07-14T19:29:37.077Z", "segmentEnd": "2016-07-14T19:29:37.077Z", "queueId": "b240f0fd-c75a-4612-bde7-f91566cb0f54", "segmentType": "delay", "requestedRoutingSkillIds": [ "7aee773d-3854-4df0-b4d0-f72083bb951c", "ac262fd1-6301-48a4-b5e9-0ff49ffc7e72", "b7b8fdef-155c-47a4-9d89-bff4855b2a6c", "b565214a-e07e-4dad-9380-fc8fcf7af8bf" ], "conference": false } ] } ] } ] }