Asterisk is a robust and flexible platform for organizing telephony, which can be configured in different ways, therefore, there is no general ready-made solution for the integration, but it is possible to organize an effective way for typical use cases.
In order to analyse phone calls, it is necessary to organise the transmission of information about the phone calls made to the imot.io service, then the audio recording of the phone call made with separation by channel, as well as detailed information about the call: when it was made, who called who, and any other information that can be used in speech analytics to filter or group the calls.
The imot.io service provides an HTTP API to upload a phone call via POST request to
https://test.imot.io/api/process_call
Detailed API description:
https://www.notion.so/imotio/API-IMOT-IO-a6cb3d075dac480d95cabe15f8da96c5
If you use FreePBX, its default settings allow you to record audio and store call information in the mysql database. In this case, it is possible to use the imot.io service to retrieve new calls from the telephony server.
This requires additional software to be installed on the FreePBX server:
https://github.com/iqtek/freepbx_speechanalytics_api
The essence of this software implicates that a web-server is additionally deployed on the server that provides an API for getting the list of calls for a period and for getting the audio recording of a particular call. The settings should be made according to the instructions supplied with it, including reconfiguring FreePBX to record channels separately. As part of the setup, it’s necessary to come up with a random access key (bearer token) and specify the mysql connection parameters, as well as mark which calls are allowed to be exported by specifying:
recognize_in = True #incoming
recognize_out = True #outcoming
recognize_local = False #internal
The running application listens to the TCP port specified in ruh.sh, in the launching arguments. If there is a public web server on the server, then it can be set to proxy to this application, by default it listens to 127.0.0.1:5005
Or open a port to access from the outside. You can only allow connections from the imot.io servers, which are 46.151.159.253 and 83.137.53.33
Next, in the integration section of the imot.io user's personal account, create the integration: select the freepbxiqtek service, specify the URL of the installed application, and the value of the token for authorisation.
The imot.io service will then periodically connect to the server and retrieve new calls, or you can manually download calls for a certain period.
To integrate, you need to organise recording of calls and their sending to the service via an API.