SQL to SMS Gateway configuration - MySQL table definition

This page gives you the database table layout if you want to setup an SQL to SMS Gateway configuration for MySQL. The tables defined here can be used as a startup. If you wish you can add extra columns to these tables or you can create custom tables.

If you want to change these table definitions to support your requirements, do not forget to review the SQL templates that are used by the SMS gateway to work with these tables. The following guide gives you information on how to view and modify the SQL templates:

SQL to SMS Gateway configuration - SQL templates

The recommended database table layout for MySQL contains two database tables called ozekimessageout and ozekimessagein. Their definitions are displayed in Figure 1.

CREATE TABLE ozekimessagein (
  	id int(11) NOT NULL auto_increment,
  	sender varchar(255) default NULL,
  	receiver varchar(255) default NULL,
  	msg varchar(160) default NULL,
  	senttime varchar(100) default NULL,
  	receivedtime varchar(100) default NULL,
  	operator varchar(100) default NULL,
 	msgtype varchar(160) default NULL,
  	reference varchar(100) default NULL,
  	PRIMARY KEY (id)) 
  	charset=utf8;
	
ALTER TABLE ozekimessagein ADD INDEX (id) ;
CREATE TABLE ozekimessageout (
  	id int(11) NOT NULL auto_increment,
  	sender varchar(255) default NULL,
  	receiver varchar(255) default NULL,
  	msg varchar(160) default NULL,
  	senttime varchar(100) default NULL,
  	receivedtime varchar(100) default NULL,
  	reference varchar(100) default NULL,
  	status varchar(20) default NULL,
  	msgtype varchar(160) default NULL,
  	operator varchar(100) default NULL,
  	errormsg varchar(250) default NULL,
  	PRIMARY KEY (id)) 
  	charset=utf8;
  	
ALTER TABLE ozekimessageout ADD INDEX (id);

Figure 1 - MySQL table definition for SQL to SMS gateway configuration

More information