byoi-uploader

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

byoi-uploader

To run this example you need to have BYOI enabled in your Genesys Cloud ORG. The repo also assume that you have experience and a understanding of both Genesys Cloud APIs and GO.

Also not that BYOI may have costs to using it so please ensure you understand this before using it.

Step 1

You will need to create a client credentials OAuth in your Genesys Cloud ORG. This will need to include the permissions:

conversation:conversation:inject
conversation:communication:view
recording:encryptionKey:view
recording:recording:upload

If Topics are also required (be aware speech & text analytics pricing may apply) as part of the upload you will also need:

speechAndTextAnalytics:program:view
routing:transcriptionSettings:view
speechAndTextAnalytics:settings:view
routing:queue:view

Once created copy the clientId and secret and store them securely as you will need them later on.

Step 2

You will need to create a sourceId to do this make a POST request to /api/v2/presence/sources. You can use the API Explorer to do this, I suggest using a name and description like the below:

name: BYOI
description: used for byoi uploads
type: user

Personally I also create a seperate Division and Queue in that division to upload these interactions to.

To run the uploader you will need to pass in the following environment variables:

clientId=oauth_clientid
secret=oauth_secret
region=mypurecloud.com.au 
sourceId=userId_of_source 
agentId=userId_of_agent
queueId=queueId_of_queue
dirPath=folder_location

If you want to have the conversations transcribed and Speech Analytics Topics run over them as well (this is optional and has a cost to it) you will also need to pass in the following environment variables:

programId=programId_of_speech_analytics_program
language=langauge_eg_en-AU

Step 3

To install and run the program you can either build the code locally and run it or if you have GO installed you can run the following command to download and run the program:

go install github.com/mcphee11/byoi-uploader@latest

inside the "dirPath" folder you will need the opus recordings as well as the xml metadata files. By default the source code is set to look for xml files in the below format. If y ou require a different format you can edit the source code to suit your file formats. If a xml variable is NOT found i have hard coded a default value to ensure the upload still works. This can be changed to your own needs or defaults based on your requirements.

<appConfig version="1.0">
  <interactionId>2b9f3d8a-67c1-4b51-9e8a-2c8e104f329d</interactionId>
  <startTime>2024-06-15T10:00:00Z</startTime>
  <endTime>2024-06-15T10:04:45Z</endTime>
  <duration>285</duration>
  <ani>+61400001000</ani>
  <dnis>+61400000001</dnis>
  <type>opus</type>
  <direction>inbound</direction>
</appConfig>

Also if you require MORE KVPs then they can also be added into the source code based on your xml files. The IMPORTANT this is that both the opus and xml files need to have the same name eg the interactionId for example.

NOTE:

Optionally you can also add logLevel=Debug which will then set the logging.log file output to debug level the default level is Info.

Also the logging by default is set to go into a file called logging.log in the dir where the GO program is ran. This is also configured so that if the logging.log file gets to 5Mb a .1 gets added to the file name then for the next file .2 etc this will allow for long running durations with LOTS of files without creating a log file that is to large.

Each time a conversation is uploaded a . will append to the terminal to show a "loading" style to ensure the users knows its not hung, if an interaction is checked that has already been uploaded a , is appended. Important Errors will also be shown in the terminal print out as well as a confirmation when all the files in the dir have been processed.

Database

When running the app a local database is created in a file called byoi_uploader_state.db this holds the state of the files that have been uploaded. This is so on a restart of the app the files that have already been uploaded are not re-uploaded. To clear out the database you can delete the file or you can run the command:

clearDB=true

If you want to check the version of the cli app you can run the command:

version

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd is used for functions
Package cmd is used for functions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址