Max wait time data action

Hi,
I'm trying to build data action, that returns maximum wait time for specific queue for this moment.
I'm planning to call this data action from Architect inbound call flow before transfer to queue, and according to max wait time decide, whether transfer the call to the queue or offer callback. There is not a lot of calls in the queue and EWT usually returns -1, even if there are two or three calls waiting in the queue when all agents are "available" but "off queue".

I use the /api/v2/analytics/conversations/details/query API with the following filters:

{
"interval": "${input.INTERVAL}",
"order": "asc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 25,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "and",
"clauses": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "userId",
"operator": "notExists",
"value": null
}
]
},
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "purpose",
"operator": "matches",
"value": "acd"
},
{
"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "${input.QUEUE_ID}"
}

 ]
}

],
"predicates": [
{
"type": "dimension",
"dimension": "direction",
"operator": "matches",
"value": "inbound"
},
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "voice"
}
]
}
],
"conversationFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "conversationEnd",
"operator": "notExists",
"value": null
},
{
"type": "dimension",
"dimension": "originatingDirection",
"operator": "matches",
"value": "inbound"
}
]
}
]
}

and receive conversation start of the longest conversation, which is still waiting. But I can't understand how to calculate wait time (subtract IVR time).
And also, it can be that the call A starts before the call B, but spent more time in IVR menus, so correct max wait time is the wait time of call B, not of call A.

Hi Irina,

Doesn't calling POST /api/v2/analytics/conversations/aggregates/query endpoint and query for tWait metric fit your requirement? When you do this query it will respond with a response same as below:

image

Knowing that the max value is in milliseconds and this is the max waiting time for a conversation were waiting on the queried queue.

Hi Mostafa,
thank you for your answer.

I've tested POST /api/v2/analytics/conversations/aggregates/query, but as I can see tWait metric does not count conversations that are still waiting. And I also can't figure out which time interval specify in my case.
(If I take last 30-minute interval, but a conversation started before 40 minutes, it won't be counted either).

From the above link:
3. EWT inference will be -1 if ANY of the following situations are true:

  1. When there are no adjustedAHT records from the caching mechanism for the target queue-media AND unobtainable AHT from analytics (e.g. due to systemic issue such as AWS outage) AND empty queue waiting list.
  2. When there are no agents activated in the queue (agent count is 0 or nil).

Hi Jay,
you are right, we receive EWT = -1 because there are no agents activated in the queue.
Agents are usually active, but not "on queue", there are no a lot of calls, so when the call is transferred to the queue, the agent changes his state to "idle" and receives the call, but it can take some time.
The customer wants, in case that one call is already waiting for X minutes, give to another caller an opportunity to leave a callback. That's why I'm trying to calculate maximum wait time in real time.

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