Author Topic: Filtering Recordings in Batch Jobs  (Read 369 times)

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1416
  • Karma: 18
Filtering Recordings in Batch Jobs
« on: June 17, 2024, 02:31:46 PM »
Ok, this will sound insane, but I cannot figure how to filter recordings on ANI, because Genesys expects ANIs to be in segments and I get them in sessions...

According to API reference, we can filter recordings by Conversation and Segment filters.

So, to filter on ANI, it should be:

[code]2024-06-17 21:00:02,842 - INFO - POST https://api.mypurecloud.jp/api/v2/recording/jobs with headers {'Authorization': 'Bearer my_token', 'Content-Type': 'application/json'} and data {
    "action": "DELETE",
    "conversationQuery": {
        "interval": "2023-01-01T00:00:00.000Z/2024-12-31T23:59:59.999Z",
        "segmentFilters": [
            {
                "type": "or",
                "predicates": [
                    {
                        "type": "dimension",
                        "dimension": "dnis",
                        "operator": "matches",
                        "value": "+12345678900"
                    },
                    {
                        "type": "dimension",
                        "dimension": "ani",
                        "operator": "matches",
                        "value": "+12345678900"
                    }
                ]
            }
        ]
    },
    "actionDate": "2024-06-17T21:00:02Z"
}
[/code]

but if I list all the conversations I have using api/v2/analytics/conversations/details/jobs then the output shows ani / dnis info in the sessions part of json response and not segment.
[code]

{
                    "participantId": "1111111-2222-3333-4444-1234567890",
                    "purpose": "user",
                    "userId": "aaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
                    "sessions": [
                        {
                            "ani": "sip:1234567890+whitehouse.xxxspan.com@localhost",
                            "direction": "inbound",
                            "dnis": "tel:9999",
                            "edgeId": "abcdef-cccc-bbbb-aaaa-ffffffffff",
                            "mediaType": "voice",
                            "protocolCallId": “eeeeee-cccc-bbbb-aaaa-ffffffffff"",
                            "provider": "Edge",
                            "remote": "sip:98765432+whitehouse.gov@localhost",
                            "sessionDnis": "sip:1234567890+whitehouse.xxxspan.com@localhost;tgrp=582808e9-9ea0-41d5-93e5-a107ee3b2d92;trunk-context=starsystemsjapan@localhost",
                            "sessionId": “12345-12345-1223-1234-123455”,
                            "metrics": [
                                {
                                    "emitDate": "2023-08-30T15:17:13.725Z",
                                    "name": "tAlert",
                                    "value": 13007
                                }
                            ],
                            "segments": [
                                {
                                    "conference": false,
                                    "disconnectType": "client",
                                    "segmentEnd": "2023-08-30T15:17:13.725Z",
                                    "segmentStart": "2023-08-30T15:17:00.718Z",
                                    "segmentType": "alert",
                                    "sipResponseCodes": [
                                        487
                                    ]
                                }
                            ]
                        }
                    ]
                },[/code]

Question 1: I am scratching my head how I am supposed to filter the recordings based on ANI or any other value for that matter when they are located in sessions and we can only filter by conversations and segments...

Question 2: Why do I get my ANI in sessions while Genesys clearly expects it to be in segments?

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Filtering Recordings in Batch Jobs
« Reply #1 on: June 19, 2024, 05:09:04 AM »
Hi Victor,

analytics data having its own dimensions which do not correlate with the specific APIs dimension/structure (Convresation API, Recordings API,etc.). So, you can filter by ANI within the segment as the query on GC site is executed on ConversationAPI and not on Analytics API. Within ConversationAPI the ANI attribute is in segment part as you expect