970e4c590c5920f000ac40a36f9376d8.ppt
- Количество слайдов: 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 Ozeki. NG SMS Gateway Queue Service Provider/SMSC API Adaptors Encapsulator SMTP/POP 3 E-mail Servers HTTP methods Applications C++, C#, ASP, PHP, AJAX, … SQL queries Databases Sendmail, Qmail, MS Exchange, etc TEXT Files Oracle, MSSQL, Sybase, Postgre, My. SQL, etc
Users and Applications User Type Description Standard user User account for accessing the Ozeki. NG management interface or for sending/receiving SMS messages using the built-in web interface E-mail user Automated user, implementing two-way SMS/E-mail gateway service using POP 3 and SMTP Autoreply user A user for automatic reply and message routing based on sender address or message content SMPP user This user account enables other devices to connect to the Ozeki. NG, 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 user A translator, converting mobile communication into HTTP GET and HTTP POST methods.
Ozeki. NG and Databases • Send and receive messages using SQL queries – Supports a variety of databases • MS SQL, Sybase, Oracle [ADO/OLEDB]; My. SQL, Postgre [ODBC] • And almost anything that does ADO and ODBC
Ozeki. NG + Databases Quickstart • Requirements – Two database tables: ozekimessageout and ozekimessagein – A database user account and a connector [ODBC or ADO] Create the database tables and a user account for accessing them [SQL Server] Install and configure the database user account [Ozeki. NG] Setup logging and configure log behavior
Incoming Messages: Table Fields Field Description Example id This distinguishes incoming messages from each other. Every id has to be different. This is the phone number of the sender of the message. 1, 2, 3, . . . sender receiver This is the phone number of the recipient of the message. msg This is the text of the message. +36441234567, 06459876543 This is a message text. senttime This is the time of sending the message. 2007 -04 -23 10: 02: 13 receivedtime This is the time of receiving the message. 2007 -04 -23 10: 02: 13 operator This denotes which service provider connection was Vodafone 1 used to receive the message. This denotes the type of the message. SMS: TEXT, msgtype SMS: WAPPUSH, . . .
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 receivedtime 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; Vodafone 1 msgtype This denotes the type of the message, default SMS: TEXT, SMS: WAPPUSH, … status This denotes the status of the message. send, sending, sent, notsent, delivered, undelivered
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. undelivered The specified service provider has reported that the delivery of the message to the recipient has failed.
Status Update Process Flow
Creating Ozeki. NG 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), ); 1 • 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 2
Creating a Database User 2
Configuring the Connector 3
Configure Logging 4
Monitoring Events 5
Sending a Message • insert into ozekimessageout (receiver, msg, status) values ("+97150 XXXXXXX", "Hello world", "Send"); 6
SMS Scheduled Sending Add a field to the database • alter table ozekimessageout add column scheduledtime Configure the database user to poll the field • Open "SQL for Sending" tab of the SQL user configuration form and changing the "Polling" query to add “and scheduledtime>now()”
USING THE HTTP API How to send SMS messages using ASP, ASP. NET, C# and other languages
HTTP API: The Idea Ozeki. NG SMS Gateway Service Provider/SMSC Queue Encapsulator WWW Server HTTP POST Application C++, C#, ASP, PHP, AJAX, … http: //127. 0. 0. 1: 9501/ozeki? action=Send. Message&username=user&password=pass& recipient=050 XXXXXXX&message. Data=hello
HTTP Fields Parameter Description Values Example action Mandatory field, specifying the API command send. Message action=send. Message originator Optional field. Specifies the sender identity/number, URL encoded An alphanumeric sender address, or telephone number. Encoded in UTF 8 originator=%2 B 362011122 22 recipient Mandatory field, specifying Comma separated recipient=%2 B 3620123456 the recipient phone number. telephone numbers in local 7 Must be URL encoded or international number format message. Type Optional field, defining the type of SMS message There are more than 20 possible message types message. Data Specifies the text or the data of the SMS message. Mandatory The value must be encoded message. Data=Hello+World in UTF 8 and must be URL encoded _charset_ Specifies the charset of the encoded data (if not specified UTF-8 will be assumed). Optional. utf-8 windows-1250 iso-8859 -1 iso-8859 -2 _charset_=iso-8859 -2 service. Provider The name of the service provider connection to use Must match the string from the configuration service. Provider=Etisalat message. Type=SMS: TEXT
" src="https://present5.com/presentation/970e4c590c5920f000ac40a36f9376d8/image-21.jpg" alt="Using HTTP Forms to Send SMS
ASP? “S” is for “Simplicity” <% Dim str. Msg Dim str. Receiver Dim str. Url ' Retrieve the posted items from the HTTP-SMS GW str. Url = http: //localhost: 9501/ozeki? str. Request = "username=youruser"; str. Request = str. Request+"&password=p 4$$wd"; str. Request = str. Request+"&action=send. Message"; str. Request = str. Request+"&message. Type=SMS: TEXT"; str. Request = str. Request+"&recipient="+Server. URLEncode("+971 50 XXXXXXX"); str. Request = str. Request+"&message. Data="+Server. URLEncode(" Hello World"); str. Url = str. Url+str. Request; 'Create Internet. Explorer Dim Web. Browser: Set Web. Browser = Create. Object("Internet. Explorer. Application") Web. Browser. Navigate str. Url Do While Web. Browser. busy Loop Web. Browser. 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 sms. Recipients = Http. Utility. Url. Encode (“+971050 XXXX, +97150 YYYY"); • Is it possible to run the code on a different server? – Certainly, simply set the correct URL and port number of the Ozeki. NG 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 sms. Originator = Http. Utility. Url. Encode(“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 J 2 ME developers
THANK YOU For more information: Milen Nikolov, milen@jernas. org +971 50 6823400 or +971 2 6418533