IraCPA Installation

The Epicode releases for IraCPA consist of multiple deb packages, each serving a specific purpose:

1. IraBase: Required for all sites, this package includes a validation script for configuration files and a CDR uploader.
2. IraCluster: This package contains the Epicode interprocess messaging framework and licensing framework. It sets up the following components:
  • IraPass
  • IraPodWatcher
  • IraPodTracker
  • CpaTracker
  • Nats-server
3. IraCPA: This is the IraCPA engine with a web socket interface responsible for generating CPA results.

NOTE: This setup runs IraCluster components as services instead of running within Kubernetes. If you are using the IraCPA set up with Kubernetes, please refer to the link below to uninstall the earlier versions before proceeding with the new installation steps.
Link: https://support.epicode.in/help/en-gb/3/199


1. Download latest deb packages

Download the IraBase, IraCluster and IraCPA deb packages from the link below.

https://drive.google.com/drive/folders/1XWkIxQC9Dp4GoW_VxdudZq8PIcn7T9o7?usp=sharing

Change the current working directory to the directory with the downloaded debs.


2. Install latest version

 a. Install irabase

sudo apt install ./irabase_XXXX.deb


b. Generate nkeys

We will need two pairs of NKEYs for our NATS server. To generate a User NKEY, run the following command:

nk -gen user -pubout

This will produce output similar to:

SUACSSL3UAHUDXKFSNVUZRF5UHPMWZ6BFDTJ7M6USDXIEDNPPQYYYCU3VY
UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4

The first line starts with the letter S, indicating it is a Seed (private key). 

The U represents that it’s for a User. The second line is the public key.

Run this command twice to generate two key pairs, and keep them handy for the next step.


c. Create config json

The latest versions of IraCluster and IraCPA expect a JSON configuration file located at /usr/local/epi/conf/common_config.json. The file should contain the necessary configuration details. The format of the JSON file is as follows:

{
"cluster_id": "<cluster_id>",

"nats_conf": {
"nats_url": "nats://<ip-address>:4222",
"nats_seed_key": "<nats-seed-key>",
"nats_public_key": "<nats-public-key>",
"sys_nats_seed_key": "<sys-nats-seed-key>",
"sys_nats_public_key": "<sys-nats-user-key>",

},

"enable_log": true,
 "app_log_level": "info"

}

The nats_url can be set to 127.0.0.1 if the entire setup is running on a single machine. The two NKEY pairs generated in the previous step will be used in the following four lines of the configuration file.

Create irapass.json in the /usr/local/epi/conf/ directory with the below content:
{
        "use_old_rsa_protocol": true

}


Create iracpa.json in the /usr/local/epi/conf/ directory with the below content:

{
        "use_self_signed_certificate": true,
        "record_directory": "/var/amd_files",
        "wss_port" :8331,
        "ws_port": 8330,
        "api_http_port": 8670,
        "cpa_params": [
          {
            "config_name": "<config_name>",
            "tenant_id": "<tenant_id>",
            "analysis": "amd",
            "min_ambient_energy": 200,
            "initial_silence_ignore": 5000,
            "sensitivity": 2,
            "silence_detect_limit": 5000,
            "beep_to_silence_gap": 1000,
            "tones":
            {
              "FX":"2100|10"
            },
            "log_voice": false,
            "log_rtp_history": false,
            "break_events": "LV,AM",
            "amd_time_limit": 1750,
            "frequency_count": 200,
            "detect_dtmf": true,
            "beep_is_am": false,
            "total_timeout": 30000
          }
        ]
}


[Note: Replace the config-name and tenant-id in this config]

d. Install iracluster and iracpa

sudo apt install ./iracluster_XXX.deb
sudo apt install ./iracpa_XXXX.deb


e. Verify the services are running

systemctl status irapass

systemctl status irapodtracker

systemctl status irapodwatcher

systemctl status cpatracker

systemctl status iracpa  


f. Verify the installation

The log directory is /var/log/epi. 

Check the latest IraPass log to ensure that the licence is acquired. 

Check the latest IraCPA log and ensure that it has successfully connected to the NATS server and has joined IraCLuster.


g. Set CPA Config

The python script /usr/local/epi/scripts/py/set_cpa_config.py now has the additional configuration for amd_time_limit, which allows you to control the CPA analysis duration. The default is 1750 if not specified. 

Set the required value for amd_time_limit and then run the python script activating the python virtual environment. 

cd /usr/local/epi/scripts/py
source venv/bin/activate
python3 set_cpa_config.py <tenant_id>

You can now connect to IraCPA over websocket and send streams for analysis.


3. Monitoring

The debs come with a command line monitor which can be used to see the count of licenses that are assigned and the count of active CPA sessions.

/usr/local/epi/scripts/LicenseMonitor.sh