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.