Вы находитесь на странице: 1из 25

Jernas Solutions

Ozeki NG SMS Gateway:


Development Overview
Presented by: Milen Nikolov
Manager, Products & Services

A subsidiary of International Development Company [IDC] http://www.idcuae.com

The Big Picture


OzekiNG SMS Gateway
Service Provider/SMSC

SMTP/PO
P3

E-mail
Servers

Queue

API
HTTP
Adaptor
s
methods

Encapsula
tor

Sendmail,
Qmail, MS
Exchange,
etc

Applicati
ons

C+
+,C#,ASP,P
HP, AJAX,

SQL
queries

TEXT
Files

Databas
es
Oracle,
MSSQL,
Sybase,

Users and Applications


User Type
Standard user

Description

E-mail user

Automated user, implementing two-way SMS/E-mail


gateway service using POP3 and SMTP

Autoreply
user
SMPP user

A user for automatic reply and message routing


based on sender address or message content

User account for accessing the OzekiNG


management interface or for sending/receiving SMS
messages using the built-in web interface

This user account enables other devices to connect


to the OzekiNG, turning the software into a SMSC

Database user A user account that periodically polls a database for


incoming/outgoing messages
File user
A user account that processes text files as means
for sending and receiving messages
HTTP Client
A translator, converting mobile communication into
user
HTTP GET and HTTP POST methods.

OzekiNG and Databases

Send and receive messages using SQL queries


Supports a variety of databases
MS SQL, Sybase, Oracle
[ODBC]

[ADO/OLEDB];

MySQL, Postgre

And almost anything that does ADO and ODBC

OzekiNG + Databases
Quickstart
Requirements
Two database tables: ozekimessageout and
ozekimessagein
A database user account and a connector
ADO]

[ODBC or

Incoming Messages: Table


Fields
Field
id
sender
receiver

Description

Example
1, 2, 3, ...

This distinguishes incoming messages


from each other. Every id has to be
different.
This is the phone number of the sender of +36441234567,
the message.
06459876543
This is the phone number of the recipient
of the message.

+36441234567,
06459876543
This is the text of the message.
msg
This is a message
text.
This is the time of sending the message.
senttime
2007-04-23
10:02:13
receivedti This is the time of receiving the message. 2007-04-23
me
10:02:13
This denotes which service provider
operator
Vodafone1
msgtype

connection was used to receive the


message.
This denotes the type of the message.

SMS:TEXT,

Outgoing Messages: Table


Fields

Column
name

Description

Example

id

This distinguishes outgoing messages from


each other. Every id has to be different

1, 2, 3, ...

sender

This is the phone number of the sender of the


message

+36441234567,
06459876543

receiver

This is the phone number of the recipient of


the message

+36441234567,
06459876543

msg

This is the text of the message

This is a message text.

senttime

This is the time of sending the message

2007-04-23 10:02:13

receivedti
me

This is the time of receiving the message

2007-04-23 10:02:13

operator

This denotes which service provider connection


is to be used to send out the message. The
default is ANY

ANY; Vodafone1

msgtype

This denotes the type of the message, default


SMS:TEXT

SMS:TEXT,
SMS:WAPPUSH,

This denotes the status of the message.

send, sending, sent,


notsent, delivered,
undelivered

status

Message Status Field


Status

Description

send

The message has been inserted into the database


table (ozekimessageout), but not yet processed by
Ozeki NG. This is the status to be specified when
inserting a new message.

sending

The message has been processed by Ozeki NG, and


inserted into the Database user's Outbox folder, where
it is waiting to be sent out.

sent

The message has been sent out to the SMS Center of a


specified service provider, which has accepted the
message for delivery.

notsent

The message has not been sent out to the SMS Center
of a specified service provider. Some error has caused
the sending to fail.

delivered

The specified service provider has reported that the


message has been delivered to the recipient.

undelivere

The specified service provider has reported that the

Status Update Process Flow

Creating OzekiNG Tables


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

CREATE TABLE
ozekimessageout (
id int IDENTITY (1,1),
sender varchar(30),
receiver varchar(30),
msg varchar(160),
senttime varchar(100),

receivedtime
varchar(100),
operator varchar(100),
msgtype varchar(30),
reference varchar(30),
status varchar(30),
errormsg varchar(250)
);

You can optionally create an index in the database for the 'id' field
of the outgoing SMS table to support SQL updates.

Creating a Database User

Creating a Database User

Configuring the Connector

Configure Logging

Monitoring Events

Sending a Message
insert into ozekimessageout (receiver,msg,status)
values ("+97150XXXXXXX","Hello world","Send");

SMS Scheduled Sending

USING THE HTTP API


How to send SMS messages using ASP,ASP .NET, C# and
other languages

HTTP API: The Idea


OzekiNG SMS Gateway
Service Provider/SMSC

Queue

Encapsula
tor

WWW
Server

HTTP
POST

Applicatio
n

C+
+,C#,ASP,P
HP, AJAX,

http://127.0.0.1:9501/ozeki?action=SendMessage&username=user&passw
recipient=050XXXXXXX&messageData=hello

HTTP Fields
Parameter

Description

Values

Example

action

Mandatory field,
specifying the API
command

sendMessage

action=sendMessage

originator

Optional field.
Specifies the sender
identity/number, URL
encoded

An alphanumeric
sender address, or
telephone number.
Encoded in UTF8

originator=
%2B36201112222

recipient

Mandatory field,
specifying the
recipient phone
number. Must be URL
encoded

Comma separated
telephone numbers in
local or international
number format

recipient=
%2B36201234567

messageTy
pe

Optional field, defining


the type of SMS
message

There are more than


20 possible message
types

messageType=SMS:T
EXT

messageDa
ta

Specifies the text or


the data of the SMS
message. Mandatory

The value must be


encoded in UTF8 and
must be URL encoded

messageData=Hello+
World

_charset_

Specifies the charset


of the encoded data
(if not specified UTF-8

utf-8
windows-1250
iso-8859-1

_charset_=iso-8859-2

Using HTTP Forms to Send


SMS
<form action="http://127.0.0.1:9501/ozeki" method="GET">
<input type="hidden" name="_charset_">
<input type="hidden" name="action" value='sendMessage'>
<input type="hidden" name="username"
value=yourusername">
<input type="hidden" name="password" value=yourpassword">
<input type="hidden" name="messageType" value='SMS:TEXT'>
<table> <tr><td>Recipient</td>
<td><input type="text" name="recepient"></td></tr>
<tr><td>Message</td>
<td><textarea name="messageData" rows=5
cols=40></textarea></td></tr> <tr><td></td>
<td><input type="submit" value=" OK "></td></tr> </table>
</form>

ASP? S is for Simplicity


<%
Dim strMsg
Dim strReceiver
Dim strUrl
' Retrieve the posted items from the HTTP-SMS
GW
strUrl = http://localhost:9501/ozeki?
strRequest = "username=youruser";
strRequest = strRequest+"&password=p4$
$wd";
strRequest =
strRequest+"&action=sendMessage";
strRequest =
strRequest+"&messageType=SMS:TEXT";
strRequest =
strRequest+"&recipient="+Server.URLEncod
e("+97150XXXXXXX");
strRequest =
strRequest+"&messageData="+Server.URLE
ncode("Hello World");

strUrl = strUrl+strRequest;
'Create InternetExplorer
Dim WebBrowser: Set
WebBrowser =
CreateObject("InternetExplorer.Appli
cation")

WebBrowser.Navigate strUrl
Do While WebBrowser.busy
Loop
WebBrowser.Quit
'Display message info to the user
Response.Write("The message
has been sent. "+ chr(13))
%>

Q&A
Can we send the same message to multiple
phone numbers?

Comma separated list of the phone numbers to be


used, i.e. string smsRecipients = HttpUtility.UrlEncode (+971050XXXX,
+97150YYYY");

Is it possible to run the code on a different


server?
Certainly, simply set the correct URL and port number
of the OzekiNG server in your application.
WARNING! Security measures have to be in place
ACL, firewalling, strong passwords, VPN.

Can we change sender identity?


Required: IP SMS connectivity, service provider-set
Sender ID
Use the originator field in the API, i.e. string
smsOriginator = HttpUtility.UrlEncode(Dental Clinic");

Other Languages and


Methods
Developers Guide at
http://www.ozekisms.com
ASP.NET, C#, PHP, AJAX,
SQL
Examples and source code
Sending and receiving SMS
Different types of messages
Application ports for J2ME
developers

THANK YOU
For more information:
Milen Nikolov, milen@jernas.org
+971 50 6823400 or +971 2 6418533

Вам также может понравиться