Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Get call time in inbound flow

    Posted 23 days ago
     
    Hello everyone.
     
    Is it possible to get the following data in the inbound flow of Architect?
    If so, please let me know the specific method of acquisition.
     
    ・Call time (conversation time)
     
    This is to be stored in a specified data table using a data action.

    Best regards,

    #API/Integrations
    #ArchitectureandDesign

    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------


  • 2.  RE: Get call time in inbound flow

    Posted 23 days ago

    Hi Matsumoto,
    nearly every conversation related API gives back the start time of the conversation. (for example: /api/v2/conversations/calls/{conversationId} has a "starttime" in the first participant). If you receive that starttime you can use the "DateTimeDiff"-function in Architect together with the "GetCurrentDateTimeUtc()"-Function to calculate the actual duration of the conversation. Maybe there is a more elegant way, but that would be my solution.
    Best
    Christoph



    ------------------------------
    Christoph Domaschke
    Leiter Service Center (Cronbank)
    ------------------------------



  • 3.  RE: Get call time in inbound flow

    Posted 23 days ago
    Hello, Christoph

    Thank you for your reply.
     
    Is the procedure for obtaining the time correct?
     
    ① Receive the start and end times of the conversation from the conversation API
     
    Example: /api/v2/conversations/calls/{conversationId}
     
    Response: startTime (start time), endTime (end time)
     
    ② Calculate the difference between the received "start time" and "end time" using Architect's "DateTimeDiff" function
     
    Also, as shown in the image, in the interaction, Duration = conversation time.
     
    Is it possible to obtain the duration of an interaction via API or other methods?



    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------



  • 4.  RE: Get call time in inbound flow
    Best Answer

    Posted 23 days ago

    Hello Matsumoto,

    it sounds like you are talking about already finished conversations, because you mention an end time. In your original post it sounded to me, that you want to get the duration of a call while its on queue.
    For already finished conversations there are better APIs: /api/v2/analytics/conversations/{conversationId}/details

    There are metrics for every participant, including the customer (participant with the purpose "customer).

    In customer (usually the first participant) the metric "tConnected" could be, what you are looking for. Its in milliseconds. 



    ------------------------------
    Christoph Domaschke
    Leiter Service Center (Cronbank)
    ------------------------------



  • 5.  RE: Get call time in inbound flow

    Posted 23 days ago
    Thank you for your reply.
     
    Hello, Christoph

    Conversation time, sorry for the lack of explanation.
     
    I tested with this API and got a "tConnected" response, but could not find the crucial connection time (e.g. 1:01).
     
     /api/v2/analytics/conversations/{conversationId}/details


    Is this not the Duration Time of the interaction returned as is, or does it need to be calculated separately?

    {
      "mediaStatsMinConversationMos": 4.394238708459619,
      "participants.sessions.segments.conference": [
        [
          [
            false,
            false
          ]
        ],
        [
          [
            false,
            false
          ]
        ]
      ],
      "participants.sessions.remote": [
        null,
        [
          "KDDI転送"
        ]
      ],
      "participants.sessions.mediaType": [
        [
          "voice"
        ],
        [
          "voice"
        ]
      ],
      "participants.sessions.flow.exitReason": [
        null,
        [
          "FLOW_DISCONNECT"
        ]
      ],
      "participants.sessions.flow.entryReason": [
        null,
        [
          "tel:+81671676113"
        ]
      ],
      "participants.sessions.flow.entryType": [
        null,
        [
          "dnis"
        ]
      ],
      "participants.sessions.recording": [
        [
          true
        ],
        null
      ],
      "participants.sessions.metrics.value": [
        [
          [
            1,
            61305
          ]
        ],
        [
          [
            1,
            60782,
            60782,
            61331
          ]
        ]
      ],
      "participants.sessions.mediaEndpointStats.receivedPackets": [
        [
          [
            3067,
            3065
          ]
        ],
        [
          [
            3067
          ]
        ]
      ],
      "divisionIds": [
        "7ec3dcb4-7a7f-4891-8c41-6d43d405b29e"
      ],
      "participants.sessions.mediaEndpointStats.codecs": [
        [
          [
            [
              "audio/opus"
            ],
            [
              "audio/PCMU"
            ]
          ]
        ],
        [
          [
            [
              "audio/opus"
            ]
          ]
        ]
      ],
      "participants.sessions.segments.segmentStart": [
        [
          [
            "2025-01-20T05:59:10.195Z",
            "2025-01-20T05:59:10.225Z"
          ]
        ],
        [
          [
            "2025-01-20T05:59:10.198Z",
            "2025-01-20T05:59:10.200Z"
          ]
        ]
      ],
      "participants.externalContactId": [
        "bc9517a3-19b9-4aaf-a51c-e5b7b34d6520",
        null
      ],
      "participants.sessions.dnis": [
        [
          "tel:+81671676113"
        ],
        [
          "tel:+81671676113"
        ]
      ],
      "participants.sessions.sessionDnis": [
        [
          "tel:+81671676113"
        ],
        [
          "tel:+81671676113"
        ]
      ],
      "participants.sessions.mediaEndpointStats.minMos": [
        [
          [
            4.882473959813684,
            4.394238708459619
          ]
        ],
        [
          [
            4.727397955006349
          ]
        ]
      ],
      "participants.sessions.flow.flowType": [
        null,
        [
          "INBOUNDCALL"
        ]
      ],
      "participants.sessions.metrics.name": [
        [
          [
            "nConnected",
            "tConnected"
          ]
        ],
        [
          [
            "nFlow",
            "tFlow",
            "tFlowDisconnect",
            "tIvr"
          ]
        ]
      ],
      "conversationEnd": "2025-01-20T06:00:11.531Z",
      "participants.sessions.segments.segmentType": [
        [
          [
            "system",
            "interact"
          ]
        ],
        [
          [
            "system",
            "ivr"
          ]
        ]
      ],
      "participants.sessions.flow.flowName": [
        null,
        [
          "Unattended late - night reception"
        ]
      ],
      "participants.sessions.mediaEndpointStats.eventTime": [
        [
          [
            "2025-01-20T06:00:11.651Z",
            "2025-01-20T06:00:11.651Z"
          ]
        ],
        [
          [
            "2025-01-20T06:00:11.569Z"
          ]
        ]
      ],
      "participants.sessions.provider": [
        [
          "Edge"
        ],
        [
          "Edge"
        ]
      ],
      "participants.participantId": [
        "37ba7711-9298-4819-b7aa-e04fbb0f6590",
        "3aa7aa8f-f75c-41b4-9e7f-7d9a0144d2d8"
      ],
      "participants.purpose": [
        "external",
        "ivr"
      ],
      "conversationStart": "2025-01-20T05:59:10.195Z",
      "participants.participantName": [
        "KDDI転送",
        "Unattended late - night reception"
      ],
      "conversationId": "f30ca760-5053-4562-84bf-bd085dd5c194",
      "participants.sessions.sessionId": [
        [
          "09f7939b-5001-373f-a927-f36517b3ac03"
        ],
        [
          "e00aba50-bbcf-3680-86e9-95625eb1129e"
        ]
      ],
      "originatingDirection": "inbound",
      "participants.sessions.flow.flowVersion": [
        null,
        [
          "1.0"
        ]
      ],
      "participants.sessions.metrics.emitDate": [
        [
          [
            "2025-01-20T05:59:10.225Z",
            "2025-01-20T06:00:11.530Z"
          ]
        ],
        [
          [
            "2025-01-20T05:59:10.749Z",
            "2025-01-20T06:00:11.531Z",
            "2025-01-20T06:00:11.531Z",
            "2025-01-20T06:00:11.531Z"
          ]
        ]
      ],
      "participants.sessions.mediaEndpointStats.maxLatencyMs": [
        [
          [
            30,
            30
          ]
        ],
        [
          [
            30
          ]
        ]
      ],
      "participants.sessions.protocolCallId": [
        [
          "651725622201202514599@192.168.247.211"
        ],
        [
          "3d541d57-e3a7-433d-b811-a4e9cf5e3e7b"
        ]
      ],
      "participants.sessions.segments.disconnectType": [
        [
          [
            null,
            "peer"
          ]
        ],
        [
          [
            null,
            "system"
          ]
        ]
      ],
      "participants.sessions.segments.sipResponseCodes": [
        [
          [
            null,
            [
              487
            ]
          ]
        ],
        null
      ],
      "participants.sessions.flow.endingLanguage": [
        null,
        [
          "ja-jp"
        ]
      ],
      "participants.sessions.edgeId": [
        [
          "9e742e37-b633-44b2-b6f4-29b1d97d3794"
        ],
        [
          "9e742e37-b633-44b2-b6f4-29b1d97d3794"
        ]
      ],
      "participants.sessions.segments.segmentEnd": [
        [
          [
            "2025-01-20T05:59:10.225Z",
            "2025-01-20T06:00:11.530Z"
          ]
        ],
        [
          [
            "2025-01-20T05:59:10.200Z",
            "2025-01-20T06:00:11.531Z"
          ]
        ]
      ],
      "participants.sessions.flow.startingLanguage": [
        null,
        [
          "ja-jp"
        ]
      ],
      "participants.sessions.flow.flowId": [
        null,
        [
          "08ae58bd-ba7a-422b-8e68-20432ad6f71a"
        ]
      ],
      "mediaStatsMinConversationRFactor": 86.8587417602539,
      "participants.sessions.direction": [
        [
          "inbound"
        ],
        [
          "inbound"
        ]
      ],
      "participants.sessions.remoteNameDisplayable": [
        [
          "KDDI転送"
        ],
        [
          "Osaka, Japan"
        ]
      ],
      "participants.sessions.mediaEndpointStats.minRFactor": [
        [
          [
            92.44642639160156,
            92.447021484375
          ]
        ],
        [
          [
            86.8587417602539
          ]
        ]
      ],
      "participants.sessions.ani": [
        [
          "tel:08051717690"
        ],
        [
          "tel:08051717690"
        ]
      ],
      "participants.sessions.peerId": [
        null,
        [
          "09f7939b-5001-373f-a927-f36517b3ac03"
        ]
      ]
    }


    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------



  • 6.  RE: Get call time in inbound flow

    Posted 23 days ago

    Your response looks completly different than the one I get from /api/v2/analytics/conversations/{conversationId}/details. It looks like a summary. My response looks like that:

    {
      "conversationEnd": "2025-01-20T08:49:11.173Z",
      "conversationId": "0a6bbf87-e652-4fb8-b175-0ee9b4ef56f9",
      "conversationStart": "2025-01-20T08:42:25.760Z",
      "divisionIds": [
        "850b51c1-a9bf-42b3-a44a-18b31ad1d11d"
      ],
      "mediaStatsMinConversationMos": 4.391164659722279,
      "mediaStatsMinConversationRFactor": 90.75804901123047,
      "originatingDirection": "inbound",
      "surveys": [
        {
          "eventTime": "2025-01-20T08:49:12.305Z",
          "surveyFormContextId": "89e480ef-9a88-44b8-9996-927f1f6985ce",
          "surveyId": "d1df6a69-df1a-4ded-bfe6-987b51068618",
          "surveyStatus": "OptOut",
          "surveyType": "Web"
        }
      ],
      "participants": [
        {
          "externalContactId": "744806d7-064b-49c3-a7ae-184e5eb2873a",
          "participantId": "56b480ad-cd6a-438a-b348-99b2957c5006",
          "participantName": "+4915736429030",
          "purpose": "customer",
          "sessions": [
            {
              "activeSkillIds": [
                "bfb0ed09-de41-44ea-9ca9-efcbbfc65dfe"
              ],
              "ani": "tel:+4915736429030",
              "direction": "inbound",
              "dnis": "tel:+496950985059",
              "edgeId": "4d59eb4a-3577-43ae-8b9f-fea83890ce99",
              "mediaType": "voice",
              "protocolCallId": "70800246-3946351345-1883237367@SBC5-FFT-EU.bt.com",
              "provider": "Edge",
              "recording": true,
              "remoteNameDisplayable": "+4915736429030",
              "requestedRoutings": [
                "Standard"
              ],
              "selectedAgentId": "8bd8fd50-bc25-4b2a-aca6-2f1552992411",
              "sessionDnis": "tel:+496950985059",
              "sessionId": "c799b1ad-c11b-3aec-8887-97b0b5fa3432",
              "usedRouting": "Standard",
              "mediaEndpointStats": [
                {
                  "codecs": [
                    "audio/opus"
                  ],
                  "eventTime": "2025-01-20T08:43:23.838Z",
                  "maxLatencyMs": 30,
                  "minMos": 4.882669451101575,
                  "minRFactor": 92.45497131347656,
                  "receivedPackets": 2889
                },
                {
                  "codecs": [
                    "audio/opus"
                  ],
                  "eventTime": "2025-01-20T08:43:33.931Z",
                  "maxLatencyMs": 30,
                  "minMos": 4.882419564365429,
                  "minRFactor": 92.44405364990234,
                  "receivedPackets": 497
                },
                {
                  "codecs": [
                    "audio/PCMU"
                  ],
                  "eventTime": "2025-01-20T08:49:02.886Z",
                  "maxLatencyMs": 30,
                  "minMos": 4.391164659722279,
                  "minRFactor": 92.29871368408203,
                  "receivedPackets": 19826
                },
                {
                  "codecs": [
                    "audio/opus"
                  ],
                  "discardedPackets": 53,
                  "eventTime": "2025-01-20T08:49:02.888Z",
                  "maxLatencyMs": 38,
                  "minMos": 4.85752431738545,
                  "minRFactor": 91.40001678466797,
                  "receivedPackets": 16451
                }
              ],
              "metrics": [
                {
                  "emitDate": "2025-01-20T08:42:25.926Z",
                  "name": "nConnected",
                  "value": 1
                },
                {
                  "emitDate": "2025-01-20T08:49:02.839Z",
                  "name": "tConnected",
                  "value": 396913
                }
              ],
              "segments": [
                {
                  "conference": false,
                  "segmentEnd": "2025-01-20T08:42:25.926Z",
                  "segmentStart": "2025-01-20T08:42:25.760Z",
                  "segmentType": "system"
                },
                {
                  "conference": false,
                  "disconnectType": "endpoint",
                  "queueId": "f4ba3917-9786-430a-96ea-94b709ead2de",
                  "requestedRoutingSkillIds": [
                    "bfb0ed09-de41-44ea-9ca9-efcbbfc65dfe"
                  ],
                  "segmentEnd": "2025-01-20T08:49:02.839Z",
                  "segmentStart": "2025-01-20T08:42:25.926Z",
                  "segmentType": "interact"
                }
              ]
            }
          ]
        },

    As you can see there is a tConnected time in milliseconds.



    ------------------------------
    Christoph Domaschke
    Leiter Service Center (Cronbank)
    ------------------------------



  • 7.  RE: Get call time in inbound flow

    Posted 22 days ago

    Hello,Christoph

    Thanks for the reply.
     
    My apologies. I was finally able to see the detailed data not by unchecking the "Flatten Output" checkbox on the test screen of the data action.
     
    As for the main issue, I would like to create a flow to store the "tConnected" value obtained by this API in a data table in an inbound flow.
    In detail, after the conversation is disconnected, I want to call the data action and save the "tConnected" value to the data table.
     
    In this case, I am not sure how to output the "tConnected" value.
     
    Best regards.


    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------



  • 8.  RE: Get call time in inbound flow

    Posted 22 days ago

    This is a question, but it has been resolved, so please close it.

    Thanks



    ------------------------------
    Matsumoto Shun
    Unknown
    ------------------------------



Need Help finding something?

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