Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Number of active calls in IVR

    Posted 13 days ago

    Hello,

    For every inbound call, I want to retrieve the number of concurrent (in-progress) voice calls that are currently in IVR. There is not a single IVR flow. Several IVR flows exists and added day to day. Based on the returned number, a routing decision will be made. I am wandering if Genesys Cloud offers an API to retrieve the aforementioned count or is there any native way to retrieve that?


    After thorough investigation and research i have come up with several ideas but none is proved suitable:

    a. GET /api/v2/telephony/providers/edges/trunks/metrics
    I could use this API to get the number of active calls for all available trunks.
    Issue: The above returns all active calls no matter if these are still in IVR or in queue or talking with an agent. I need to get the number of active calls within IVR only.

    b. POST /api/v2/analytics/flows/activity/query
    I could use this API to get to oFlow metric. 
    Issue: There are a lot of inbound flows to consider. In the future, there may be more added. So i cannot really use it.

    Any thoughts or ideas?


    Best Regards,
    Orestis.


    #PlatformAPI

    ------------------------------
    Orestis Dimitropoulos
    ------------------------------


  • 2.  RE: Number of active calls in IVR

    Posted 13 days ago

    Olá @Orestis Dimitropoulos, tudo bem?

    Você está no caminho certo ao analisar Trunks Metrics e Flow Activity, mas realmente nenhum desses endpoints retorna, por si só, quantas chamadas estão neste momento dentro de IVR (sem estar em fila ou com agente).

    Para obter exatamente esse número, a abordagem mais consistente é utilizar o Analytics Conversation Detail com filtro por segmento.


    Solução Recomendada

    Use o endpoint:

    POST /api/v2/analytics/conversations/details/query

    E filtre conversas em andamento (inProgress) onde o segmentType = ivr.

    Exemplo de Query:

    {
      "interval": "2025-01-01T00:00:00.000Z/2025-01-01T23:59:59.999Z",
      "paging": {
        "pageSize": 100,
        "pageNumber": 1
      },
      "conversationFilters": [
        {
          "predicates": [
            {
              "dimension": "conversationEnd",
              "operator": "notExists"
            }
          ]
        }
      ],
      "segmentFilters": [
        {
          "predicates": [
            {
              "dimension": "segmentType",
              "operator": "matches",
              "value": "ivr"
            }
          ]
        }
      ]
    }

    O que isso retorna?

    A lista de conversações que neste momento têm pelo menos um segmento ativo dentro de IVR.
    Daí, basta contar os resultados.

    Caso você precise usar isso em Roteamento/Architect

    Você pode encapsular essa consulta em uma Data Action (com o Analytics API) e chamar dentro do fluxo.

    Então no Architect você pode:

    1. Chamar a Data Action

    2. Retornar count

    3. Fazer routing baseado nesse valor
      → Ex: Se IVR congestionado, desviar para outro fluxo, outra URA, outra fila etc.

     Por que essa abordagem é melhor?

    Método Limitação
    Trunk Metrics Conta chamadas em qualquer estado (fila/agente/URA)
    Flow Activity Exige identificar todos os fluxos individualmente
    Analytics Segment Filter (recomendado) Filtra exatamente chamadas em IVR, independente do fluxo



    ------------------------------
    Fernando Sotto dos Santos
    Consultor Grupo Casas Bahia
    ------------------------------



  • 3.  RE: Number of active calls in IVR

    Posted 10 days ago
    Edited by Luiz Rosa 10 days ago

    Hi Orestis Dimitropoulos 

    It might be worth checking out the Genesys Cloud notifications feature (docs here), for example the v2.analytics.flow.{id}.metrics topic.
    Some topics are only available through WebSocket, so you may need a small external customization to collect this information in real time.

    Holpe this helps. 



    ------------------------------
    Luiz Rosa
    Full stack developer
    ------------------------------