Deploying Recording Muxer Script
Contents
Genesys Interaction Recording (GIR) needs the Recording Muxer Script to combine the call and screen recordings for a seamless playback.
Prerequisites
Before installing and configuring the Recording Muxer Script, you must have the following prerequisites:
- An Interaction Recording Web Services (or Web Services if you're using version 8.5.210.02 or earlier) instance where the call recording and screen recording metadata is stored.
- A Recording Crypto Server instance to decrypt the encrypted recordings.
- Network access to the WebDAV storage where the recordings are stored.
Installing Recording Muxer Script
Installing on Windows
- Install 32 bit Python 2.7.x from the Python website.
- Install the Recording Muxer Script IP.
- Untar the <Recording Muxer Install Directory>/thirdparty/setuptools-1.3.2.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/setuptools-1.3.2 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/requests-2.4.1.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/requests-2.4.1 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/boto-2.32.1.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/boto-2.32.1 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/easywebdav-1.2.0.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/easywebdav-1.2.0 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/filechunkio-1.5.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/filechunkio-1.5 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/pyasn1-0.1.7.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/pyasn1-0.1.7 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/pyasn1-modules-0.0.5.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/pyasn1-modules-0.0.5 directory, run python setup.py install.
- Unzip the <Recording Muxer Install Directory>/thirdparty/ffmpeg/ffmpeg-2.4.3-win64-static-gpl3.0.zip.
- Unzip the <Recording Muxer Install Directory>/thirdparty/openssl/openssl-0.9.8zb-win64.zip.
- Untar the <Recording Muxer Install Directory>/thirdparty/docutils-0.13.1.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/docutils-0.13.1 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/six-1.10.0.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/six-1.10.0 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/python-dateutil-2.6.0.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/python-dateutil-2.6.0 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/jmespath-0.9.1.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/jmespath-0.9.1 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/botocore-1.4.57.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/botocore-1.4.57 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/futures-3.0.5.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/futures-3.0.5 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/s3transfer-0.1.10.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/s3transfer-0.1.10 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/boto3-1.4.0.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/boto3-1.4.0 directory, run python setup.py install.
Note: Install the following third party libraries in the order they appear.
Installing on Linux
RHEL 5 or RHEL 6
- Install Python 2.7.6 or later:
- Download the software from the
Python website.
It is recommend that newer versions of Python are installed separately from an existing versions (do not update).
- Download the software from the
Python website.
- Install the Recording Muxer Script IP.
- Untar the <Recording Muxer Install Directory>/thirdparty/setuptools-1.3.2.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/setuptools-1.3.2 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/requests-2.4.1.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/requests-2.4.1 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/boto-2.32.1.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/boto-2.32.1 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/easywebdav-1.2.0.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/easywebdav-1.2.0 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/filechunkio-1.5.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/filechunkio-1.5 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/pyasn1-0.1.7.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/pyasn1-0.1.7 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/pyasn1-modules-0.0.5.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/pyasn1-modules-0.0.5 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/ffmpeg/ffmpeg-2.4.3-centos5-x86_64-static-gpl3.0.tar.bz2.
- Execute chmod a+x ffmpeg and chmod a+x ffprobe.
- Untar the <Recording Muxer Install Directory>/thirdparty/openssl/openssl-0.9.8zb-centos5-x86_64.tar.bz2.
- Execute chmod a+x openssl.
- Untar the <Recording Muxer Install Directory>/thirdparty/docutils-0.13.1.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/docutils-0.13.1 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/six-1.10.0.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/six-1.10.0 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/python-dateutil-2.6.0.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/python-dateutil-2.6.0 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/jmespath-0.9.1.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/jmespath-0.9.1 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/botocore-1.4.57.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/botocore-1.4.57 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/futures-3.0.5.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/futures-3.0.5 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/s3transfer-0.1.10.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/s3transfer-0.1.10 directory, run python setup.py install.
- Untar the <Recording Muxer Install Directory>/thirdparty/boto3-1.4.0.tar.gz file.
- From the <Recording Muxer Install Directory>/thirdparty/boto3-1.4.0 directory, run python setup.py install.
Note: Install the following third party libraries in the order they appear.
Upgrading Recording Muxer Script
- Backup the Recording Muxer Script installation directory including logs and configuration file.
- Uninstall the Recording Muxer Script component.
- Install the new Recording Muxer Script component.
- Update the Recording Muxer Script configuration according to the standard installation procedures.
Configuring Recording Muxer Script
This section describes how to configure the Recording Muxer Script for your environment.
Configure Passwords
The following definitions describe the mapping of the environment variables to the corresponding configuration parameter:
HTCC_PASSWORD – maps to the existing configuration parameter under the htcc section, password value.
RCS_PASSWORD - maps to the existing configuration parameter under the rcs section, password value.
WEBDAV_PASSWORD - maps to the existing configuration parameter under the webdav section, password value.
In a Windows only environment, Recording Muxer Script supports storing all passwords in a secure keystore instead of storing in plain-text in the muxer.cfg file.
- From the muxer directory folder in the Recording Muxer installation folder (for example, <Recording Muxer Install Directory>\muxer), execute the following command:
python encryptPassword.py
The command will prompt for the appropriate values to be entered for the password/key configuration parameters. See the Genesys Interaction Recording Options Reference for the descriptions of the parameters. - Configure the muxer.cfg file leaving the following parameter values empty:
[webdav] password = [htcc] password= [rcs] password =
Configure Recording Muxer Script to support the SR Service Nightly Upload
The Recording Muxer Script splits the Muxer Period window into smaller time ranges to reduce the load on Elasticsearch and Recording Web Services Search and subsequently better supports the SR Service Nightly Upload.
To enable this support, set the following parameters in the Recording Muxer muxer.cfg file:
| Parameter Name | Default Value | Valid Value | Description |
|---|---|---|---|
| split_window_enabled | 0 | 1 (enables the support), 0 (disables the support) | Enables splitting the Muxer Period window into sub-intervals to improve Elasticsearch performance when querying Interaction Recording Web Services (RWS). |
| max_interval_minutes | 720 | 720 to (window size)/2 where window size = window_past_older_than-window_past if window_past_older_than is defined, or now - window_past otherwise | Specifies the maximum duration of the sub-interval in minutes. |
| interval_buffer_minutes | 240 | 240 | The minimum value is 1. This parameter should be set to the estimated maximum duration of the interaction and it must be less than max_interval_minutes. |
Configuring the Connection to Interaction Recording Web Services (Web Services)
To configure the Interaction Recording Web Services (or Web Services if you're using version 8.5.210.02 or earlier) connection, set the following parameters in the [htcc] section of the Recording Muxer muxer.cfg configuration file:
| Parameter Name | Default Value | Description |
|---|---|---|
| base_uri | Specifies the host and port of the Interaction Recording Web Services (Web Services) server—for example, https://<web services host>:<web services port>/. | |
| contact_center_id | Specifies the unique identifier of the contact center. | |
| username | ops | Specifies the username used to access the Interaction Recording Web Services (Web Services) account. |
| password | ops | Specifies the password used to access the Interaction Recording Web Services (Web Services) account.
Note:
|
Configuring the Connection to Recording Crypto Server
To configure the connection to the Recording Crypto Server, set the following parameters in the [rcs] section of the Recording Muxer muxer.cfg file:
| Parameter Name | Default Value | Description |
|---|---|---|
| base_uri | Empty | Specifies the host and port of the Recording Crypto Server: https://<Recording Crypto Server host>:<Recording Crypto Server port>/. |
| username | Empty | Specifies the contact center admin username used to access the Recording Crypto Server account belonging to the contact center specified by the contact_center_id option in the [htcc] section.
Note: The user must have the media decrypt permission. |
| password | Empty | Specifies the contact center admin password used to access the Recording Crypto Server account belonging to the contact center specified by the the contact_center_id option in the [htcc] section.
Note:
|
Configuring the Processing Commands
- The Recording Muxer uses libraries for analyzing and handling multimedia data. To configure these commands, set the following parameters in the muxer.cfg file, the [processing] section:
- ffmpeg = The path to the ffmpeg executable file.
ImportantThe ffmpeg executable is located under the directory where the thirdparty ffmpeg package was unzipped/untarred.- ffprobe = The path to the ffprobe executable file.
ImportantThe ffprobe executable is located under the directory where the thirdparty ffmpeg package was unzipped/untarred. - To enable Muxer to read multiple screen recordings metadata with one request, configure the following parameters using the muxer.cfg configuration file (optional):
- batch_read_screen_recording_metadata: Determines how screen recording metadata is received. The new algorithm reads multiple screen recordings metadata in one request. The previous algorithm reads one request at a time.
Valid Values: Using Bulk API = 1 / Using previous algorithm the integer <>1
Default Value: 1 - query_slice_size: Defines the maximum number of call recording records whose screen recordings should be queried.
Valid Values: all integers > 0
Default Value: 100
- batch_read_screen_recording_metadata: Determines how screen recording metadata is received. The new algorithm reads multiple screen recordings metadata in one request. The previous algorithm reads one request at a time.
- Configure the openssl parameter to set the path to the openssl executable.
Important
- The openssl executable is located under the directory where the thirdparty openssl package was unzipped/untarred.
- On Linux, specifying the absolute path to the openssl executable path is recommended to ensure that the default installed openssl (for example, /usr/bin/openssl) is not executed instead.
- Configure the window_past and window_past_older_than parameters to set the time in the past to search for the call recordings to multiplex with the screen recordings. See the "Configure HA" section for the recommended values for these parameters.
For more information about the [processing] section parameters, see the Genesys Interaction Recording Options Reference.
Configuring Sharding (Optional)
Sharding can be used to increase the capacity of the Recording Muxer Script solution. When configured, the muxing workload is divided among multiple active instances. By default, Sharding is disabled and muxer_id = -1.
When Sharding is in use, a Muxer instance can be configured to run in primary or in backup mode:
- In primary mode, the Muxer should be configured to query for call records from the last n hours (window_past_older_than=0, window_past=n hours), based on configuration in the muxer.cfg file for that instance.
- In backup mode, the Muxer should be configured to query for call records that are older than the last n hours but newer than m hours (window_past_older_than= n, window_past= m hours), based on configuration in the muxer.cfg file for that instance.
Sharding is configured based on the following command line or configuration file parameters within the [processing] section:
- muxer_id: A unique Muxer ID.
Valid values: A non-negative integer starting with 0 (the Muxer ID should be incremented by 1 for each additional instance).
If you are not using Sharding, the value should be empty or -1. - total_muxers: The total number of primary Muxer instances deployed (excluding the backup).
Valid Values: max(muxer_id) + 1
If you are not using Sharding, (indicated by muxer_id not being set, or being set to -1), the Muxer ignores this value. - muxer_type: indicates if the Muxer is operating in primary mode or backup mode.
Valid Values: primary, backup
If you are not using Sharding, (indicated by muxer_id not being set, or being set to -1), the Muxer ignores this value.
To specify Sharding parameters using the command line, the following arguments are used:
- muxer-type
- muxer-id
- total-muxers
Note: The Sharding parameter values passed in the command line overrides the corresponding values specified within the configuration file. The following is the supported command line: python.exe muxer_process.py --config-file=CONFIG_FILE --muxer-type=MUXER_TYPE --muxer-id=MUXER_ID --total-muxers=TOTAL_MUXERS
For example: When using the following values, the system will have two instances of Muxer running:
- muxer_type=primary
- muxer_id=0 (for the first instance)
- muxer_id=1 (for the second instance)
- total_muxers=2
The following is the command line example for running the first instance: python.exe ../muxer/muxer_process.py --config-file=muxer.cfg --muxer-type=primary --muxer-id=0 --total-muxers=2
The following is the command line example for running the second instance: python.exe ../muxer/muxer_process.py --config-file=muxer.cfg --muxer-type=primary --muxer-id=1 --total-muxers=2
Note: When there are multiple instances of Muxers deployed on the same machine, then, a different temp_dir value for each instance of the Muxer must be configured in the [processing] section of the muxer.cfg file. This avoids the issues of one Muxer deleting the temporary files for the other instances.
When running in backup mode, the Muxer will automatically calculate the muxer_id to be used to support this deployment mechanism, based on the specified muxer_id. The configured muxer_id used for the backup instance should match the muxer_id that is configured for the primary instance on the same machine, if both primary mode and backup mode instances are deployed together.
For example, if muxer_id=2 and total_muxers=4 in the Muxer configuration file:
- When muxer_type=primary, the muxer_id used will be 2.
- When muxer_type=backup, the muxer_id used will be 3.
- The total_muxers value must be changed for each existing Muxer instance.
- All muxer instances must be restarted.
Configuring High Availability
Recording Muxer Cluster
The Recording Muxer Script provides High Availability support using multiple instances of the Recording Muxer Script (all active). HA supports:
- Active/active pairs with the aim to load balance equally between the Recording Muxer nodes by splitting and configuring the time window on each node, so that it is close to equal the number of recordings found on each time window.
- When one of the node dies, recordings are still multiplexed.
Limitations:
- If the node with time window, now - N/2, dies, multiplexing will still occur, but a slower rate since the second node's time window is from N/2 to N.
- If the node with time window, N/2 - N, dies, screen recordings that are uploaded with the delay more than N/2 might not be multiplexed.
- Nodes should be configured so that the time windows are exclusive of each other, otherwise it may result in two multiplexed files being uploaded.
To configure HA:
- In each Recording Muxer’s muxer.cfg configuration file, in the [processing] section, set the following values for each node. For example,
- On first node:
- window_past= 720
- window_past_older_than =
- On second node:
- window_past = 1440
- window_past_older_than = 720
- On first node:
- As a general rule, if the screen recording upload occurs with a delay of N, the configuration on each node can be set to:
- On first node:
- window_past = N / 2
- window_past_older_than =
- min-poll_interval = N/200
- On second node:
- window_past= N
- window_past_older_than = N / 2
- min-poll_interval = N/200
- On first node:
- Genesys recommends that multiple Recording Muxer instances be deployed on different hosts to provide better HA and also not to have machine resource contentions.
- If the recording upload is delayed by more than the time window configured for the Recording Muxer Script, it is possible that the recording will be outside of the processing window and not be multiplexed. For such cases, the Recording Muxer Script can be run as a migration tool to batch process the records matching any desired criteria. For more information see the call_recording_query_string parameter under Configuring the Advanced Options in the Advanced Configuration tab.
Configuring the Connection to WebDAV
In the [webdav] section of the muxer.cfg file, set the following parameters:
- username = The username to allow read/write access to the WebDAV storage server.
- password = The password to allow read/write access to the WebDAV storage server.
- If multiple WebDAV storage are used for same contact center region, make sure to use the same username and password.
- If the "Configuring the Secure Password Storage" step was performed, leave the password value empty.
- A password can be overridden by the WEBDAV_PASSWORD environment variable.
Configuring the Advanced Options
To manage the records returned for multiplexing, set the following options in the [advanced] section of the muxer.cfg file:
- worker_threads = The number of parallel processing threads.
- pagination = The maximum number of records returned with each Interaction Recording Web Services (or Web Services if you're using version 8.5.210.02 or earlier) query.
- max_overlap_allowed = The overlap time before truncating.
- video_padding_slice_length_ms = If the video starts later or ends earlier than the audio, set the duration needed to prepend or append a padded video slice. Genesys recommends to set it to 5000.
- call_recording_extra_query_string = Used to specify parameter value pairs other than startTime, endTime, and limit.
If left empty, the call_recording_extra_query_string value will be defaulted internally to userData=SRSScreenRecordingStateStarted, if the HTCC version is >= 8.5.201.14, otherwise, it remains an "" (empty string).
Specify "disable" (without quotes) to force it to be an empty string without checking the HTCC version. When the final value of this configuration is not empty, the Recording Muxer Script will continually poll for records that match the searching criteria according to the final value of the configuration that should be processed.
Genesys recommends that this parameter be left empty. Query parameters have to be formatted as: <parameter name>=<value>[&<parameter name>=<value>…].
The following table describes values (query parameters) that are available (except startTime and endTime). - call_recording_query_string = When not empty, [call_recording_query_string] queries Interaction Recording Web Services (Web Services) with the given string for records to process. Instead of continually polling for records to process, the Recording Muxer script will exit once the returned records are processed. Genesys recommends that this parameter be left empty unless the Muxer script is to be used for batch migrating the old recordings. Query parameters have to be formatted as: <parameter name>=<value>[&<parameter name>=<value>…]. The following table describes values (query parameters) that are available:
Parameter Name Description callerPhoneNumber Retrieves all recordings which apply to any call containing the specified ANI attribute. The exact match of stored number (alphanumeric-only) and request parameter (alphanumeric-only) is used. The request string can contain * wildcard which can substitute any number of any symbols in the request. Search is case-sensitive. dialedPhoneNumber Retrieves all recordings which apply to any call containing the specified DNIS attribute. The exact match of stored number (alphanumeric-only) and request parameter (alphanumeric-only) is used. The request string can contain * wildcard - which can substitute any number of any symbols in request. Search is case-sensitive. startTime Retrieves all recordings that started >= the specified time. endTime Retrieves all recordings that ended <= the specified time. userName Retrieves all recordings in eventHistory->contacts of which the passed userName/firstName/Lastname is present. User can use wildcards to specify only part of the username/firstname/lastname. If more than 1 word is used (divided by spaces) -the records containing any of provided terms as username, firstname or lastname will be included. If user wants to retrieve records containing ALL terms - the AND keyword should be used. Sample: ?userName= Alice AND Amber - will seek for recording with events->contact-> username/firstName/lastName containing Alice and Amber (possible - in different users). Search is case-insensitive. userData Retrieves all recordings in eventHistory->data of which the passed userData is present as value of HashMap. These matches are supported: - Exact match - match the entire value (for example, "tom" will find "tom").
- Wildcarded value (for example, "tom*" will find a record with "tomas").
- Combination of matches - If the query terms are separated by spaces (for example, "tom jerry" will look for recordings that contain "tom" or "jerry").
Configuring the Recording Muxer Using Genesys Administrator Extension (Optional)
The Recording Muxer uses a configuration file instead of a specific application object in Configuration Server. However, it is possible to configure the Recording Muxer as a "third-party server" application enabling Genesys Administrator Extension to monitor, start, and stop the process.
The following steps describe how to setup Recording Muxer as a "third party server" application in Genesys Administrator Extension. For more information, see the Using the Management Layer section of the Framework 8.5.1 Management Layer User's Guide
Configuring Recording Muxer Script to Start/Stop via LCA using Genesys Administrator Extension:
- Install and deploy the latest Recording Muxer script.
- Make sure that the Local Control Agent (LCA) is running.
- Create a new application template in Genesys Administrator Extension called Recording Muxer script of type Third Party Server.
- Create a new application (for example, myRecordingMuxer) in Genesys Administrator Extension using this new application template.
- On Windows:
- Set the Command Line parameter to the python executable (for example, C:\Python27\python.exe).
- Set the Host parameter in the application’s server info to the correct Host object.
- Set the Working Directory parameter to the <Recording Muxer Install Directory>\muxer directory. For example, C:\Program Files\GCTI\Recording Muxer Script\muxer.
- Set the Command Line Arguments parameter to the python arguments: muxer_process.py --config-file=muxer.cfg.
- On Linux:
- Set the Command Line parameter to env.
- Set the Host parameter in the application’s server info to the correct Host object.
- Set the Working Directory parameter to the <Recording Muxer Install Directory>/muxer directory. For example, /opt/genesys/Recording_Muxer_Script_8.5/muxer/.
- Set the Command Line Arguments parameter. The LD_LIBRARY_PATH must be set to include the openssl binary directory before muxer script execution. For example, LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<untarred openssl directory> /opt/python27/python muxer_process.py –-config-file=muxer.cfg.
For more information about the Recording Muxer Script parameters, see the Genesys Interaction Recording Options Reference.
Starting the Recording Muxer Script
To launch the Recording Muxer script, run the following command from the <Recording Muxer Install Directory> (where x = 6):
On Windows:
- <python2.7.x executable> muxer_process.py --config-file=muxer.cfg
On Linux:
- env LD_LIBRARY_PATH=<untarred openssl directory>:$LD_LIBRARY_PATH <python2.7.x executable> muxer_process.py --config-file=muxer.cfg
By default the Recording Muxer’s log file is stored in the working directory. This can be changed by specifying a preexisting folder in the logfile_path parameter in the [logfile] section of the configuration file. For example:
logfile_path = C:\logs\recordingMuxer

