Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Disconnect Type in Interactions

    Posted 03-20-2025 15:30

    Does anyone know which API gives 'Disconnect Type'  /api/v2/analytics/conversations/details API provides disconnect type but the values I am seeing are the disconnect reasons from the Interaction detail view


    #PlatformAPI

    ------------------------------
    Philip Varghese
    Lead Programmer Analyst
    ------------------------------


  • 2.  RE: Disconnect Type in Interactions

    Posted 03-20-2025 15:59
    Edited by Orhun Sahin 03-20-2025 15:59

    Hi Philip,

    What do you mean by 'Disconnect Type'? Are you referring the 'remote or local disconnect' as below; 

    • Remote Disconnect: The external party (e.g., the customer) hung up or disconnected.
    • Local Disconnect: Our system or agent ended the call.

    If that's ther case then here's how we currently determine it:

    1. Find the External Party: We look for the participant in the call data whose purpose is "customer" or "external."

    2. Check Their Disconnect Reason: We examine the disconnectReason for that external participant.

    3. Determine the Type:

      • If the disconnectReason is "peer" (Another participant in the conversation caused the disconnect.), it means our side (the non-external participant) ended the call. This is a local disconnect.
      • All the other cases treated as that the external participant ended the call. This is a remote disconnect.

    In simpler terms, if the external party's disconnect reason is "peer," it's a local disconnect; otherwise, it's a remote disconnect.

    For a full list of all possible disconnect reasons, you can check out the Genesys Cloud documentation here: Disconnect reasons in the interaction's detail view

    This documentation might be useful if you need to build a more custom or granular way to classify disconnects beyond the basic "remote" and "local" categories. The current method described above is how we're currently marking calls.

    Let me know if you have any questions!



    ------------------------------
    Orhun Sahin
    Software Development Engineer
    ------------------------------



  • 3.  RE: Disconnect Type in Interactions

    Posted 03-20-2025 16:22

    Thanks Orhun for the response. I was referring to Disconnect Type column that you see in Interactions performance view which has 3 possible values - External, System & Agent. The one you are talking about is the Internal & External participant disconnect reasons that we find in Interactions Detail view. I am not sure which of these fields give the actual disconnect type but its confusing when the conversation API gives the disconnect reasons as disconnect type.



    ------------------------------
    Philip Varghese
    Lead Programmer Analyst
    ------------------------------



  • 4.  RE: Disconnect Type in Interactions

    Posted 03-21-2025 12:12

    The values on that view are made up by the code parsing the results of /api/v2/analytics/conversations/details/query

    They're not part of any API, they're an attempt to simplify the insanity into something pithy.



    ------------------------------
    Eos Rios
    Quasi-Divine Hamster
    ------------------------------



  • 5.  RE: Disconnect Type in Interactions

    Posted 03-21-2025 13:06

    Thanks Eos, I think you answered my question that Disconnect type is not available in any API as such as its a made up(calculated) field based on probably the disconnect reasons that you see in interaction detail sessions. Do you or anyone know how genesys arrives at the 3 disconnect type values that I mentioned above?



    ------------------------------
    Philip Varghese
    Lead Programmer Analyst
    ------------------------------



  • 6.  RE: Disconnect Type in Interactions

    Posted 03-21-2025 13:31
    Edited by Eosian Rios 03-21-2025 13:32

    When I looked at it previously I got the impression it was basically finding the last disconnect on the record at the time and lumping it into agent/external/system based on the purpose. 

    The actual code they use is this I believe;

            var direction;
            var disconnectType;
    
            if (!_.isEmpty(participant.calls) && !_.isUndefined(participant.calls[0].direction)) {
                direction = participant.calls[0].direction;
                disconnectType = participant.calls[0].disconnectType;
            } else if (!_.isEmpty(participant.chats)) {
                direction = participant.chats[0].direction;
                disconnectType = participant.chats[0].disconnectType;
            } else if (!_.isEmpty(participant.emails) && !_.isUndefined(participant.emails[0].direction)) {
                direction = participant.emails[0].direction;
                var lastEmail = participant.emails[participant.emails.length - 1];
                disconnectType = lastEmail.disconnectType;
            } else if (!_.isEmpty(participant.messages)) {
                var lastMessage = participant.messages[participant.messages.length - 1];
                disconnectType = lastMessage.disconnectType;
            }
    
            self.direction = getLocalizedDirection(direction);
    
            if (disconnectType) {
                var disconnectTypeKey;
                var PREFIX = "conversationTimeline.tooltip.disconnectType.";
                disconnectType = disconnectType.toLowerCase();
    
                if (disconnectType.indexOf('transfer') !== -1) {
                    disconnectTypeKey = PREFIX + 'transfer';
                } else if (ko.i18n.keyExists(PREFIX + disconnectType)) {
                    disconnectTypeKey = PREFIX + disconnectType;
                } else {
                    disconnectTypeKey = PREFIX + 'other';
                }
    
                disconnectType = ko.i18n.renderString(disconnectTypeKey);
                self.disconnectType(disconnectType);
            }
    

    The ko.i18n.renderString bit is just looking up the localized names in their dictionary.

    ------------------------------
    Eos Rios
    Quasi-Divine Hamster
    ------------------------------



  • 7.  RE: Disconnect Type in Interactions

    Posted an hour ago

    Hi,

    I'm trying to reliably reproduce the Interactions view "Disconnect Type" classification (External / Agent / System) using the Analytics API /api/v2/analytics/conversations/details. Does anyone know how local disconnect (System or Agent) is determined. I've read the earlier replies in this thread and tried to follow, but I'm still seeing mismatches-especially around transfer* on the our side. I don't see the logic in the above code. Following Pseudo-logic was our take on it but does not match with Genesys. I could be missing edge cases. Please Suggest

    customer(client|endpoint)External

    customer(error|timeout|other|uncallable|spam)System

    customer(peer) + agent(client)Agent
    Agent explicitly clicked End Call in UI.

    customer(peer) + agent(endpoint)Agent
    Agent's endpoint (phone/WebRTC) hung up.

    customer(peer) + agent(transfer*)System
    Agent initiated a consult/forward/no‑answer/not‑available transfer; we treat this as System
    Question: This is where we are seeing a mismatch as Genesys Interaction View shows Disconnect Type as Agent even though agent disconnect reason is transfer. Needed some clarity on logic implemented within Genesys. We are simply looking to replicate it for now in any case

    customer(peer) + agent(system|error|timeout|other|peer|transportFailure)System
    Provider/cloud conditions.

    #Analytics #ConversationAPI
    ------------------------------
    Harshvardhan Bawake
    Developer
    ------------------------------





    ------------------------------
    Harshvardhan Bawake
    ------------------------------