LogoLogo
  • What is Itgrix
  • Contacts
  • Our story
  • Connector installation
    • System requirements
    • Itgrix for Bitrix24 and Asterisk
      • How to perform offline authorization
      • How to obtain a license offline
      • Configuring the connector to work in a closed network
      • Call tests
    • Itgrix for Kommo and Asterisk
      • Restricted mode setting features
      • Call card
      • Call tests
  • Additional functions
    • Automatic call transfer to responsible manager
    • Setting up click-to-call features
      • Features of customization after Bitrix24 23.300.0 update
    • Autoreplacement for phone numbers
    • How to view employee call statistics in Bx24
    • FMC number recognition
    • Configuring WebRTC in Asterisk (FreePBX)
    • Itgrix AsterPhone for Bitrix24
    • Itgrix AsterPhone for Kommo
  • For admins
    • Running an additional copy of the module
    • Deploying a module backup
    • Call processing for the period
    • Examples of the structure of registered calls from CEL
    • Wrong time in created cases in Bitrix24
    • SSH access
    • Useful commands
    • Script to test the module service
    • Changing login and password to enter the admin panel
    • Module files
    • Status monitoring
    • Application update
    • In the CEL table, there is no internal employee number in the cid_num column
    • How to fix click-to-call
    • Custom SSL certificates for https requests
    • Examples of configuring WSS connections
    • Converting recordings to MP3 before sending to Bitrix24
    • How to fix call recording problems
    • Install and configure CEL
    • B24 authorization bugfix
  • Useful customizations (any CRM)
    • Audio file name customization
    • Call data (call_full) in customizations
    • Change the number / context for calling to asterisk
    • Change phone number before sending data to CRM
    • Black and white lists
  • Useful customizations itgrix_bx (Bitrix24)
  • Useful customizations itgrix_kmo (Kommo)
  • FAQ
    • How to pay
    • How to check licence status
    • Differences in connection to B24 via SIP-connector and Itgrix
    • How to turn off the display of calls in the calendar
    • How to view statistics on employee calls
    • Updating the app
    • Offline install (only for Bitrix24)
    • Offline update
    • Reliable softphones for Asterisk
    • Detail-call-statuses
  • Changelog Itgrix_bx
  • Changelog Itgrix_kommo
  • Policy of interaction with Asterisk
Powered by GitBook
On this page

Was this helpful?

  1. For admins

Converting recordings to MP3 before sending to Bitrix24

PreviousExamples of configuring WSS connectionsNextHow to fix call recording problems

Last updated 3 years ago

Was this helpful?

If you don't want to go into details, contact us. We will quickly help you and answer all questions! in any convenient way.

We recommend converting call recording files to MP3 format before sending to Bitrix24. This will allow you to:

  • Save space on Bitrix24 drive;

  • Listen to recordings using the built-in Bitrix24 player.

To configure customization, you should enable it in the Connector settings.

You have to implement the following customization to convert recordings (this code is already written in customization file, you should just remove the commenting symbols */ )

Edit file /opt/itgrix_bx/customizer/actions/process_record_file_path.php.

$callId = $params['call_id']; $from = $params['from']; $to = $params['to']; $path = $params['path'];

/* Пример конвертации записей разговоров в mp3 */ extract(pathinfo($path));

if ($extension === 'wav' && file_exists($path)) {

$newPath = "{$dirname}/{$filename}.mp3";

$command = "lame -h -b 192 '{$path}' '{$newPath}'";

exec($command, $_, $exitCode);

if ($exitCode === 0) {

$newBasename = basename($newPath);

mysqli_query(getDB(), "UPDATE `cdr` SET `recordingfile` = '{$newBasename}' WHERE `recordingfile` = '{$basename}'");

unlink($path);

$path = $newPath;

} else {

return array(

'state' => 'error',

'data' => "Ошибка конвертации: {$exitCode}",

);

}

}

/**/

return array(

'state' => 'success',

'data' => array(

'path' => $path,

),

);

This code assumes that you have the lame in the system installed. If you don't have it, you need to install it with any available package manager:

yum install lame

IMPORTANT: The code updates the data about the path to recording in the recordingfile field of the CDR table. Please note that any changes must be carried out by an experienced developer and take into account the specifics of your system.

If you need to save the original file and not update the data in the CDR table, you can search for the converted file when requesting for a record, and convert the recording only if it is not created:

$callId = $params['call_id'];

$from = $params['from'];

$to = $params['to'];

$path = $params['path'];

/* Пример конвертации записей разговоров в mp3 */

extract(pathinfo($path));

$newPath = "{$dirname}/{$filename}.mp3";

if (file_exists($newPath)) {

$path = $newPath;

} else if ($extension === 'wav' && file_exists($path)) {

$command = "lame -h -b 192 '{$path}' '{$newPath}'";

exec($command, $_, $exitCode);

if ($exitCode === 0) {

$path = $newPath;

} else {

return array(

'state' => 'error',

'data' => "Ошибка конвертации: {$exitCode}",

);

}

}

/**/

return array(

'state' => 'success',

'data' => array(

'path' => $path,

),

);

With this approach, additional MP3 recordings will be created, which will take up additional space on the Asterisk server. Input / output parameters are described in detail in this article.

Contact us