API Interface
The API interface is over a websocket connection. The API caller just needs to know the IP address and the port number to connect to the iraCPA service. The url would be:
Code
The deployment can contain multiple server instances or multiple pods on Kubernetes, using the IraCluster HA framework from Epicode.
Set CPA Parameters
This API allows configuration of the various parameters which controls the behavior of the call progress analysis engine. Some prominent configurations that can be set are:
- Time limit for first detection, that LV or AM.
- The specific frequencies to detect other than identifying humans and answering machines.
- The detection event on which the CPA engine can stop the analysis.
- Total analysis time limit.
Request Body (json)
Use text mode in the websocket to send this json request. Keep listening to any replies asynchronously. The json schema is as follows:
Code
| Key | Type | Description | Example | Default |
|---|---|---|---|---|
| request_name | string (Required) | Specify the request name | set_cpa_params | None |
| tenant_id | string (Required) | Name of the licensee | acme eamd | None |
| config_name | string (Required) | Unique name for the configuration | "my_setup" | None |
| analysis | string (Required) | Name of the call progress analysis | amd | None |
| min_ambient_energy | integer | Threshold that separates perfect initial silence and ambient silence | 200 | 200 |
| initial_silence_ignore | integer | If the energy level is lower than minimum ambient energy, ignore the RTP packets for a duration (in milliseconds). | 5000 | 750 |
| log_rtp_history | bool | Log the history of RTP packets sent. Must be one of true, false. | true | false |
| tones | object (key, value pairs) | This is optional. Any beeps will emit BP by default. Tones are specified as frequency and tolerance. | {"FX":"2100|5","MD":"1662|5"} | {} |
| log_voice | bool | Tells the system whether or not to record and store the analysis stream. Must be one of true, false. | true | false |
| break_events | string | Comma-separated list of frequencies or events on which the CPA analysis can stop. | "LV,FX,AM" | None |
| amd_time_limit | integer | The time limit for determining the voice to be AM or LV. | 2000 | 1750 |
| total_timeout | integer | The time in milliseconds at which the analysis will stop. | 20000 | 15000 |
| silence_detect_limit | integer | Detect silence after initial AM/LV detection. Sends SL after the detect limit. Set 0 for no detection. Minimum value 1000 and maximum value 10000, in milliseconds. | 3000 | 2000 |
| beep_to_silence_gap | integer | Detect if silence follows a beep after a certain gap, specified in milliseconds. This emits BPSL event upon detection. Default is 0, then it won’t detect. | 1500 | 0 |
| beep_is_am | bool | Consider any beep before the AM/LV event as AM. | false | true |
| detect_dtmf | integer | Detect DTMF. | true | false |
| suppress_spikes | bool | Suppress sharp noises. | false | true |
| minimum_frequency | integer | Lowest frequency to be detected. | 400 | 250 |
Sample Request (json)
Code
Response Body (json)
| Field | Description |
|---|---|
resultstring | OK - No error01 - Mandatory fields are not specified02 - Could not save the CPA configuration |
reasonstring | Will provide the descriptive message about the result. |
If the cpa parameter is set in one instance, it will take effect in every instance in the iraCluster. You can set the cpa_parameter using one instance, and use config_name on the other instances.

