Products
Ozeki 10
Apps
Chat
SMS Gateway
SMS with Client Software
HTTP API
SMS from/to Database
MSSQL Express
Oracle SMS
MySQL SMS
PostgreSQL
PostgreSQL Installation
Create Database
Configure Database User
Test Message
SAP SQL Anywhere
Microsoft Access
PHP SMS API
Solutions
C# SMS API
VB.NET SMS API
SQL Logging
System Database
Robot Controller
Softphone
Connections
Installation guide
Terms and Definitions
SMS
Bulk Messenger
Cluster
Developer tools
Robots
Hardware
Technology
Company


Ozeki SMS Gateway
MySQL SMS MySQL SMS | PostgreSQL Installation PostgreSQL Installation

SMS from/to PostgreSQL

This chapter gives you great opportunity to see how to send and receive SMS messages through pre-created PostgreSQL database tables. You just need to connect to them with a Database User of Ozeki SMS Gateway. Do not forget to provide the ODBC driver connection string for the user.

How to send SMS from PostgreSQL
PostgreSQL Installation (Video guide)
Create Database Tables (Video guide)
Configure Database User (Video guide)
Send Test Message (Video guide)

Please install two important programs. A simple PostgreSQL database server and an Ozeki SMS Gateway, which is capable to create a Database User and connect to the PostgreSQL database using the connection string. Check this page how to install a Database User. Do not forget to create a separate table for the outgoing and incoming messages. These tables are called 'ozekimessagein' and 'ozekimessageout' in the current example. Send and receive SMS messages by using simple SELECT and INSERT SQL statements on the tables.

Use Ozeki SMS Gateway's browser GUI to install a Database User and provide a connection string similarly as you would do it for other databases (e.g. MSSQL, Oracle, MySQL etc.) PostgreSQL uses an ODBC connection string. Please select 'Odbc' connection string on the Database User's configuration panel as seen on Figure 2 and use this string:

Connection Type:ODBC
Connection String:DRIVER={PostgreSQL ODBC Driver(Unicode)}; SERVER=YourServerIP;port=5432; DATABASE=YourDatabaseName;UID=YourUsername;PWD=YourPassword;
Figure 1 - Example ODBC connection string, which needs to be modified

It works if you modify the variables by using the information of your PostgreSQL database server (Figure 2).


Figure 2 - Modify the connection string variables according to your PostgreSQL database

Install psqlODBC driver

The ODBC driver can be downloaded from:
https://odbc.postgresql.org/

Install psqlODBC driver by using the downloaded exe file and clicking through the dialog boxes of the installation process.

The psqlODBC driver is needed to create a database connection. It is required to open database connectivity on your ODBC driver, so Ozeki SMS Gateway can connect to your PostgreSQL database.

CREATE tables in PostgreSQL

PostgreSQL accepts simple SQL statements. You can see how to CREATE two separate tables for incoming and outgoing messages in Figure 3.

The CREATE TABLE script in PostgreSQL:

CREATE TABLE ozekimessagein
(
id serial,
sender varchar(30),
receiver varchar(30),
msg varchar(160),
senttime varchar(100),
receivedtime varchar(100),
operator varchar(100),
msgtype varchar(160),
reference varchar(100)
);

CREATE TABLE ozekimessageout
(
id serial,
sender varchar(30),
receiver varchar(30),
msg varchar(160),
senttime varchar(100),
receivedtime varchar(100),
reference varchar(100),
status varchar(20),
operator varchar(100),
errormsg varchar(250),
msgtype varchar(160)
);
Figure 3 - These statements CREATE two tables in your PostgreSQL database

You can always increase the size of the 'msg' field above 160 characters. You can also change it's data type as well.

It is strongly suggested to maintain the 'id' attribute in all tables. 'id' is basicly the index of each record.


Copyright © 2000- - Ozeki Informatics Ltd. | info@ozeki.hu | Tel: +36 1 371 0150
Home > Products > Ozeki 10 > Apps > SMS Gateway > SMS from/to Database > PostgreSQL
Page: 5769 | Login