jorge.manso | 2023-12-13 09:44:18 UTC | #1
Hi,
we are trying to link two calls when an outgoing call is made while in wraup time of an incoming call.
To do this, in the agent script we launch the data action from the agent script where the active calls of that agent are consulted with the API (/api/v2/analytics/conversations/details/query).
{ "interval": "${input.fecha}", "order": "asc", "orderBy": "conversationStart", "paging": { "pageSize": "1", "pageNumber": 1 }, "segmentFilters": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "direction", "operator": "matches", "value": "inbound" }, { "type": "dimension", "dimension": "mediaType", "operator": "matches", "value": "voice" }, { "type": "dimension", "dimension": "userId", "operator": "matches", "value": "${input.userID}" } ] } ], "conversationFilters": [ { "type": "and", "predicates": [ { "type": "dimension", "dimension": "conversationEnd", "operator": "notExists", "value": null } ] } ] } So far so good.
The problem is when an agent transfers an incoming call to another queue or an external number and another call comes in (or makes an outgoing call) because when querying the API it responds that it has an active call, i.e., the call it transferred is no longer in the queue, as it is active, it is still going out to the agent.
This call should no longer be active for the agent because he no longer has control over it.
Has anyone encountered a challenge like this?
Thank you very much.
Jerome.Saint-Marc | 2023-12-13 14:44:52 UTC | #2
Hello,
The request you have posted above selects conversations, which have not ended, and in which the user/agent (specified by ${input.userID}) was involved at some stage (for voice). Indeed, if the agent transfers the call to another queue/external number/user, this conversation will still be captured by your query (the conversation is not ended - and it involved the agent at some stage).
If you want to filter conversations which are active at the user/participant level, you could look for a segment of type "interact" (the one generated when the agent talks to the customer) which has not ended yet. Note that I have kept the conversationEnd like yours but it is in fact not necessary (if the interact segment is not ended, the conversation should not be ended either). The request below only cares about the "talk stage" (it does not capture the conversation while it is ringing/alerting at the user level, and does not capture it while it is in AfterCallWork stage).
{
"interval": "${input.fecha}",
"order": "asc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 1,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "userId",
"operator": "matches",
"value": "${input.userID}"
},
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "voice"
},
{
"type": "dimension",
"dimension": "direction",
"operator": "matches",
"value": "inbound"
},
{
"type": "dimension",
"dimension": "segmentType",
"operator": "matches",
"value": "interact"
},
{
"type": "dimension",
"dimension": "segmentEnd",
"operator": "notExists"
}
]
}
],
"conversationFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "conversationEnd",
"operator": "notExists"
}
]
}
]
}
Regards,
system | 2024-01-12 14:45:04 UTC | #3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 23674