How to configure logging to the database using the SQL Database Pro module
Why the SQL Database Pro module is better than ODBC Database
SQL Database Pro has the following key advantages:
- It can keep a backup copy of data while the database is offline or unavailable to build a robust system.
- It can access stored procedures on the server.
- It can execute a queue of SQL queries.
- It can create multiple connections to your database if your data flow is fast (you have 30+ calls per minute).
When to use SQL Database Pro
- If the database is hosted on another computer, especially on a remote server accessed over the Internet.
- If you need to write data to two databases or two tables in parallel.
- If the data is going to be written to the database in a special way (for example, using a stored procedure).
Oracle: You need to install Oracle Client Tools on the computer where you are going to install the program.
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 "SQL Database Pro" checkbox (Figure 2).
Figure 2. Data export module
5. Open the data export module's settings by double-clicking the module's name.
6. Switch to the "Connection mode" tab and make sure that the "Temporarily disable" checkbox is unchecked (Figure 3).
Figure 3. Connection mode
7. Switch to the "Connection parameters" tab and configure the connection:
- Connection string, which consists of the database server’s IP address and the database name.
- Login and password.
- Additional connection parameters.
For more details on connection parameters, see the module's help file. To open it, click the question mark in the window title bar, and then click the "Database name" field.
Figure 4. Connection parameters
8. Switch to the "SQL queue" tab (Figure 5).
Figure 5. SQL queue
9. Click the "Action" button, and then select "Load SQL queue from a file" in the drop-down menu. You can find a text file named "pbxlogger-sql-queue.txt" with all necessary SQL queue parameters in the module's folder [the program's folder]\plugins\sqldb_pro\
10. Click "OK" and save all changes both in the SQL Database Pro settings window and in the module selection window.
Now each time new data are received, the program will write them to the database.