Genesys Cloud - Developer Community

 View Only

Discussion Thread View
  • 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 30 days ago
    Edited by Orhun Sahin 30 days ago

    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 30 days ago

    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 30 days ago

    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 30 days ago

    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 30 days ago
    Edited by Eosian Rios 30 days ago

    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
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources