Callback scheduled detection

Hi,

I've been going through the docs and the forum and found some related questions but Im not sure it applies to the issue Im looking into.
I need to know if there is a pending callback when getting a conversation metadata (using analytics/conversations/details/query).
Found this link https://developer.genesys.cloud/routing/conversations/callbacks-guide#query-for-callbacks-waiting-in-queue to create a query to obtain scheduled callbacks, waiting to be executed. Specifies that it should be possible using a query like this one:
"segmentFilters": [
{
"type": "and",
"predicates": [
{ "dimension": "segmentEnd", "operator": "notExists" }
{ "dimension": "mediaType", "value": "callback" },
{ "dimension": "segmentType", "value": "Scheduled" },
]
}
]
The problem is it does not seem to fit actual metadata when validating against a real conversation with a callback, given I cannot find the segmentType: Scheduled anywhere.

Would it be enough to use only segmentEnd: notExists and mediaType: callback?

Thanks!

Hello,

A callback can be in different "status": scheduled, waiting in ACD queue, connected to a Contact Center Agent.

Let's assume we create/schedule a callback for tomorrow at noon.
When we create this callback (now), we'll get a conversation with two participants (purpose = customer, acd) having a media session of type callback, with an "active" segmentType equal to "scheduled". The callback is scheduled but not submitted yet (not waiting for an available agent).

Then, tomorrow, at noon, the conversation will be updated so that the callback is submitted to the ACD Queue and starts waiting for an available Contact Center Agent.
You'll get a new segment (active) with segmentType equal to "interact" in the "callback" session.

Third status/stage is when the callback is delivered to the Contact Center Agent.

You can also request an immediate callback. In this case, you will not have a media session of type callback with segmentType equal to "scheduled". The conversation will move directly to segmentType equal to "interact" (waiting in ACD Queue).

If you are trying to retrieve callbacks which are scheduled but not submitted yet (i.e. not waiting in ACD queue yet), you can use the following.
I have added a filter on purpose = acd, to focus on this participant structure (as it is easier to detect status scheduled or waiting in queue there).

{
 "interval": "2022-07-28T22:00:00.000Z/2022-07-29T22:00:00.000Z",
 "order": "desc",
 "orderBy": "conversationStart",
 "paging": {
  "pageSize": 25,
  "pageNumber": 1
 },
 "segmentFilters": [
  {
   "type": "or",
   "clauses": [
    {
     "type": "and",
     "predicates": [
      {
       "type": "dimension",
       "dimension": "mediaType",
       "operator": "matches",
       "value": "callback"
      },
      {
       "type": "dimension",
       "dimension": "segmentEnd",
       "operator": "notExists",
       "value": null
      },
      {
       "type": "dimension",
       "dimension": "segmentType",
       "operator": "matches",
       "value": "scheduled"
      },
      {
       "type": "dimension",
       "dimension": "purpose",
       "operator": "matches",
       "value": "acd"
      }
     ]
    }
   ]
  }
 ],
 "conversationFilters": [
  {
   "type": "and",
   "predicates": [
    {
     "type": "dimension",
     "dimension": "conversationEnd",
     "operator": "notExists",
     "value": null
    }
   ]
  }
 ]
}

If you are trying to retrieve callbacks which are either scheduled or waiting in queue (but not connected to a Contact Center Agent yet), you can use the following.

{
 "interval": "2022-07-28T22:00:00.000Z/2022-07-29T22:00:00.000Z",
 "order": "desc",
 "orderBy": "conversationStart",
 "paging": {
  "pageSize": 25,
  "pageNumber": 1
 },
 "segmentFilters": [
  {
   "type": "or",
   "clauses": [
    {
     "type": "and",
     "predicates": [
      {
       "type": "dimension",
       "dimension": "mediaType",
       "operator": "matches",
       "value": "callback"
      },
      {
       "type": "dimension",
       "dimension": "segmentEnd",
       "operator": "notExists",
       "value": null
      },
      {
       "type": "dimension",
       "dimension": "segmentType",
       "operator": "matches",
       "value": "scheduled"
      },
      {
       "type": "dimension",
       "dimension": "purpose",
       "operator": "matches",
       "value": "acd"
      }
     ]
    },
    {
     "type": "and",
     "predicates": [
      {
       "type": "dimension",
       "dimension": "purpose",
       "operator": "matches",
       "value": "acd"
      },
      {
       "type": "dimension",
       "dimension": "mediaType",
       "operator": "matches",
       "value": "callback"
      },
      {
       "type": "dimension",
       "dimension": "segmentEnd",
       "operator": "notExists",
       "value": null
      },
      {
       "type": "dimension",
       "dimension": "segmentType",
       "operator": "matches",
       "value": "interact"
      }
     ]
    }
   ]
  }
 ],
 "conversationFilters": [
  {
   "type": "and",
   "predicates": [
    {
     "type": "dimension",
     "dimension": "conversationEnd",
     "operator": "notExists",
     "value": null
    }
   ]
  }
 ]
}

Regards,

Hi Jerome,

Thank you very much for the detailed explanation!

Quick question related to the shared queries: All conversation that have a callback scheduled or waiting in queue don't have a conversation end value?

Thanks again,
Matias.

That's correct.
This filter was probably not necessary (on conversationEnd) as having a segment with no segmentEnd also implies the conversation is not closed/ended.

Regards,

1 Like

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