Install and configure CEL
Configuring CEL on Linux
Before configuring ODBC in Asterisk, you must install the necessary packages on the system:
If you have Ubuntu and there is no connector in the repositories, you need to download the current version from the site https://dev.mysql.com/downloads/connector/odbc/ and install it:
The configuration for the MySQL ODBC driver is done in the /etc/odbcinst.ini file Configuration Example:
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:
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:
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:
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:
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:
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.
Restart Asterisk.
Verification of work is carried out using commands from the CLI Asterisk:
Last updated