ucp –sql - ozeki · web view9.2.1 php example 68 9.2.2 asp example 69. about this document this...

80
OZEKI IP SMS SMS messaging over the IP network using a UCP connection / user manual / Last change: 16 th January, 2005.

Upload: others

Post on 13-Mar-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

OZEKI IP SMS

SMS messaging over the IP network using a UCP connection

/ user manual /

Last change: 16th January, 2005.Document version: 1.0.4Document length: 69 pages

© Ozeki Informatics Ltd. Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

The information in this document is subject to change without notice and describes only the product defined in the introduction of this documentation. This document is intended for the use of Ozeki's customers only for the purposes of the agreement under which the document is submitted, and no part of it may be reproduced or transmitted in any form or means without the prior written permission of Ozeki. The document has been prepared to be used by professional and properly trained personnel, and the customer assumes full responsibility when using it. Ozeki welcomes customer comments as part of the process of continuous development and improvement of the documentation.

The information or statements given in this document concerning the suitability, capacity, or performance of the mentioned hardware or software products cannot be considered binding but shall be defined in the agreement made between Ozeki and the customer. However, Ozeki has made all reasonable efforts to ensure that the instructions contained in the document are adequate and free of material errors and omissions. Ozeki will, if necessary, explain issues which may not be covered by the document.

Ozeki's liability for any errors in the document is limited to the documentary correction of errors. OZEKI WILL NOT BE RESPONSIBLE IN ANY EVENT FOR ERRORS IN THIS DOCUMENT OR FOR ANY DAMAGES, INCIDENTAL OR CONSEQUENTIAL (INCLUDING MONETARY LOSSES), that might arise from the use of this document or the information in it.

This document and the product it describes are considered protected by copyright according to the applicable laws.

Ozeki logo is a registered trademark of Ozeki Informatics Ltd.

Other product names mentioned in this document may be trademarks of their respective companies, and they are mentioned for identification purposes only.

Copyright © Ozeki Informatics Ltd 2005. All rights reserved.

© Ozeki Informatics Ltd. 2 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

1 Contents1 CONTENTS...................................................................................................................................................3

2 ABOUT THIS DOCUMENT........................................................................................................................5

2.1 SUMMARY OF CHANGES.........................................................................................................................52.2 REFERENCES...........................................................................................................................................5

3 GENERAL OVERVIEW..............................................................................................................................6

3.1 INTRODUCTION.......................................................................................................................................63.2 WHAT DO YOU NEED TO SET UP AN IP SMS CONNECTION?..................................................................63.3 HOW DOES OZEKI IP SMS SOFTWARE HELP?......................................................................................6

4 GETTING STARTED...................................................................................................................................7

4.1 SYSTEM REQUIREMENTS FOR RUNNING THE OZEKI SMS SERVER WITH A UCP...................................74.2 THE MOST IMPORTANT FEATURES..........................................................................................................74.3 THE PACKAGE CONTAINS THE FOLLOWING COMPONENTS......................................................................7

5 TECHNICAL INFORMATION FOR THE UCP PROTOCOL STACK...............................................8

5.1 ARCHITECTURAL ELEMENTS OF OZEKI SMS.........................................................................................95.2 OZEKI SMS INTERFACES......................................................................................................................10

5.2.1 SQL – SMS gateway........................................................................................................................105.2.2 FILE – SMS gateway.......................................................................................................................105.2.3 HTTP – SMS gateway.....................................................................................................................105.2.4 IPC – SMS gateway (COM, SOAP)................................................................................................10

6 INSTALLATION GUIDE..........................................................................................................................11

6.1 INSTALLATION STEPS............................................................................................................................116.2 QUICK INSTALLATION STEPS:...............................................................................................................11

6.2.1 Step 1: Installing the application....................................................................................................116.2.2 Step 2 Configuring the application for UCP...................................................................................166.2.3 Step 3 Testing the connection..........................................................................................................206.2.4 Step 4 Sending your first SMS.........................................................................................................22

7 SMS SQL GATEWAY................................................................................................................................23

7.1 SEND AND RECEIVE SMS MESSAGES WITH THE HELP OF A DATABASE..............................................237.2 SQL TABLE DEFINITIONS FOR SENDING AND RECEIVING MESSAGES WITH OZEKI IP SMS UCP.......24

7.2.1 Microsoft SQL Server......................................................................................................................247.2.2 MySQL.............................................................................................................................................257.2.3 Interbase..........................................................................................................................................257.2.4 Oracle..............................................................................................................................................267.2.5 PostgresSQL....................................................................................................................................27

7.3 CONFIGURING OZEKI SMS DATABASE CONNECTION...........................................................................287.4 INSTALLING AND CONFIGURING MYSQL FOR OZEKI IP SMS UCP..................................................29

7.4.1 Download and Installation of MySQL Server.................................................................................297.4.2 Starting MySql and creating the database structure.......................................................................317.4.3 Installing the MySql ODBC driver..................................................................................................347.4.4 Installing MyODBC to connect MySQL and Ozeki SMS................................................................347.4.5 Download MyODBC from www.mysql.com....................................................................................347.4.6 Installing MyODBC........................................................................................................................367.4.7 Verify the installation......................................................................................................................367.4.8 Installing Ozeki IP SMS UCP Service............................................................................................38

7.5 INSTALLING MYODBC TO CONNECT POSTGRESQL DATABASE AND OZEKI IP SMS UCP.................387.6 SEND AND RECEIVE SMS MESSAGES FROM MICROSOFT ACCESS.......................................................46

7.6.1 Create an Access database..............................................................................................................467.6.2 Create an ODBC Connection..........................................................................................................497.6.3 Configure OZEKI IP SMS UCP to use your newly created ODBC connection.............................507.6.4 Start the Ozeki IP SMS UCP and send/receive SMS messages from MS Access............................54

© Ozeki Informatics Ltd. 3 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.6.5 SQL Problem with quotes................................................................................................................58

8 FILE-SMS GATEWAY..............................................................................................................................60

8.1 INSTALLATION AND CONFIGURATION...................................................................................................608.2 FILE FORMATS......................................................................................................................................64

8.2.1 The simple file format......................................................................................................................648.2.2 The verbouse file format..................................................................................................................648.2.3 The list file format...........................................................................................................................648.2.4 Configuring the drictory locations..................................................................................................65

9 HTTP SMS GATEWAY.............................................................................................................................67

9.1 INSTALLATION......................................................................................................................................679.2 EXAMPLE CLIENT APPLICATIONS..........................................................................................................68

9.2.1 PHP EXAMPLE..............................................................................................................................689.2.2 ASP EXAMPLE..............................................................................................................................69

.

© Ozeki Informatics Ltd. 4 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

2 About this document

This document describes the UCP interface of the Ozeki IP-SMS software. UCP is a protocol that transfers messages between applications and the Short Message Service Center (SMS Center) of the GSM Service provider over an IP link. This link can be a leased line or the Internet. UCP/EMI is version 3.5 or 4 of the Universal Computer Protocol / External Machine Interface protocol. This document is intended for operator personnel involved in daily operations of the Ozeki IP SMS Software and for application developers.

2.1 Summary of changes

Date released Version Changes15. August 2004. 1.0.0 The first version is created

24. October 2004. 1.0.1 Chapter four was modified. The IPC-SMS gateway description was added.

28. October 2004. 1.0.2 Some of the screenshots were updated to reflect changes in the user interface

08. November 2004. 1.0.3 The document has been restructured to make information easier to find.

16. January 2005. 1.0.4 The SQL create table definitions were updated.

2.2 References

IP SMS technology informationhttp://www.ozeki.hu/index.phtml?ow_page_number=263

UCP product informationhttp://www.ozeki.hu/index.phtml?ow_page_number=264

© Ozeki Informatics Ltd. 5 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

3 General overview

3.1 Introduction

If you plan to send or receive a larger number of SMS messages, it is worth to consider using the Internet. Over the Internet (or over a private IP network, such as a leased line), it is possible to connect directly to the GSM operator’s SMS Center (SMSC) Figure 1. The SMSC is responsible for receiving, storing and delivering the SMS messages in a GSM telephone network. The benefits of direct connection to this service are great:

A large number of messages can be sent of received in a short time.The sender phone number can be freely modified. The availability of the service can be monitored.

If you work with great volumes of messages, this solution is cheaper, faster and more reliable than the alternative solution of using a GSM handy connected to a computer.

Figure 1. – IP SMS Connection

3.2 What do you need to set up an IP SMS connection?

To set up a direct connection to the SMSC, first you should sign an agreement with the GSM provider to register for this service. They will tell you the prices and their technical team will give you information on which IP SMS protocol is required to connect to their system. The following IP SMS protocols are very common: UCP, SMPP, CIMD2. After the agreement is signed, the GSM provider will open their firewall, to allow your computer to use the service and will supply you with appropriate login information. To use the service you need a computer with a reliable Internet connection, running client software that can talk with the SMSC. OZEKI provides the required client IP SMS software implementing the above protocols.

3.3 How does OZEKI IP SMS software help?

With the help of OZEKI IP SMS software you can develop custom SMS messaging applications in a timely fashion. It prevents you from the time-consuming implementation of sophisticated low-level communication protocols (UCP, SMPP, CIMD2), that are used to set up and manage the link to the SMSC (The bearer protocol in all of these cases is TCP/IP). The software is a gateway that provides easy to use interfaces to send and receive SMS messages. The interfaces provided will fit into your programming environment. The next section gives you and idea on how you can send and receive SMS messages if you have OZEKI IP SMS software installed.

© Ozeki Informatics Ltd. 6 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

4 Getting started

4.1 System requirements for running the Ozeki SMS Server with an UCP

Operating System

Windows 2000, Xp, 2003Internet Explorer 6. (by reason for xml library)

Minimalhardware

Pentium III. 1GHz processor500Mb HDD256Mb RAM

Network connect

Public Internet or a leased line can be used. The bandwidth should have a minimum capacity of 128kbps in the link to the service provider.

Other Database server (MySql, PostgresSql, Sybase, Oracle, or other SQL based database server) is recommended

Software Ozeki IP SMS UCP installation Package (CD or downloaded file)

4.2 The most important features

- Delivery reports- Connection link management - Can be run as windows service - Creates a log files- SQL - SMS gateway- FILES - SMS gateway- HTTP- SMS gateway- IPC – SMS gateway for COM and SOAP/WSDL- Windows client connection

4.3 The package contains the following components

The message engine The main application that handles message queues, permissions and operates the drivers and plugins.

The UCP driver It connects to the SMSC (Short Message Service Center) of the GSM service provider through an IP connection.

SMS - SQL gateway Makes it possible to store the incoming messages a database table. Another table is used to send outgoing messages.

SMS – Files gateway It provides a way to send and receive short messages (SMS) by simply creating text files.

Windows client Provides a user interface for management and office use.

© Ozeki Informatics Ltd. 7 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

5 Technical information for the UCP protocol stack

This UCP protocol was designed to send and receive SMS messages. It communicates with the SMS Service Center (SMSC) of the GSM provider using asynchronous TCP / Sockets. In the UCP protocol, the user always identifies himself in a "login". A login ID does not have to be unique, but can be a commonly known name used in public services (like when using premium charge modem lines). GSM providers often restrict the client connection to one IP address, which means that the firewall of the provider only allows UCP connection from one IP address.

OZEKI SMS implements the UCP interface, that transfers messages between applications and the Short Message Service Center (SMS Center). UCP is version 2 of the Computer Interface to Message Distribution protocol. The UCP interface is suitable for client applications that send and retrieve messages over TCP/IP sockets.

An application is interconnected through the UCP connection to a SMS Center. The main purpose of this interconnection is to transfer messages from the applications to the mobile stations (MS) and from the MSs to the applications. Other kind of information can also be conveyed over the interconnection, for example, status reports from the GSM/GPRS network to the applications.

The system architecture discussed in this document thus consists of the application, Ozeki SMS and the SMS Center, and the purpose of this document is to specify the interface between the client application and Ozeki SMS.

When a message has been submitted, Ozeki SMS uses its own retry policy to attempt to deliver the message. If the delivery fails, the message is stored in the SMS Center database until a delivery attempt succeeds. If a permanent error occurs, or the validity period of themessage expires, the message is deleted.

In some cases the operator may want to restrict the use of some parameters in the UCP connection. In this case come of the features Ozeki SMS provides cannot function properly.

© Ozeki Informatics Ltd. 8 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

5.1 Architectural elements of Ozeki SMS

The Ozeki Message server is a multi-user message delivery engine, that can handle various different message types. To make the engine more efficient and the internal architecture has been designed using the following guidelines.

It uses an envelope system inside the new engine. This way it is able to handle various message types such as SMS, E-mail, MMS, Windows MSN messages, ICQ messages, etc. and future message types.

It has a multi-user architecture. Separate message queues and folders are set up for each user. The users cannot disturb each other, by taking up too much system resources. Security was improved and accounting was added, which helps cost control. Advanced link management. Often message transport is not reliable. For example the network link between the SMSC and the server can be broken or a GSM phone attached to the PC can stop responding after a certain amount of time. The new engine constantly monitors the transport links and it takes action if the link is broken. (It automatically reconnects if necessary and it notifies the administrator, etc)

Advanced message management. The engine tries to send a message several times before it marks it undeliverable. It handles delivery reports, and informs the users/plugins about change in message states. Old messages can be deleted or put in an archive folder automatically to manage disk space resources.

The GUI and the engine are two separate applications. The engine runs as a Windows service. The engine is a small and fast program. It does not spend time with GUI updates or other subsidiary tasks. The GUI communicates with the engine over HTTP, which enables remote configuration.

The drivers and plugins are placed into DLL-s. Context switching between different processes is slow, and memory requirements are high in a multiprocess messaging architecture. In our new messaging software all the functionality is executed into a single process and native DLL calls are used to communicate between the components and the engine. This is much faster then the previously used Microsoft COM/DCOM IPC communication. The drivers and plugins are running in separate threads instead of separate processes.

Run time configuration and component installations. The messaging service does not have to be stopped to change the configuration or to install/uninstall new drivers or plugins.

© Ozeki Informatics Ltd. 9 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

5.2 Ozeki SMS interfaces

The primary reason why software developers choose the Ozeki SMS software is because they want to save time and effort when implementing a messaging solution. Ozeki SMS is a reliable service that runs in the background and manages the IP link with service provider and makes sure all the messages are delivered. It provides easy to use interfaces for software developers the make development faster. Software developers can easily find a way to communicate with the Ozeki SMS application. There are several options, they can use. Please take a look at the alternatives.

5.2.1 SQL – SMS gateway

If you use the SQL-SMS gateway interface of Ozeki SMS, you can send and receive SMS messages with the help of SQL queries. To use this interface you need to have a database server (e.g.: Oracle, MSSql, MySql, PostgresSql, Sybase). The OZEKI SMS Software will connect to your database server and check a database table periodically for outgoing SMS messages. To send an SMS message, all you need to do is insert a record into the database table. If an SMS message is received another database table is used. The Ozeki software inserts the message to this database table.

5.2.2 FILE – SMS gateway

The FILE-SMS interface provides a way to send and receive short messages (SMS) by simply creating text files. To use this interface, two directories must be created: one for outgoing and one for incoming messages. The Ozeki SMS software will read the contents of the outgoing directory periodically. If it finds a text file containing a message it sends the message and deletes the file. For incoming a messages the other directory is used. If a message arrives a txt file is created in the incoming directory.

5.2.3 HTTP – SMS gateway

With the HTTP-SMS interface, standard HTTP requests (GET, POST) can be used to send and receive SMS messages. Ozeki SMS can operate in two modes if this interface is used. It can act as an HTTP server or as an HTTP client. If it is used as an HTTP server, the client application can make the HTTP queries to send and download the messages. In the client mode mode Ozeki SMS makes an HTTP request when an incoming message arrives.

5.2.4 IPC – SMS gateway (COM, SOAP)

Ozeki SMS can use various inter-process communication methods to send and receive SMS messages. The server provides a Common Object Model (COM) interface, which means that clients implementing this interface can attach to it to receive events and to be able to call procedures on the server. The Simple Object Access Protocol (SOAP) over HTTP can also be used. This protocol provides a standard web service interface for application developers. The features of this interface can be queried using the WSDL protocol.

© Ozeki Informatics Ltd. 10 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

6 Installation guide

Ozeki IP SMS UCP is a software-based solution for you to benefit from advanced communications functions with the help of a mobile phone. You can easily connect to SMSC for sending and receiving short messages (SMS). As soon as you connect to the SMSC, Ozeki IP SMS UCP enables you to send, receive and manage SMS messages in various ways. You can use the graphical user interface or one of the built-in plugins to handle the messages.

This guide describes you how to install the Ozeki IP SMS UCP software onto your PC and how to start using it.

6.1 Installation steps

During the installation, various selections can be made. You will find step-by-step information in the following section. If you want to quit the Setup program without installing or uninstalling, just click Cancel and the Exit Setup window will offer you the possibility of quitting the Setup program. Click Exit Setup to quit Setup. If you want to rerun Setup after having quit the installation before it had been completed, follow the installation steps normally as if you were installing the program for the first time.

6.2 Quick installation steps:

1. Exit all Windows programs.2. Insert the CD-ROM in the CD-ROM drive.3. Click the Windows START button.

4.Select the Run command. The Run dialog box appears on the screen. Type in the following command line: D:\setupIn the above command line, "D:\" is the CD-ROM drive

5. Click OK or press Enter. Wait while the system initializes Setup. The Welcome window of the Setup is then displayed.

6. Click Next to continue with Setup.

6.2.1 Step 1: Installing the application

The Ozeki IP SMS UCP installation is similar to any Windows applications. As a first step, you must exit all Windows applications. After having done it, locate the Setup.exe on the installation CD-ROM. If you have downloaded the application from the Internet, Setup.exe is in your download directory. Start Setup.exe by double-clicking on the icon and follow the instructions: 

© Ozeki Informatics Ltd. 11 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Click Next to start the Installation

Read the End User License agreement carefully. If you accept the agreement,select the I accept the agreement radio button and click on Next.

© Ozeki Informatics Ltd. 12 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Specify the directory you wish to use. Make sure you have at least 500 Megabytes of hard disk space available on the drive you have chosen.

Enter the name of the Start Menu Folder and click Next.

© Ozeki Informatics Ltd. 13 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

If you wish to have a desktop icon, place a checkmark into the appropriate checkbox.

Wait until the installation completes.

© Ozeki Informatics Ltd. 14 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

When the installation is finished, a shortcut can be found in the Windows Start menu. Use this shortcut to start the application.

© Ozeki Informatics Ltd. 15 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

6.2.2 Step 2 Configuring the application for UCP

OZEKI IP SMS can be configured to use the UCP protocol to connect to an SMSC over the Internet or other private TCP/IP network. Some mobile operators provide UCP connections for higher volumes of SMS traffic. In order to configure this connection you must perform the following steps:

After installation select the Preferences...  from the Server menu.  

When this menu item is selected, the Server Options form opens. As you can see on this form, by default a GSM Modem is installed. First you must uninstall it.

© Ozeki Informatics Ltd. 16 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Select the GSM Device1 in the Installed GSM phones box and click on the Uninstall button. When you uninstalled the GSM device successfully you can start to install the UCP connection.

© Ozeki Informatics Ltd. 17 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

  Select the UCP connection to the SMSC from the GSM Device for SMS messaging combo box and press Install button. In the Installed GSM phones box will appear the UCP connection 1.

© Ozeki Informatics Ltd. 18 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

After installing the UCP driver click on the Configure button to start the configuration. On the configuration screen you should provide the necessary login information to connect to the server.

© Ozeki Informatics Ltd. 19 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

When you fill in the Phone number text box you can modify the phone number to text. eg.: OZEKI

6.2.3 Step 3 Testing the connection

After finishing these settings close the UCP Connection 1 Configuration form by clicking on OK and start the SMS sending and receiving service by clicking on the "Start" button on the main screen of the application.If you select the Server Events folder on the left, you can see the startup message of the server. This message should be: "SERVER_STARTUP ok"

© Ozeki Informatics Ltd. 20 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Once the application is started you can view the UCP communication log by clicking on the UCP communication menu item in the Server menu. (This menu item becomes visible after you have installed the UCP driver)

© Ozeki Informatics Ltd. 21 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

6.2.4 Step 4 Sending your first SMS 

Once the application is installed and configured properly, you can send an SMS by clicking on the Create SMS icon. This brings up the SMS composer, where you can specify the phone numbers and the message text. Make sure you specify the phones numbers in international format. e.g.: +36209937723. When the message is written, you can send it by clicking on the Send button. 

Once you installed the application, you can configure plugins or you can start developing applications. Good luck!

© Ozeki Informatics Ltd. 22 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7 SMS SQL gateway

7.1 Send and Receive SMS messages with the help of a Database

If you use the Ozeki IP SMS UCP  you can send and receive SMS messages with a database query. In this case the Ozeki IP SMS UCP is connected to the selected database through a standard ODBC connection. The database can be Oracle, Access, MSSql or any other database engine that has an ODBC driver. Through this ODBC connection the Ozeki IP SMS UCP inserts the incoming messages into a database table and reads out the messages that should be sent from another table.

If you want to send and receive messages this way, first you should create two database tables: ozekismsout and ozekismsin. You can find the table definitions for these two tables at the following page: SQL Create Table Script (Ozeki IP SMS UCP)  

To send a message you should issue the following SQL statement:

sql> INSERT INTO ozekismsout (receiver,msg,id,status) VALUES ('+36203105366','test message',23,'send');

It is important to mention that the Ozeki IP SMS UCP identifies the messages by their ids. You must make sure that you specify a unique id for each message or you should use auto_increment columns.

The incoming messages are placed into the ozekismsin table. You can see the create definition for this table at the url above as well. To view the incoming messages you can use the select statement.

sql> SELECT sender,msg,receivedtime FROM ozekismsin;+--------------+--------------+-------------------+| sender | msg | receivedtime |+--------------+--------------+-------------------+| +36203105366 | test message | 01/11/03 08:43:32 |+--------------+--------------+-------------------+1 row in set (0.00 sec)

© Ozeki Informatics Ltd. 23 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

It is interesting that often, without any external application, you can create powerful SMS enabled solutions. You can do this with the help of database triggers. Here is an example:

Autoreply function with a Microsoft SQL Server:

CREATE TRIGGER autoreply ON ozekismsin FOR INSERTASDECLARE @tel VARCHAR(30)SELECT TOP 1 @tel=sender FROM ozekismsin ORDER BY ID DESCINSERT INTO ozekismsout (receiver,msg,status) VALUES (@tel,'Thank you for the message','send')GO

7.2 SQL table definitions for sending and receiving messages with OZEKI IP SMS UCP

You can use any database with an ODBC driver. All you have to do is create two database tables: ozekismsin and ozekismsout. (The tables can have additional columns.) The Ozeki IP SMS UCP will insert the incoming messages to the ozekismsin table. If you want to send a message, you should insert a record into the ozekismsout table. The Ozeki IP SMS UCP checks this table periodically for messages to send. 

7.2.1 Microsoft SQL Server

CREATE TABLE ozekismsin ( id int IDENTITY(1,1), sender varchar(30), receiver varchar(30), msg varchar(160), senttime varchar(100), receivedtime varchar(100), operator varchar(100));

CREATE TABLE ozekismsout ( id int IDENTITY(1,1), sender varchar(30), receiver varchar(30), msg varchar(160), senttime varchar(100), receivedtime varchar(100), reference varchar(100), status varchar(20), operator varchar(100));

Example for sending a message:insert into ozekismsout (receiver,msg,status) values ('+36209937723','test','send');

© Ozeki Informatics Ltd. 24 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Tips: You can create autoreply function with database triggers

CREATE TRIGGER autoreplyON ozekismsinFOR INSERTAS DECLARE @tel VARCHAR(30) SELECT TOP 1 @tel=sender FROM ozekismsin ORDER BY ID DESC INSERT INTO ozekismsout (receiver,msg,status) VALUES (@tel,'Thank you for the message','send')GO

7.2.2 MySQL

CREATE TABLE ozekismsin ( id int(11) NOT NULL auto_increment, sender varchar(30) default NULL, receiver varchar(30) default NULL, msg varchar(160) default NULL, senttime varchar(100) default NULL, receivedtime varchar(100) default NULL, operator varchar(100), PRIMARY KEY (id));

CREATE TABLE ozekismsout ( id int(11) NOT NULL auto_increment, sender varchar(30) default NULL, receiver varchar(30) 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, operator varchar(100), PRIMARY KEY (id));

Note: MySQL ODBC drivers can be downloaded from: www.mysql.com

7.2.3 Interbase

Installation instructions for Interbase: http://www.ozeki.hu/index.phtml?ow_page_number=177

CREATE TABLE ozekismsout (  id int NOT NULL,  sender varchar(30),  receiver varchar(30),

© Ozeki Informatics Ltd. 25 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

  msg varchar(160),  senttime varchar(100),  receivedtime varchar(100),  reference varchar(100),  operator varchar(120) default NULL,  status varchar(20),  PRIMARY KEY (id));

CREATE GENERATOR sms_id;CREATE TRIGGER set_id FOR ozekismsoutBEFORE INSERT AS   BEGIN   New.id = gen_id(sms_id,1);   END;

CREATE TABLE ozekismsin (  id int NOT NULL,  sender varchar(30),  receiver varchar(30),  msg varchar(160),  operator varchar(120) default NULL,  senttime varchar(100),  receivedtime varchar(100),  PRIMARY KEY (id));

CREATE GENERATOR sms_id_;CREATE TRIGGER set_id_ FOR ozekismsinBEFORE INSERT AS   BEGIN   New.id = gen_id(sms_id_,1);   END;

insert into ozekismsout (receiver,msg,status) values ('+36209937723','Hello world','send');

 

7.2.4 Oracle 

CREATE TABLE ozekismsin (  id int,  sender varchar(30) default NULL,  receiver varchar(30) default NULL,  msg varchar(160) default NULL,  operator varchar(120) default NULL,  senttime varchar(100) default NULL,  receivedtime varchar(100) default NULL);

CREATE SEQUENCE X;CREATE TRIGGER ozekismsin_auto BEFORE INSERT on ozekismsinfor each rowwhen (new.id is null)begin   SELECT x.nextval INTO :new.id FROM DUAL;

© Ozeki Informatics Ltd. 26 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

end;/

CREATE TABLE ozekismsout (  id int,  sender varchar(30) default NULL,  receiver varchar(30) default NULL,  msg varchar(160) default NULL,  senttime varchar(100) default NULL,  receivedtime varchar(100) default NULL,  operator varchar(120) default NULL,  reference varchar(100) default NULL,  status varchar(20) default NULL);

CREATE SEQUENCE Y;CREATE TRIGGER ozekismsout_auto BEFORE INSERT on ozekismsoutfor each rowwhen (new.id is null)begin   SELECT y.nextval INTO :new.id FROM DUAL;end;/

Example for sending a message:insert into ozekismsout (receiver,msg,status) values ('+36209937723','test','send');

7.2.5 PostgresSQL 

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

CREATE TABLE ozekismsout (  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)); 

© Ozeki Informatics Ltd. 27 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.3 Configuring Ozeki SMS database connection

Once you have your database tables created, Ozeki SMS must be configured to connect to your database server and to use the tables. In order to achieve this please click on Database Configuration from the Plugins menu.

\

This will bring up a form, that makes it possible to build and test the database connection link. On this form, you have an option to modify the SQL templates.

© Ozeki Informatics Ltd. 28 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.4 Installing and Configuring MySQL for OZEKI IP SMS UCPOn this page I explain how I have installed and set up MySQL to accept incoming SMS messages and to transmit outgoing SMS messages.

7.4.1 Download and Installation of MySQL Server

I have downloaded the MySql Server installation packages fromhttp://www.mysql.com/downloads/index.html. In my installation I am working on a Windows 2000 Server, so I have selected the appropriate packages:

© Ozeki Informatics Ltd. 29 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

The downloaded file was: mysql-4.018-win.zip:

After unpacking the ZIP file, I have installed the MySql server to the C:\MySql directory with Typical settings.

© Ozeki Informatics Ltd. 30 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.4.2 Starting MySql and creating the database structure

After downloading the server I have started it by executing the winmysqladmin.exe file from the C:\mysql\bin directory. It prompted me for a user name and a password. I have entered root and 123

© Ozeki Informatics Ltd. 31 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

After this had been done I have rebooted my computer to make sure the installation has been completed (This is not necessary)

To create the database layout I had to open the MySql console. This was done by clicking on Start, selecting run and entering cmd in the Run window. The cmd application is a command shell. In this command shell, I have changed to the mysql bin directory and connected to the service by issuing the following command:

mysql -h 127.0.0.1 -P 3306 -u root test

 

© Ozeki Informatics Ltd. 32 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

The above command opened a connection to the test database. At this MySql prompt I was able to create two database tables: ozekismsout and ozekismin. These two tables can be used for storing incoming and outgoing SMS messages. The table structure for these tables can be found at the following URL:http://www.ozeki.hu/index.phtml?ow_page_number=324

Here is how I did it: I went to the website, copied the text to my clipboard then pasted it into the MySql prompt:

© Ozeki Informatics Ltd. 33 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

After having done this, I have exited from the MySql prompt by typing exit.

7.4.3 Installing the MySql ODBC driver

After the MySql server had been installed and the database was created, I had to install the MyODBC driver to make sure Ozeki IP SMS UCP can access the database. The installation of this driver can be read on the following webpage.... Installing MyODBC

7.4.4 Installing MyODBC to connect MySQL and Ozeki SMS

On this page I explain how to install MyODBC, and how it should be configured in order to access Ozeki IP SMS UCP.

7.4.5 Download MyODBC from www.mysql.com

© Ozeki Informatics Ltd. 34 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

The MySQL ODBC driver can be found in the Application Programming Interfaces section of the MySql website.

Install and download the MyODBC-3.51.06.exe file or if there is a newer version, you might want to use that one.

© Ozeki Informatics Ltd. 35 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.4.6 Installing MyODBC

After having downloaded the file all you need is install it by clicking on 'Next'

7.4.7 Verify the installation

The installation can be verified by creating a data source in the ODBC administrator. To open the ODBC Administrator you need to open "Administrative Tools" from your control panel and you should click on the "Data Sources" icon. This will start the ODBC Administrator. In © Ozeki Informatics Ltd. 36 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

order to create a new data source you must click on Add. The Create New Data Source form lists all the available drivers. Here the MySql driver has to be selected.

Note: In some systems the MySQL ODBC 3.51 driver will not work. In these systems MySQL ODBC v 2.5 can be used. Once the driver is selected, the appropriate data should be entered into the data source creation form:

© Ozeki Informatics Ltd. 37 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.4.8 Installing Ozeki IP SMS UCP Service

After the MyODBC driver was configured, you need to set up the Ozeki IP SMS UCP.

7.5 Installing MyODBC to connect PostgreSql Database and Ozeki IP SMS UCP

This page gives an overview on how to configure an ODBC connection to the PostgreSql Database server. Once the connection is configured, you can send or receive SMS messages using SQL queries. 

Step 1 

Install OZEKI IP SMS UCP for Windows

Step 2

Download and install the PostgreSql ODBC driver. This driver can be found at http://www.postgresql.org or from this location: psqlodbc-07_03_0200.zip

© Ozeki Informatics Ltd. 38 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Step 3 Open the Windows Control Panel from the START menu.

Step 4 Select administrative tools and click on ODBC Data Sources.

Step 5 In the ODBC data sources form click on Add

 

© Ozeki Informatics Ltd. 39 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Step 6 In the ODBC data sources form click on Add

© Ozeki Informatics Ltd. 40 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Step 7 Select the PostgreSQL driver and click on Finish

Step 8 Fill in the connection information

Step 9 Open OZEKI IP SMS UCP and install the Database plugin from the Plugins menu.

© Ozeki Informatics Ltd. 41 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Step 10 Configure the database plugin by selecting it and clicking on Configure.

© Ozeki Informatics Ltd. 42 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Step 11 Click on the Build database connection button.

© Ozeki Informatics Ltd. 43 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Step 12Select Microsoft OLE DB Provider for ODBC Drivers.

© Ozeki Informatics Ltd. 44 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Step 13 Select the PostgreSQL30 database name.

© Ozeki Informatics Ltd. 45 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Step 14Click on OK to finish the procedure.

7.6 Send and Receive SMS messages from Microsoft Access In this step-by-step tutorial we explain how to create an Access application, which is capable of sending and receiving SMS messages. In order to use this tutorial, you need an installed copy of OZEKI IP SMS UCP and MICROSOFT ACCESS. 

7.6.1 Create an Access database

First you must create a database. You can give it any name. In this example we named it ozeki . In this database you need to create two tables. One of these tables is going to be

© Ozeki Informatics Ltd. 46 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

used for sending SMS messages while the other is going to be used for receiving. It is important that the table used for sending messages is named ozekismsout and the table used for receiving messages is named ozekismsin. The columns in the tables should be created as presented on the following screenshot. You can add additional columns to both tables, but you cannot change the name of the columns used for sms sending and receiving. You can download this database in Access 97 format from here: ozeki.mdb. If you use Access 2000, you need to convert this mdb file to Access 2000 format. 

© Ozeki Informatics Ltd. 47 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

© Ozeki Informatics Ltd. 48 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.6.2 Create an ODBC Connection

This connection will be used by the Ozeki IP SMS UCP to insert incoming messages into your Access database and to search for outgoing messages in it. The ODBC connection can be created on the ODBC administrator available in the control panel. 

After the ODBC administrator has started you can create the connection in 4 simple steps:

© Ozeki Informatics Ltd. 49 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.6.3 Configure OZEKI IP SMS UCP to use your newly created ODBC connection

This can be done by opening the Preferences form from the Ozeki IP SMS UCP menu. When the form is open, select the database tab and Build database connection string.

© Ozeki Informatics Ltd. 50 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Open OZEKI IP SMS and install the Database plugin from the Plugins menu.

© Ozeki Informatics Ltd. 51 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Configure the database plugin  by selecting it and clicking on Configure.

© Ozeki Informatics Ltd. 52 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

To build the ODBC connection string you must select the Microsoft OLE DB Provider for ODBC Drivers and you must select the connection you have created in the ODBC administrator.

© Ozeki Informatics Ltd. 53 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

7.6.4 Start the Ozeki IP SMS UCP and send/receive SMS messages from MS Access

After you are done with the above mentioned configuration, you can start the Ozeki IP SMS UCP by clicking on the START button. 

© Ozeki Informatics Ltd. 54 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

When the server is starts, go to Access and send a message, by inserting a new record into the ozekismsout table. You must specify the receiver, enter the message in the msg field and set the status to send! (The incoming SMS messages will appear in the ozekismsin table.)  

© Ozeki Informatics Ltd. 55 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

Important:New versions of OZEKI IP SMS UCP allow you to control the SQL queries used to access the data in your Access database. In these versions, you must modify these queries to make things work. Here is what you should do:

Remove the apostrophe around the word $id. ('$id' should be changed to $id)

Here is what you should get after modifying the SQL statements:

© Ozeki Informatics Ltd. 56 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

(This form can be accessed from Ozeki IP SMS UCP after installing the Database Plugin and clicking on the Plugins / Database Configuration menu item)

© Ozeki Informatics Ltd. 57 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

You can follow the database events. The unprocessed queries can be deleted.

7.6.5 SQL Problem with quotes

If you experience the problem, that sometimes your messages are not inserted into the database please read the following.

When a message is received, an SQL string is composed, then it is passed to the database server. The SQL string composition is based on an SQL template defined in the Database Settings form. If an incoming message contains an apostrophe (') or a quotation mark ("), the SQL statement becomes invalid when the message text is inserted into the template.

Our software provides a mechanism to replace the apostrophe (') and the quotation mark (") in the received message before it is inserted into the SQL template. On the Database settings form you can specify what character sequence should be used instead of these characters.

Note: On Sybase, MSSql and on MySql, you should substitute the apostrophe (') with two apostrophes ('') and you should do the same for quotation marks.  

© Ozeki Informatics Ltd. 58 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

© Ozeki Informatics Ltd. 59 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

8 FILE-SMS Gateway

This will help you install File2SMS Gateway onto Ozeki IP SMS. The program enables you to send and receive SMS by creating files.

8.1 Installation and configuration

1. Create the following folders (for sending messages we’ll use the Out folder)

 

2. Install the File2SMS Gateway.

3. Select Install plugins from Plugins menu to get the following window

© Ozeki Informatics Ltd. 60 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

4. You can select the specific plugin needed for file communications by clicking on Plugins tab, in the Server options window. Select File2sms from the combo-box menu and click on Install button

© Ozeki Informatics Ltd. 61 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

5. After finishing the installation you can open the setup page by clicking on the Configure button.

© Ozeki Informatics Ltd. 62 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

6. Set up the created folders

Select the Verbouse radio button and checkmark Use files for receiving/sending SMS messages checkboxes at the foot of the page. Click on Ok button to leave the page then click on Start button at the main display in order to start the program

OZEKI SMS empowers you to send and receive SMS from a personal computer through a GSM device attached to the computer. The sending task could be performed by placing txt files into a certain directory. Receiving can be done by reading txt files from another directory in the file system.

If you want to send and receive SMS this way, you should configure the OZEKI SMS Server to place the incoming messages into the selected directory and to check another directory periodically for messages to send. The directory we use for receiving messages is called the incoming directory, the one we use for sending messages is called the outgoing directory. 

© Ozeki Informatics Ltd. 63 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

8.2 File formats

When the directory settings are configured, an appropriate txt file format should be selected. The OZEKI SMS Server supports three kinds of file formats. You should select the one that fits your needs the most. The three supported formats are: simple, verbouse and list.

8.2.1 The simple file format 

When you select the simple file format, each incoming message is saved in a separate file. The name of the file is the phone number and the first row of the file contains the message. (Figure 1.)

 c:\smsout\+36203105366 Hello world

Figure 1.

If you want to send messages using the simple file format, you should create a separate text file for each outgoing message and place these files into the smsout directory.

8.2.2 The verbouse file format

The verbouse file format is similar to the simple file format in a way that each message resides in a separate file. The difference is that it contains more detailed information about the SMS messages. The main advantage of this file format is that more than one message could be placed into the same directory with the same destination.

If you want to send messages using this format, make sure that the extension of the file name that is placed into the outgoing directory is .sms and the file format is the following:

The first row of the file is the sender's phone number, the second row contains receiver phone number and the message text follows these in the next row. Take a look at the example: 

c:\smsout\anyname.sms +36203105366+36209937723The message text

8.2.3 The list file format

The list file format is a convenient way to send and receive a large number of SMS messages. In this case more than one message is stored in the same file. The format of the file can be seen below.

For outgoing messages you should create a text file, where each line contains a message. The messages consist of a phone number in international format and the message text. The

© Ozeki Informatics Ltd. 64 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

phone number and the message text is separated by a space character. When an outgoing file is ready to be sent it should be placed into the smsout directory. The name of the file should have the .sml extension. (sml stands for SMS list)

c:\smsout\list.sml+36205555366 This a message+36209937723 This is another message+36307789723 Use the OZEKI IP SMS

8.2.4 Configuring the drictory locations

In order to configure the OZEKI IP SMS to use the directories and the file format you selected, you should install the file sms gateway plugin. This can be done by opening the Plugins menu and selecting the Install plugins option.

When the plugin is installed, you can configure it by clicking on the Configure button. On the File configuration form you should select the directories for sending and receiving the messages. You can select how often the server should check the outgoing directory and you can specify which file format you would like to use.

Before entering the paths on this form make sure the selected directories exist.

© Ozeki Informatics Ltd. 65 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

After you are done with all these settings, SMS sending and receiving through files can be enabled by selecting the appropriate checkboxes.

© Ozeki Informatics Ltd. 66 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

9 HTTP SMS gateway

9.1 Installation

Web applications communicate with the user with HTML forms. When a user wants to send information to the server, he fills out a form. The HTTP-SMS client plugin does the same. It fills out a form automatically every time an SMS message is received. The receiving web application can return a response SMS message after processing the received data. 

To use the features of the HTTP client plugin, you need to install it first then you need to configure it. In order to perform the installation, please click on the "Install plugins" menu item.

© Ozeki Informatics Ltd. 67 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

After the plugin has been installed you can configure it by selecting the newly created menu item: "HTTP Client Configuration". On the configuration form, you can enter the HTTP URL that will be called when an incoming message arrives. If this URL starts with https://, the communication between Ozeki SMS and your web server will be encripted.

After the configuration is done you can create a server side application on your web server to handle the incoming messages. You can find two examples for such applications on this page:

9.2 Example client applications

9.2.1 PHP EXAMPLE

http://localhost/smsproc.php<?php  $sender       = $_REQUEST['sender'] ;  $receiver     = $_REQUEST['receiver'];  $message      = $_REQUEST['msg'];  $receivedtime = $_REQUEST['recvtime'];

  /* do some processing here */  if ($fp = fopen("smslog.txt","a")) {     fwrite($fp,"$receivedtime $sender $receiver $message\n");     fclose($fp);

© Ozeki Informatics Ltd. 68 (69)Ozeki Proprietary and Confidential

Ozeki IP SMS UCP

  }

  /* return a response SMS */  print "{GSMSMS}{}{}{".$sender."}{Thank you for your SMS! WWW.OZEKI.HU}\n";  /* send the message to another phone */  print "{GSMSMS}{}{}{+36205552245}{".$sender." ".$message."}\n";?>

9.2.2 ASP EXAMPLE

http://localhost/smsproc.asp<%    Dim strMsg    Dim strSender

    ' Retrieve the posted items from the HTTP-SMS gateway    strMsg = Request.Form("msg")    strSender = Request.Form("sender")    strReceiver = Request.Form("receiver")    strTime = Request.Form("recvtime")

    ' Do some processing here

    'Return a response SMS    Response.Write("{GSMSMS}{}{}{" & strSender & "}{Thank you for your SMS!}"& chr(13))        'send the message to another phone     Response.Write("{GSMSMS}{}{}{+36209937723}{" & strMsg & "}"& chr(13))%>

© Ozeki Informatics Ltd. 69 (69)Ozeki Proprietary and Confidential