Setup MySQL
making and accepting calls using a Database

In this chapter you can learn about how to make and accept calls using a MySQL database server with your Ozeki Phone System. In this guide you can get information about the installation steps, the database connection string, the database connection type and the database table layout for MySQL database server.

In order to make or accept calls using a MySQL database server you need to install the MyODBC driver on your computer. You can download this driver from the MySQL website. The newest drivers can give better performance and more reliable connection.

After you have installed the MyODBC driver to your computer, you need to install an SQL OzML 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:

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.

The connection string and the connection type should be entered on the SQL OzML API configuration form.

specifying connection string for mysql database
Figure 1 - Specifying the connection string for the MySQL database

Figure 2 shows the SQL queries that will be used if there is an incoming call.

sql queries for making outgoing calls
Figure 2 - SQL queries for making outgoing calls

Under the Incoming calls tab, you need to provide the SQL queries that will be used when there is an incoming call. Figure 7 shows the SQL query that you need to use.


Figure 7 - SQL queries for accepting incoming calls

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

-- -----------------------------------------------------
-- Table `OzekiPBX`.`ozmlin`
-- -----------------------------------------------------
CREATE TABLE `ozmlin` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `callerid` varchar(40) NOT NULL,
  `scriptid` int(10) NOT NULL,
  `duration` int(10) DEFAULT '0',
  `status` varchar(40) DEFAULT NULL,
  `recordurl` varchar(150) DEFAULT NULL,
  `starttime` datetime DEFAULT NULL,
  PRIMARY KEY (`id`))
ENGINE=InnoDB AUTO_INCREMENT=0
DEFAULT CHARSET=utf8;

-- -----------------------------------------------------
-- Table `OzekiPBX`.`ozmlout`
-- -----------------------------------------------------
CREATE TABLE `ozmlout` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `dialednumber` varchar(40) NOT NULL,
  `status` varchar(40) DEFAULT NULL,
  `duration` int(10) DEFAULT NULL,
  `scriptid` int(10) DEFAULT NULL,
  `recordurl` varchar(150) DEFAULT NULL,
  `starttime` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)) 
ENGINE=InnoDB AUTO_INCREMENT=0
DEFAULT CHARSET=utf8;

-- -----------------------------------------------------
-- Table `OzekiPBX`.`ozmlscripts`
-- -----------------------------------------------------
CREATE TABLE `ozmlscripts` (
  `scriptid` int(10) NOT NULL AUTO_INCREMENT,
  `ozml` varchar(10000) NOT NULL,
  PRIMARY KEY (`scriptid`))
ENGINE=InnoDB AUTO_INCREMENT=0
DEFAULT CHARSET=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