Legacy Dev Forum Posts

 View Only

Sign Up

How to get the number of calls currently being dialed?

  • 1.  How to get the number of calls currently being dialed?

    Posted 06-05-2025 18:08

    Nadav_Kremer | 2020-12-02 09:56:42 UTC | #1

    Hi, I am trying to get the amount of calls currently being dialed in a queue. How can I get this number? Is there a way to do this using the python SDK similar to oUserRoutingStatuses?

    Thank you


    anon11147534 | 2020-12-03 18:14:01 UTC | #2

    Hi,

    The /api/v2/analytics/queues/observations/query can be used for this. The following metrics can be used: oAlerting: Observed number of alerting conversations on a queue oInteracting: Observed number of current users interacting on a queue oWaiting: Observed number of interactions waiting in a queue

    I'm pretty sure oInteracting is the metric you're looking for.

    This python code should do it for you:

    analyticsApi = PureCloudPlatformClientV2.AnalyticsApi(apiclient)
    
    queueIdPredicate = PureCloudPlatformClientV2.QueueObservationQueryPredicate()
    queueIdPredicate.type = "dimension"
    queueIdPredicate.dimension = "queueId"
    queueIdPredicate.operator = "matches"
    queueIdPredicate.value = "[YOUR_QUEUE_ID]"
    
    mediaTypePredicate = PureCloudPlatformClientV2.QueueObservationQueryPredicate()
    mediaTypePredicate.type = "dimension"
    mediaTypePredicate.dimension = "mediaType"
    mediaTypePredicate.operator = "matches"
    mediaTypePredicate.value = "voice"
    
    myFilter = PureCloudPlatformClientV2.QueueObservationQueryFilter()
    myFilter.type = "and"
    myFilter._predicates = [queueIdPredicate, mediaTypePredicate]
    
    body = PureCloudPlatformClientV2.QueueObservationQuery()
    body.filter = myFilter
    body.metrics = ["oInteracting"]
    
    response = analyticsApi.post_analytics_queues_observations_query(body)
    
    print(response)

    system | 2021-01-03 18:14:03 UTC | #3

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


    This post was migrated from the old Developer Forum.

    ref: 9420