How to configure logging to the database using the ODBC Database module
If you are going to use an MS SQL Server, MySQL, or Oracle database, first create a database with tables for storing data.
For MySQL or Oracle, you need to install the latest 32-bit version of ODBC drivers.
Windows XP or higher already contains ODBC drivers for MS SQL Server.
The simplest solution is to install or reinstall the program, and then select the respective option in the installation wizard (Figure 1):
- Select “Create a configuration”
- Select a parser for your PBX
- Select a database type
Figure 1. Creating a configuration
If you are using an MS SQL Server, MySQL, or Oracle database, your must specify a connection string and the credentials (login and password) of an administrator/user who has the privileges to create objects in the database.
Figure 2. Creating a configuration
At the next step, you can choose whether to create any objects in the database.. You can copy the object creation script and pass it to your database administrator, who will create objects for you. If you prefer to do that, just skip this step.
Figure 3. Creating objects in the database
Figure 4. Interface type
Figure 5. DDL script for objects in the database
If the installation is successful, Call logging to a database will be configured to write data to the database. You only need to configure the connection to your PBX. PBX Reports will also be configured to read data from the same database.
In this case, you will be configuring everything manually.
1. Create a configuration (if you haven't done it yet) by clicking the "green plus" button in the program's main window.
2. Configure a connection to your PBX.
3. Switch to the "Modules - Query Parse Filter" tab and select a parser for your PBX (Figure 1).
Note: A lack or incorrect operation of the parser may prevent data from being written to the database. The next section describes how to check the parser's operation.
Figure 1. Selecting a parser
4. Switch to the "Modules - Data export" tab and check the "ODBC database" checkbox (Figure 2).
Figure 2. Selecting a data export module
5. Open the data export module's settings by double-clicking the module's name.
6. Click the "Load & Save" button (Figure 3), and select:
- "PBX-Logger-ODBC-Items" - if you are going to write data to a MySQL, MS SQL Server, or Oracle database.
- "PBX-Logger-ODBC-Access" - if you are going to write data to an MS Access database.
7. Switch to the "Common" tab (Figure 3) and enable data logging to the database.
Figure 3. Enabling logging to the database
8. Switch to the "Connection" tab.
8.1. If you already have an ODBC data source, select it from the list (Figure 4).
8.2. If you do nothave any ODBC data source yet, click the "Setup" button and create a system ODBC data source. For more details, see the next section. After creating the data source, click the Refresh button and select the newly created data source in the list.
Figure 4. Selecting an ODBC data source
9. Click "OK" and save all changes both in the ODBC database settings window and in the module selection window.
Now each time new data are received, the program will write them to the database.