Send and receive SMS in Visual FoxPro
Visual FoxPro is a data centric and object
oriented database to make well-organized data storage possible. Now there
is a great possibility to improve your Visual FoxPro by adding SMS
functionality to it. With this function you will be able to send and receive
important data and information in your database to mobile phones. This
functionality can be provided by a stable SMS gateway such as Ozeki NG SMS
Gateway. Ozeki NG SMS Gateway is a software
product that can be installed on
your computer. It forwards SMS messages to the mobile network either with a
GSM modem attached to the computer or over IP SMS connection. If you implement
Ozeki NG SMS Gateway to transmit SMS messages you will gain a high secure and
stable SMS system that improves corporate communication. In this article you will
find further information on this solution.
Fields of application
Visual FoxPro is a data centric and object oriented database
that can be used to maintain a well-structured corporate IT system. Now there
is a great possibility to increase the features of Visual FoxPro to be more
efficient.
If you wish to further improve your Visual FoxPro database you can add SMS
functionality to it. SMS technology makes it possible to improve corporate
communication in a large extent. If you add SMS functionality to your database
then you ensure that all the important changes will be forwarded to the intended
people. Dealing with huge amount of data is important in companies as there
are constant changes in their databases. With Ozeki's solution, information
about these changes can be easily and very rapidly forwarded to the intended
people.
To achieve this SMS functionality you need to install an SMS gateway on your
computer such as Ozeki NG SMS Gateway. This
software product is able to meet with all the requirements of companies because
it is a stable and well-functioning software with high capacity. In this way you
can send SMS messages from your corporate IT system to the mobile phones of the
intended people. The benefits can be immediately noticed. With this solution
your colleagues, employees but even your customers or business partners can be
informed in a practical way. You can send short but important information to
these people and it is quite sure that they will receive your message
immediately. Therefore the communication of your company is highly improved
both within and outside of the company.
Prerequisites
In order to setup this solution you need to find a way
to connect your system to the mobile network. You can do this
by using an Internet connection or you can
setup a wireless connection by attaching a GSM phone/GSM modem to your computer. To help you make a
decision, we have prepared a webpage for you:
Internet based SMS connections vs. GSM modem based (wireless) SMS connections.
Depending
on what you select, you need the following prerequisites.
Prerequisites for Internet based connection to the Mobile network
If you wish to connect your system to an SMS service
provider over the Internet you need the following components:

Figure 1/a - Prerequisites for Ozeki NG SMS
Gateway IP SMS connection
In this case you need to find an SMS service
provider who can reach the mobile phones in your area. This SMS
service provider should be able to provide SMS service through
the Internet. To find such a provider, you can check our
website where we list some of them:
SMPP SMS Service providers.
Once you have found such a provider, you need to sign up for
their service to get the connection parameters. You can use these parameters
to configure your Ozeki NG SMS Gateway software.
Prerequisites for wireless (GSM modem) connection to the Mobile network
If you wish to connect your system to the mobile
network wirelessly, you need a GSM modem or GSM phone, that you
can attach to your computer with a data cable. In this case your Ozeki
NG SMS Gateway software will operate this phone and will send and receive
SMS messages wirelessly. To setup this connection method, you need the following
components:
Figure 1/b - Prerequisites for Ozeki NG SMS
Gateway GSM modem connection
Your checklist (for GSM modem connection):
*The SIM card will come with a plan, that will
determine how much money you will spend on each SMS.
System architecture
After you make sure you meet the requirements above, you
can start to build your SMS system. It will work as follows: In case of incoming
messages, Ozeki NG SMS Gateway inserts the message into Visual FoxPro by an SQL
INSERT statement and you can read your incoming message. If you wish to send
messages from FoxPro then Ozeki NG SMS Gateway polls the message out from the
database by an SQL SELECT statement, processes it and finally sends out to
mobile phones. Figure 2 demonstrates this process.
Figure 2 - Ozeki NG SMS Gateway - solution
for SMS sending in Visual FoxPro
Ozeki NG SMS Gateway forwards messages to the mobile network
either with the help of a GSM modem attached to your PC with a data cable or it
connects directly to the SMS center of the mobile service provider over the
Internet. Please note that GSM modem connection is highly recommended as it is
more secure than IP SMS connectivity.
How to configure this solution
To send and receive SMS in Visual FoxPro you need to make
some simple configuration in Ozeki NG SMS Gateway. To apply this solution
properly please follow the steps of our configuration guide and watch this video
tutorial as well.
First you need to create a new database and then two database
tables for incoming and outgoing messages: "ozekimessagein" and
"ozekimessageout". To create these tables start Visual FoxPro at "All programs"
in "Start" menu (Figure 3).
Figure 3 - Start Visual FoxPro
Then click on "New" menu item in "File" menu (Figure 4)
Figure 4 - Select New
Select "Database" option and "New file" button (Figure 5).
Figure 5 - New database
Define a location where you wish to save the created database.
In our example it is "ozeki_visual_foxpro_db" folder in C drive (Figure 6).
Figure 6 - Select a folder for the database
Provide a name for the database (in our example it is "ozeki")
and click on "Save" (Figure 7).
Figure 7 - Provide a name for the database
Expand the command window and clear its content (Figure 8)
Figure 8 - Cleared command window
Then paste these table definitions into the command window
(Figure 9):
CREATE TABLE ozekimessagein;
(id INT(4) autoinc,;
sender Varchar(30) NULL,;
receiver Varchar(30) NULL,;
msg Varchar(160) NULL,;
senttime Varchar(100) NULL,;
receivedtime Varchar(100) NULL,;
operator Varchar(30) NULL,;
msgtype Varchar(30) NULL,;
reference Varchar(30) NULL);
CREATE TABLE ozekimessageout;
(id INT(4) autoinc,;
sender Varchar(30) NULL,;
receiver Varchar(30) NULL,;
msg Varchar(160) NULL,;
senttime Varchar(100) NULL,;
receivedtime Varchar(100) NULL,;
operator Varchar(30) NULL,;
msgtype Varchar(30) NULL,;
reference Varchar(30) NULL,;
status varchar(30) NULL,;
errormsg varchar(250) NULL);
|
Figure 9 - Pasted table definitions
Now select all the definitions and right click on them and
select "Execute Selection" option (Figure 10).
Figure 10 - Execute table definitions
If it is done, close the command window the created database
tables will appear in the database (Figure 11).
Figure 11 - Created tables
The configuration of the database is finished, now you can
start to configure Ozeki NG SMS Gateway. First log into Ozeki NG SMS Gateway
with your username and password. Then click on "Add new user or application"
(Figure 12).
Figure 12 - Add new user
Select "Database user" and click on "Install" next to it
(Figure 13).
Figure 13 - Install database user
Provide a name for this user. In our example it is
"visual_foxpro" (Figure 14).
Figure 14 - Provide a name
In "Database connection" tab provide the connection string and
click on "OK" (Figure 15).
Connection string:
Provider=VFPOLEDB.1;Data Source=PathToYourDatabase;Mode=ReadWrite;Password="";Collating
Sequence=MACHINE |
After the "Data Source=" part provide the full path to the created database.
|