Setup MySQL for logging PBX events

In this chapter you can learn how to log PBX events on the Ozeki Phone System using a MySQL database server. In this guide you can see the installation steps, the database connection string, the database connection type and the recommended database table layout for MySQL database.

If you would like to save the PBX events with MySQL database server, first install the MyODBC driver on your computer. Always use the latest drivers that you can download from the MySQL website.

After you have installed the MyODBC driver to your computer, install a new Database Logger SQL API in the Ozeki Phone System.

During the configuration you should choose the following database connection type:

Odbc

You should use the next database connection string properly for your MyODBC driver:

Driver={MySQL ODBC 5.1 Driver};Server=127.0.0.1;Database=OzekiPBX;User=ozeki;Password=qwe123;Option=4;

The database connection string have to be modified to match your database. You should use the ip address or the hostname of your database server instead of the "127.0.0.1". Replace "OzekiPBX" to the name of you database and replace "ozeki" and "qwe123" to the username and password that can be used to connect to your database server.

In the following figure you can see the SQL templates tab of the Database logging API. Here, you need to provide the SQL queries that will store PBX events.

specifying sql queries for storing pbx events
Figure 1 - Specifying the SQL queries for storing PBX events

After the Database Logging SQL API has been configured in the Ozeki Phone System, you need to create the database tables for Database Logging SQL API. Use the following table layout:

-- -----------------------------------------------------
-- Table `OzekiPBX`.`ozpbxlog`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `ozpbxlog` (
    `id` int(11) AUTO_INCREMENT,
    `Time` datetime NOT NULL,
    `Thread` int(11) NOT NULL,
    `LogLevel` varchar(20) NOT NULL,
    `Logger` varchar(255) NOT NULL,
    `Message` text NOT NULL,
    PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8; 

If you have any questions or need assistance, please contact us at info@ozekiphone.com.

Dig deeper!
People who read this also read...

More information