Recovering Metadata
Contents
The Recording Processor Script installation package provides an additional script that when run will recover recordings from Recording Processor's failed folder and repost the recordings to Interaction Recording Web Services (or Web Services if you're using version 8.5.210.02 or earlier) and SpeechMiner.
Prerequisites
Before you start, you must have the following prerequisites:
- Recording Processor Script version 8.5.xxx.xx
- Python 2.7 or higher
- Admin username and password with read and writer permissions on the folder where the script resides.
Recovering the Failed Folder
After you have installed the Recording Processor Script, you can find the recover_failedfolder.py recovery script in the <Installation Directory>/scripts/ directory.
From the command line on the machine where the Recording Processor Script is installed and running, execute the following command:
python recover_failedfolder.py -failFolder "C:\<Installation Directory>\RP\failed" -htccUri http://<Web Services IP Address>:<Web Services Port> -opsUser <User Name> -opsPass <Password> -sleepMs 30
To return the details of the parameters used, run the following command:
C:\<Installation Directory>\scripts>python recover_failedfolder.py -h
This command will return the following results:
usage: recover_failedfolder.py [-h] -failFolder FAILFOLDER [-htccUri HTCCURI]
[-sleepMs SLEEPMS]
[-rp.speechminer.uri SPEECHMINERURI]
[-deleteOnRecovered] [-defaultCCID DEFAULTCCID]
Recover RP failed folder
optional arguments:
-h, --help show this help message and exit
-failFolder FAILFOLDER
path to rp fail folder
-htccUri HTCCURI htcc prefix. e.g. http://gws-elb.genesyscloud.com
-sleepMs SLEEPMS miliseconds sleep after each recording is processed
-rp.speechminer.uri SPEECHMINERURI
speechMiner IR Uri, if provided, it will override
values in metadata
-deleteOnRecovered
-defaultCCID DEFAULTCCID
default CCID for recordings in folder unknownCCID
You can find the parameter descriptions of the parameters below.
Examples
If the configuration is correct and Recording Process Script failed to post recordings because of network problems, the following example will recover the recordings:
C:\<Installation Directory>\scripts>python recover_failedfolder.py -failFolder ..\failed -htccUri http://<Web Services URI> -opsUser <User Name> -opsPass <Password>
If Recording Processor Scripted failed to post recordings because the wrong SpeechMiner URI was provided, the following example will recover the recordings:
C:\<Installation Directory>\scripts>python recover_failedfolder.py -failFolder ..\failed -htccUri http://<Web Services URI> -sleepMs 20 -rp.speechminer.uri http://<SpeechMiner URI>/interationreceiver -defaultCCID 57c0b771-b57c-4ea8-8655-7ef6d3c58ccc Please enter htcc ops username: ops Please enter htcc ops password: ops Please enter rp.speechminer.auth (e.g. rp_user:123455): rpUser:123456 ...
If Recording Processor Script failed to post recordings because the CCID is invalid, the recordings are saved in the unknownCCID folder. Use the following script to recover those recordings in the unknownCCID folder:
C:\<Installation Directory>\scripts>python recover_failedfolder.py -failFolder ..\failed -htccUri http://<Web Services URI> -sleepMs 20 -rp.speechminer.uri http://<SpeechMiner URI>/interationreceiver -defaultCCID 57c0b771-b57c-4ea8-8655-7ef6d3c58ccc Please enter htcc ops username: ops Please enter htcc ops password: ops Please enter rp.speechminer.auth (e.g. rp_user:123455): rpUser:123456 ...
Re-posting the Recordings
After you have installed the Recording Processor Script, you can find the repost_to_sm_from_htcc.py reposting script in the <Installation Directory>/scripts/ directory.
From the command line on the machine where the Recording Processor Script is installed and running, execute the following command:
C:\<Installation Directory>\scripts>python repost_to_sm_from_htcc.py -startTime 1437057696000 -endTime 1437058696000 -htccUri http://<Web Services URI> -ccid 57c0b771-b57c-4ea8-8655-7ef6d3c58ccc -region us-west-1
To return the details of the parameters used, run the following command: C:\GCTI\gir_rps\scripts>python repost_to_sm_from_htcc.py -h
This command will return the following results:
usage: repost_to_sm_from_htcc.py [-h] -startTime STARTTIME -endTime ENDTIME
-region REGION -ccid CCID -htccUri HTCCURI
[-sleepMs SLEEPMS] [-pageLimit PAGELIMIT]
[-rp.speechminer.uri SPEECHMINERURI]
[-disableFailedFolder]
Recover RP failed folder
optional arguments:
-h, --help show this help message and exit
-startTime STARTTIME lower bound of range to recover
-endTime ENDTIME upper bound of range to recover
-region REGION range to recover, * for all
-ccid CCID contact center ID to recover
-htccUri HTCCURI htcc prefix. e.g. http://gws-elb.genesyscloud.com
-sleepMs SLEEPMS miliseconds sleep after each recording is processed. default to 0
-pageLimit PAGELIMIT page limit of script query from HTCC on each attmpt. default to 10
-rp.speechminer.uri SPEECHMINERURI
speechMiner IR Uri, if provided, it will override
values in metadata
-disableFailedFolder
You can find the parameter descriptions of the parameters below.
Examples
If only one region is recovered, the following command will re-post the recordings to SpeechMiner:
C:\<Installation Directory>\scripts>python repost_to_sm_from_htcc.py -startTime 1437057696000 -endTime 1437058696000 -htccUri http://<Web Services URI> -ccid 57c0b771-b57c-4ea8-8655-7ef6d3c58ccc -region us-west-1 Please enter htcc ops username: ops Please enter htcc ops password: ops ...
If there is more than one region recovered, the following command will re-post the recordings to SpeechMiner:
Recover range of recording from all regions
C:\<Installation Directory>\scripts>python repost_to_sm_from_htcc.py -startTime 1437057696000 -endTime 1437058696000 -htccUri http://<Web Services URI> -ccid 57c0b771-b57c-4ea8-8655-7ef6d3c58ccc -region * Please enter htcc ops username: ops Please enter htcc ops password: ops ...
If the failed recording is caused by an invalid SpeechMiner Interaction Receiver, the metadata will contain the wrong rp.speechminer.uri or rp.speechminer.auth. The following command will re-post the recording to SpeechMiner with the correct SpeechMiner URI:
C:\<Installation Directory>\scripts>python repost_to_sm_from_htcc.py -startTime 1437057696000 -endTime 1437058696000 -htccUri http://<Web Services URI> -ccid 57c0b771-b57c-4ea8-8655-7ef6d3c58ccc -region us-west-1 -rp.speechminer.uri http://<SpeechMiner IP Address>/interationreceiver Please enter htcc ops username: ops Please enter htcc ops password: ops Please enter rp.speechminer.auth (e.g. rp_user:123455): rpUser:123456 ...
Command Line Parameters
The following table describes the command line parameters:
| Parameter Name | Mandatory | Accept Prompt Input | Description | Example |
|---|---|---|---|---|
| failedFolder | Y | No | The path to the failed folder. If the folder includes spaces in the name, put quotes around the folder name—for example, "failed folder". | C:\<Installation Directory>\RP\failed |
| startTime | Y | No | The time, in UTC format, of the earliest recording to be processed. | 1437057696000 |
| endTime | Y | No | The time, in UTC format, of the latest recording to be processed. | 1437057696000 |
| htccUri | N | No | The host and port of the Interaction Recording Web Services node (or Web Services node if you're using version 8.5.210.02 or earlier). If this parameter is not defined, the recordings are not rePOSTed to Interaction Recording Web Services (Web Services). | http://<Web Services IP Address>:<Web Services Port> |
| region | N | No | The location of the recording. | |
| oopsUser | Y | Y | The admin username for Interaction Recording Web Services (Web Services). | <User Name> |
| oopsPassword | Y | Y | The admin password for Interaction Recording Web Services (Web Services). | <Password> |
| defaultCCID | N | No | The Contact Center ID. If this parameter is not defined, the script will use "UnknownCCID". | |
| rp.speechminer.uri | N | Yes | The host and port of the SpeechMiner node. If this parameter is not provided, or if it is an invalid URI, the script will prompt to override the value. | http://<SpeechMiner IP Address>:<SpeechMiner Port> |
| rp.speechminer.auth | N | Yes | The username and password for SpeechMiner. | <SpeechMiner Username>:<SpeechMiner Password> |
| sleepsMs | N | No | The time, in milliseconds, to wait after processing each recording. If this parameter is not provided, the value defaults to 0. | 30 |
| pageLimit | N | No | The number of pages to query on each process attempt. | 10 |
| deleteOnRecovered | N | No | Determines whether to delete the recording after the recovered recording is rePOSTed to Interaction Recording Web Services (Web Services) and SpeechMiner. If this parameter is not provided, the value deletes to false. | |
| defaultCCID | N | No | The default Contact Center ID. | |
| disableFailedFolder | N | No | Determines whether to disable the failed folder. |
Logging
The recover_failedfolder.py script writes audit logs in the recoverFailedFolder_<executiong-time>/results.log file.
The repost_to_sm_from_htcc.py script writes audit logs in the repost_to_sm_from_htcc_<executiong-time>/results.log file. If the disableFailedFolder parameter is not provided, and if there is an exception during recovery, the script will dump the recording metadata into repost_to_sm_from_htcc_<executiong-time>/<ccid> file.
