Recording Jobs Filtering on Sessions

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

So, to filter on ANI, it should be:

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"
}

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.


{
                    "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
                                    ]
                                }
                            ]
                        }
                    ]
                },

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?

Have you actually tried it and found it doesn't work or are your just stuck in a mental loop because of how you think the parent/child relationships should work?

A child can inherit properties from it's parent. The layers are squishable. UserId doesn't exist in the segment either - it comes from the Participant which is a step higher than the Session.

Important to note that the query engine the recording bulk jobs uses to find conversations to process is the analytics jobs endpoint. You can test the "conversationQuery" syntax you're using in the recording jobs query against the analytics jobs endpoint to validate it's pulling back the conversations you want it to process. The conversations it returns should be exactly the same whether you're testing the jobs query yourself or submitting it via the recording jobs endpoint.

I tried it and it does not find the records I know exist there. This is the reason why I started to look into it and found that ANI is in sessions and not segments, yet the filter is set to check for segment. Thus the confusion.

For those of us afflicted by a low IQ, can you please rephrase it? The filter is looking for ANI in the segment, but there is no ANI in the segment...

I tried it and it does not find the records I know exist there.

Based on your example your filter values are wrongly formatted.

{
	"interval": "2024-06-17T05:00:00.000Z/2024-06-18T05:00:00.000Z",
	"order": "asc",
	"orderBy": "conversationStart",
	"paging": {
		"pageSize": 100,
		"pageNumber": 1
	},
	"segmentFilters": [
		{
			"type": "and",
			"predicates": [
				{
					"type": "dimension",
					"dimension": "mediaType",
					"operator": "matches",
					"value": "voice"
				},
				{
					"type": "dimension",
					"dimension": "ani",
					"operator": "matches",
					"value": "tel:+17206203048"
				}
			]
		}
	]
}

Note the proper format for an ANI.

Makes sense, so I tried to add "tel:" to the beginning of ani in the value; however, still no go!

2024-06-18 14:06:07,728 - INFO - GET https://api.mypurecloud.xxx/api/v2/recording/jobs/abcdef-cccc-bbbb-aaaa-ffffffffff with headers {'Authorization': 'Bearer some-silly-word’, 'Content-Type': 'application/json'}
2024-06-18 14:06:07,973 - INFO - Response: 200 {
    "id": "abcdef-cccc-bbbb-aaaa-ffffffffff",
    "state": "FULFILLED",
    "recordingJobsQuery": {
        "action": "DELETE",
        "actionDate": "2024-06-18T14:04:52Z",
        "includeRecordingsWithSensitiveData": false,
        "includeScreenRecordings": true,
        "conversationQuery": {
            "segmentFilters": [
                {
                    "type": "or",
                    "predicates": [
                        {
                            "type": "dimension",
                            "dimension": "dnis",
                            "operator": "matches",
                            "value": "tel:+1234567890”
                        },
                        {
                            "type": "dimension",
                            "dimension": "ani",
                            "operator": "matches",
                            "value": "tel:+12345676890"
                        }
                    ]
                }
            ],
            "interval": "2023-01-01T00:00:00.000Z/2024-12-31T23:59:59.999Z",
            "startOfDayIntervalMatching": false
        }
    },
    "dateCreated": "2024-06-18T07:04:53.861Z",
    "totalConversations": 43,
    "totalRecordings": 0,
    "totalSkippedRecordings": 0,
    "totalFailedRecordings": 0,
    "totalProcessedRecordings": 0,
    "percentProgress": 100,
    "failedRecordings": "/api/v2/recording/jobs/abcdef-cccc-bbbb-aaaa-ffffffffff/failedrecordings",
    "selfUri": "/api/v2/recording/jobs/abcdef-cccc-bbbb-aaaa-ffffffffff",
    "user": {
        "id": "12345-cccc-bbbb-aaaa-9999999",
        "selfUri": "/api/v2/users/12345-cccc-bbbb-aaaa-9999999"
    }
}


The kicker I can see the recording in the workspace for that interaction. And it is not protected. And it is within the interval specified. What am I missing?

Still trying to figure out what ANI would not match for DELETE job.

Here is what I get when query all the conversations: I can clearly see the interaction with the recording in the workspace as well as find the call with tel:+1234567890 in the records using /api/v2/analytics/conversations/details/jobs with
"interval": "2023-01-01T00:00:00.000Z/2024-12-31T23:59:59.999Z"

And the response also indicates the recording is set to true as well. So between the presence of the recording in the workspace with this ID and ability to retrieve it via API, I feel that something is off with my filter for DELETE. But what?

        {
            "conversationEnd": "2024-06-03T07:41:32.379Z",
            "conversationId": "conversationID_I_am_trying_to_delete",
            "conversationStart": "2024-06-03T07:41:15.993Z",
            "divisionIds": [
                "aaaaaa-0cb4-4d73-be70-bbbbbb",
                "ccccccc-93ac-4dc0-a3fa-ddddddd"
            ],
            "originatingDirection": "inbound",
            "participants": [
                {
                    "externalContactId": "ddddddd-1350-3333-2222-eeeeeee",
                    "participantId": "aaaa-1111-bbbb-2222-cccc-ddddddddd",
                    "participantName": “Olympus, Mars",
                    "purpose": "customer",
                    "sessions": [
                        {
                            "ani": "tel:+1234567890”,
                            "direction": "inbound",
                            "dnis": "tel:+234567890",
                            "edgeId": "00000-1111-2222-333-44444444",
                            "mediaType": "voice",
                            "protocolCallId": "abcdef1234567890abcdef@0.0.0.0",
                            "provider": "Edge",
                            "recording": true,
                            "remoteNameDisplayable": “Olympus, Mars",
                            "requestedRoutings": [
                                "Standard"
                            ],
                            "sessionDnis": "tel:+234567890",
                            "sessionId": "aaaaa-bbbb-cccc-dddd-eeeeeee",
                            "segments": [
                                {
                                    "conference": false,
                                    "segmentEnd": "2024-06-03T07:41:16.184Z",
                                    "segmentStart": "2024-06-03T07:41:15.993Z",
                                    "segmentType": "system"
                                },
                                {
                                    "conference": false,
                                    "disconnectType": "endpoint",
                                    "queueId": "1010101-ababab-acacac-adadad-0987654321",
                                    "requestedRoutingSkillIds": [
                                        "90909090-dedede-1313-adad-87654321"
                                    ],
                                    "segmentEnd": "2024-06-03T07:41:32.377Z",
                                    "segmentStart": "2024-06-03T07:41:16.184Z",
                                    "segmentType": "interact"
                                }
                            ]
                        }
                    ]
                },
                { other participant ID here …

        },

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.