Ozeki NG SMS Gateway logo OZEKI NG SMS Gateway
"The World's most reliable SMS gateway software!"
info@ozekisms.com
Tel.: +36 1 371 0150
SMS Gateway to send SMS via GSM modem or IP SMS connection Overview SMS Gateway to send SMS via GSM modem or IP SMS connection SMS Gateway to send SMS via GSM modem or IP SMS connection Quick start SMS Gateway to send SMS via GSM modem or IP SMS connection SMS Gateway to send SMS via GSM modem or IP SMS connection Download SMS Gateway to send SMS via GSM modem or IP SMS connection SMS Gateway to send SMS via GSM modem or IP SMS connection Manual SMS Gateway to send SMS via GSM modem or IP SMS connection SMS Gateway to send SMS via GSM modem or IP SMS connection How to buy SMS Gateway to send SMS via GSM modem or IP SMS connection SMS Gateway to send SMS via GSM modem or IP SMS connection FAQ SMS Gateway to send SMS via GSM modem or IP SMS connection SMS Gateway to send SMS via GSM modem or IP SMS connection Contact Us SMS Gateway to send SMS via GSM modem or IP SMS connection
OZEKI NG SMS Gateway - Product Guide

Oracle script Contents | SearchSMS Service Provider

Home > Product Manual > Examples and Solutions > SQL SMS Gateway > Recipient list

SMS Gateway SMS Gateway Home

  Product Manual
  Introduction
  SMS technology
  Installation Guide
  User Guide
  Developers Guide
  Examples and Solutions
  Telephone networks
  SMS Pin game
  E-mail to SMS alert
  2 way SMS to Email gateway
  SMS Order System
  Least Cost Routing
  SMS Load Balancing
  Asterisk PBX SMS
  SQL SMS Gateway
  Database Link Management
  MySQL Script
  PostgreSQL script
  Access
  Oracle script
  Recipient list
  SMS Service Provider
  Service Provider
  SMS PIN code query
  SMS Counter game
  SMS newsgroup
  Distributed SMS
  SMS Menu
  Google maps
  Forwarding
  Birthday greeting - SQL Express
  Birthday greeting - MySQL
  Birthday greeting - Oracle
  Instant brochure - MMS autoreply
  Alphabet letter game
  SMS sport betting service
  E-mail about outgoing SMS messages
  SMS Information Menu
  Email to SMS feature
  Reminder example
  Bulk SMS Client
  Bulk SMS to a given phone number range
  Filtering phone numbers
  Ozeki Phone Sytem PBX SMS
  Autoreply voucher example
  Appendix
  FAQ
  Feature list
  Commercial Information
  Search
  Cookie policy
 


Automated phone calls?
Ozeki Phone System XE VoIP PBX software is an advanced PBX built for automated voice calls and 2 way SMS messaging. It has outstanding APIs for software developers. It can be used for:

Phone calls from SQL
Phone calls from HTTP
Voice and SMS applications

Callcenter developers
If you are working on telephone solutions, please check out the Ozeki VoIP SIP SDK.
It can be used to create VoIP client and server software.

Contact Us!
If you wish to get further information, do not hesitate to contact us!

E-mail: info@ozekisms.com

If you have a technical question, please submit a support request on-line.

How to send messages to a list of recipients with one SQL insert command

This guide gives you instructions, to setup a configuration, that allows you to send messages to a list of recipients by executing only one insert query for the message. It is based on the SQL to SMS configuration and implements the functionality using SQL.

If you have setup the database user you already have an ozekimessagin and an ozekimessageout database table in your database server. To send messages to a group of recipients with only one insert statement, you will need to two more database tables. One table will hold a list of all recipients and another will hold information about which recipient belongs to which group. The table definitions for these tables are shown on Figure 1.

CREATE TABLE recipients (
 fullname varchar(30),
 phonenumber varchar(30)
);

CREATE TABLE groups (
 groupname varchar(30),
 fullname varchar(30)
);

Figure 1 - SQL Create table definitions

To test the functionality we will need to add some test data into these tables:

INSERT INTO recipients (fullname,phonenumber) VALUES ('gyula','111111');
INSERT INTO recipients (fullname,phonenumber) VALUES ('peter','222222');
INSERT INTO recipients (fullname,phonenumber) VALUES ('erik','333333');
INSERT INTO recipients (fullname,phonenumber) VALUES ('sonyja','444444');
INSERT INTO recipients (fullname,phonenumber) VALUES ('lis','555555');

INSERT INTO groups (groupname,fullname) VALUES ('friends','gyula');
INSERT INTO groups (groupname,fullname) VALUES ('friends','lis');
INSERT INTO groups (groupname,fullname) VALUES ('enemies','peter');
INSERT INTO groups (groupname,fullname) VALUES ('enemies','sonyja');
INSERT INTO groups (groupname,fullname) VALUES ('classmates','lis');
INSERT INTO groups (groupname,fullname) VALUES ('classmates','peter');
INSERT INTO groups (groupname,fullname) VALUES ('classmates','erik');

Figure 2 - SQL test data

To be able to send a message to a group we need to modify the SQL query in the "Polling" tab of the "SQL for sending" tab of the "Database user" configuration form in the Ozeki NG SMS Gateway user interface. This query selects messages from the ozekimessageout database table by default. It will be modified to query that will use data from the newly created tables: recipients and groups. The modified query will be:

Change this:
SELECT id,sender,receiver,msg,msgtype,operator FROM ozekimessageout WHERE status='send'

To this:
SELECT a.id,a.sender,b.phonenumber,a.msg,a.msgtype,a.operator FROM ozekimessageout a, recipients b, groups c WHERE (a.receiver=c.groupname) and (c.fullname=b.fullname) and (a.status='send')

Figure 3 - Modify the SQL SELECT query

The modified query will collect the telephone numbers from the recipients table using the group name. To send a message to a group you would use the following SQL command:

INSERT INTO ozekimessageout (receiver,msg,status) VALUES ('friends','Hello world','send');

Figure 3 - Modify the SQL SELECT query

Note that in this SQL command we provide the group name 'friends' instead of a telephone number.

Dig deeper!
People who read this also read...





Next page: SMS Service Provider
Copyright © 2000 - 2017 Ozeki Informatics Ltd.
All rights reserved

Software PBX for Windows | VoIP SDK   |   Legal information   |   Privacy policy   |   Terms of use
Please, address your inquiries to info@ozekisms.com