Ozeki NG SMS Gateway logo OZEKI NG SMS Gateway
"The World's most reliable SMS gateway software!"
info@ozekisms.com
Tel.: 00 36 52 532 731
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

SMS Menu Contents | SearchForwarding

Home > Product Manual > Examples and Solutions > Google maps

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
  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 use Google Maps to display coordinates received in SMS

Video tutorial

Video tutorial: How to display SMS data in Google maps (part 1/4, Install IIS and PHP)
Video tutorial: How to display SMS data in Google maps (part 2/4, Read data from MySQL using PHP)
Video tutorial: How to display SMS data in Google maps (part 3/4, Prepare the data for Google Maps)
Video tutorial: How to display SMS data in Google maps (part 4/4, Implement the Google Maps API)


Introduction

This solution displays coordinates received in SMS messages using the Google Maps service. To implement this solution, you need the following:

  1. An installed copy of Ozeki NG SMS Gateway.
  2. A GSM modem attached to your computer, that needs to be configured in Ozeki NG for receiving.
  3. A MySQL database server installed and configured in Ozeki NG.
  4. IIS webserver
  5. PHP


Figure 1.) Example screen shot of solution

How to create the solution

The first step is to setup Ozeki NG SMS Gateway and configure it with MySQL. This step is explained in the How to send/receive SMS using MySQL guide. Once you have Ozeki NG SMS Gateway and MySQL configured, your incoming SMS messages will be automatically inserted into a database table called: ozekimessagein.

The next step is to install IIS and PHP. IIS is part of the Windows XP Pro installation CD ROM and PHP can be downloaded from www.php.net. The installation of IIS and PHP will create the wwwroot directory on your system. By default it is the "C:\Inetpub\wwwroot" directory. If you put PHP files (with .php) extension into this directory, they will be executed by the PHP engine, when they are opened with a webbrowser.

After PHP and IIS has been installed, PHP can be used to read the SMS from the MySQL database table. When an SMS has been read, it's content can be processed to extract the longitude and the latitude coordinates. These coordinates can be displayed in Google maps.

To display the longitude and latitude coordinates in Google maps, you need to create a PHP file (called googlemap.php) with the following content:

C:\Inetpub\wwwroot\googlemap.php
<?php

//Connect to MySQL
$con=mysql_connect("localhost","root","qwe123");
if (!$con) {
    die('Cannot connect: '.mysql_error());
}

mysql_select_db("test");
$sql = "select msg from ozekimessagein order by senttime desc limit 1";
$res = mysql_query($sql);
$cn = mysql_num_rows($res);
if ($cn>0) {
   list($data) = mysql_fetch_row($res);
#   echo "Received SMS content: $data";

   list($vehicleID,$long,$lat) = split(',',$data);
#   echo "<br>Vehicle ID: $vehicleID<br>";
#   echo "Long: $long<br>";
#   echo "Lat: $lat<br>";

} else {
#   echo "There is no data in the MySQL database";
}


mysql_close($con);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA"
      type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(<?php echo"$long, $lat";?>), 13);
        var marker=new GMarker(new GLatLng(<?php echo"$long, $lat";?>), {draggable: false});
        map.addOverlay(marker);
      }
    }
    //]]>
    </script>
  </head>
  <body onload="load()" onunload="GUnload()">
    <div id="map" style="width: 500px; height: 300px"></div>
  </body>
</html>

This file uses the Google Maps API. Please note that this PHP script will not run by default. The reason for this is that you need to have a unique ID assigned to the Google Maps API. This ID can be generated on the Google Maps website: http://code.google.com/apis/maps/. During generation, you need to provide a website name, such as www.anyhost.com.

If you don't have a website name assigned to your computer, you can create one in the Windows hosts file, which is located in the following location: C:\WINDOWS\system32\drivers\etc

Once the PHP file is created and the unique Google Maps ID is inserted into the file, you are ready to view the PHP webpage in a webbrowser. The webbrowser will display a map with the latest coordinate found in the database.

Check out the video tutorials for more details.

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





Next page: Forwarding
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