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

Install and configure CEL

PreviousHow to fix call recording problemsNextB24 authorization bugfix

Last updated 5 years ago

Was this helpful?

Configuring CEL on Linux

Before configuring ODBC in Asterisk, you must install the necessary packages on the system:

apt-get install unixODBC unixODBC-dev libmyodbc

If you have Ubuntu and there is no connector in the repositories, you need to download the current version from the site and install it:

$ tar xvf ./mysql-connector-odbc*.tar.gz
$ cp ./lib/libmyodbc5a.so /usr/lib/x86_64-linux-gnu/odbc/libmyodbc5a.so

The configuration for the MySQL ODBC driver is done in the /etc/odbcinst.ini file Configuration Example:

[MySQL]
Description = ODBC for MySQ
Driver = /usr/lib/odbc/libmyodbc.so
Setup = /usr/lib/odbc/libodbcmyS.so
FileUsage = 1

If there are no specified directories on the specified paths, then they can be in another directory, they can be easily found, just run the following commands:

:~# updatedb
:~# locate libmyodbc.so
:~# locate libodbcmyS.so

The last two commands will show the location of the libraries on the screen, we will write the corresponding path, for example: /usr/lib/i386-linux-gnu/odbc/libmyodbc.so

The next step is to configure the /etc/odbc.ini file, which is used to create an identifier that Asterisk will use to refer to this configuration. If you decide to change the database in the future, you should reconfigure this file.

Here is an example configuration:

[asterisk-connector]
Description = MySQL connection to 'asterisk' database
Driver = MySQL
Database = asterisk
Server = localhost
UserName = user
Password = 123456
Port = 3306

Now we will configure Asterisk to work with the database through ODBC, for this, use the /etc/asterisk/res_odbc.conf file.

Example configuration of this file:

[asterisk]
enabled => yes
dsn => asterisk-connector
username => asterisk
password => 123456
pooling => no
pre-connect => yes

The dsn option indicates the connection that is configured in /etc/odbc.ini, and the pre-connect option tells Asterisk to raise the connection to the database when the res_odbc.so

module is loaded Important note, Asterisk must be built with ODBC support! To verify, you can run the odbc show command from the CLI.

And now the most important thing, we proceed to the configuration of CEL. Open the configuration file. Open the /etc/asterisk/cel.conf config and make the following changes to it:

[general]
enable=yes
apps=all
events=all
dateformat = %F %T

apps - this option indicates which applications should be monitored.

events - with this option we indicate which events (from the table above) should be entered in the database.

Next, you need to edit the /etc/asterisk/cel_custom.conf file in it, uncomment the [mappings] section.

And the last file to be edited /etc/asterisk/cel_odbc.conf, we will make the following changes to it:

[first]
connection=asterisk 
table=cel
loguniqueid=yes

The connection option specifies the name of the connector from the res_odbc.conf file, and the table option specifies the name of the database table for saving data.

The final step in the configuration is to create a database and table.

$ mysql –uroot –p
mysql> CREATE DATABASE asterisk;
mysql> use asterisk;
mysql> CREATE TABLE IF NOT EXISTS `cel` (
`id` int(11) auto_increment,
`eventtype` varchar(30),
`eventtime` datetime,
`cid_name` varchar(80) DEFAULT '',
`cid_num` varchar(80) DEFAULT '',
`cid_ani` varchar(80) DEFAULT '',
`cid_rdnis` varchar(80) DEFAULT '',
`cid_dnid` varchar(80) DEFAULT '',
`exten` varchar(80) DEFAULT '',
`context` varchar(80) DEFAULT '',
`channame` varchar(80)  NULL DEFAULT NULL,
`src` varchar(80)  NULL DEFAULT NULL,
`dst` varchar(80)  NULL DEFAULT NULL,
`channel` varchar(80),
`dstchannel` varchar(80)  NULL DEFAULT NULL,
`appname` varchar(80)  NULL DEFAULT NULL,
`appdata` varchar(80)  NULL DEFAULT NULL,
`amaflags` int(11)  NULL DEFAULT NULL,
`accountcode` varchar(20) NULL DEFAULT NULL,
`uniqueid` varchar(32),
`linkedid` varchar(32),
`peer` varchar(80) NULL DEFAULT NULL,
`userdeftype` varchar(255) NULL DEFAULT NULL,
`eventextra` varchar(255) NULL DEFAULT NULL,
`userfield` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `uniqueid_index` (`uniqueid`),
KEY `linkedid_index` (`linkedid`)
);

Restart Asterisk.

# service asterisk restart

Verification of work is carried out using commands from the CLI Asterisk:

> cel show status
> odbc show
https://dev.mysql.com/downloads/connector/odbc/