Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Need to get the talk time

    Posted 17 days ago

    Hi,

    I'm close to pulling out the last 20 hairs I have left 🙂

    In a script, I need to determine the exact duration that an interaction has been in the state Scripter.Raw Interaction State = connected. The requirement is to measure the active conversation time - not the time since the call attempt was initiated, but specifically the period during which the agent and the customer have actually been connected.

    I attempted to capture the value of Scripter.Customer Call Duration at the moment when Scripter.Raw Interaction State transitions from connection to connected, but this approach doesn't seem to work, the time are being over written event when I try to use booleans.

    Does anyone know a robust method to retrieve the current active conversation time from within a script?

    Thanks in advance.

    Best regards, 
    Torben 


    #Scripts

    ------------------------------
    Torben Hedemann B. Eriksen
    NA
    ------------------------------


  • 2.  RE: Need to get the talk time

    Posted 17 days ago

    Hi Torben,

    From what I understand, the problem occurs because the duration variable is continuously updated while the interaction remains in the connected state.

    Have you tried capturing the returned value (in HH:MM:SS format) and saving it to a static variable using the Set Variable action at the exact moment of the transition to connected?

    This way, you preserve the duration value at that specific instant, preventing it from being overwritten in subsequent checks, and you can use it later in the script for calculations or validations.



    ------------------------------
    Alesson Santos
    Mid-Level Developer
    ------------------------------