8107 SMS Gateway - SQL SMS Gateway, Recipient list

                

Search the manual:

Overview Quick start Download Manual How to buy FAQ Contact Us
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
  Pin game
  E-mail to SMS Alerts
  2 way SMS to Email gateway
  SMS Order System
  Least Cost Routing
  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
  Appendix
  FAQ
  Feature list
  Commercial Information
  Search
 



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.


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

Webphone solutions:
- Adobe Flash video phone
- Silverlight video phone
- Web to web calls
- Web to VoIP calls

Custom SIP clients:
- Silverlight SIP VoIP client
- Flash SIP VoIP client
- C# .net SIP VoIP client
- ASP .net SIP VoIP client
- Web based SIP VoIP client

Custom VoIP solutions:
- VoIP SIP softphones
- VoIP call center clients
- VoIP IVR systems
- VoIP predictive dialer systems
- VoIP auto dialer systems
- VoIP call assistant
- VoIP call recording systems
- VoIP intercom solutions

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 - 2013 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


0