89c9 SMS Gateway - Examples and Solutions, SMS Menu

                

Search the manual:

Overview Quick start Download Manual How to buy FAQ Contact Us
OZEKI NG SMS Gateway - Product Guide

Distributed SMS Contents | SearchGoogle maps

Home > Product Manual > Examples and Solutions > SMS Menu

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

SMS Menu / SMS IVR


This example shows you how you can use Ozeki NG SMS Gateway to create an SMS order system. This order system is a menu similar to the menu used in voice telephone systems (IVR menu). It works very simply, the mobile users sends in a message, then a system replies automatically. The mobile user can select a menu item by sending in a number.

The original idea is presented at http://www.csebd.net/sms4buy.swf with the following flash video:



Preparation

This service can be created using Ozeki NG SMS Gateway in a matter of minutes. The first step is to attach a GSM modem or GSM phone to your computer with a phone to PC data cable. (A list of supported GSM modems and phones can be found at http://www.ozekisms.com/index.php?owpn=148.) The next step is to download Ozeki NG SMS Gateway and to install it. Installation is simple. The Ozeki NG SMS Gateway will communicate with your GSM modem and will make sending and receiving SMS messages easy. After Ozeki NG has been installed, the GSM modem you have attached to your computer with a data cable should be setup. The SMS Quick Start Guide explains how this can be done. The final step is to test the functionality of your system, by sending and receiving a test message.

How to setup the SMS menu service

The solution uses the built in ASP script execution engine of Ozeki NG, so the setup requires you to install the ASP SMS user in the "Add user or application" screen (Figure 1). This screen can be brough up by clicking on the "Add user" menu item in the "Users and applications" menu.


Figure 1 - Install the ASP user


The next step is to assign a name for your service. For example you can specify "salesmenu" as the service name (Figure 2).


Figure 2 - Provide a unique name for your service

When you click Ok, the service will be created. On the service configuration form you need to disable the automatic response functionality by making sure the three checkboxes on the configuration form are NOT checked (Figure 3 and 4).


Figure 3 - Disable the automatic response functionality on General tab



Figure 4 - Disable the automatic response functionality on Service period tab

After the checkboxes have been unchecked, click OK. The next step is to find out the path of the ASP script that will be executed when an SMS comes in. To get the location click on the script setup link in the left panel (Figure 5).


Figure 5 - Find the ASP script location

When you have the path, use notepad to open this script for editing (Figure 6). Of course you may use any other text editor you like to modify the script.


Figure 6 - Use notepad to edit the script.

Source code

To create the SMS menu functionality copy the following source code into the sample.asp script. After you have copied this code, you need to save sample.asp and your service is ready to go.

C:\Program Files\Ozeki\OzekiNG - SMS Gateway\config\salesmenu\sample.asp

<%@ Page Language="C#"%>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Collections" %>
<%

//************************************************************
//copy the properties of the incoming SMS into local variables
//************************************************************

string sender = Request.QueryString["sender"];
string receiver = Request.QueryString["receiver"];
string messagedata = Request.QueryString["messagedata"];
string messageid = Request.QueryString["messageid"];
string messagetype = Request.QueryString["messagetype"];
string senttime = Request.QueryString["senttime"];
string receivedtime = Request.QueryString["receivedtime"];
string serviceprovider = Request.QueryString["operatornames"];

//************************************************************
//Create the menu
//************************************************************

Hashtable menuitems = new Hashtable();

//First level
menuitems.Add("0","1. New laptop\\0x0D\\0x0A2. Used laptop\\0x0D\\0x0A0. Main menu\\0x0D\\0x0A");

//Second level
menuitems.Add("01","1. IBM\\0x0D\\0x0A2. Dell\\0x0D\\0x0A3. Sony\\0x0D\\0x0A0. Main menu\\0x0D\\0x0A");
menuitems.Add("02","We are sorry, new used laptops are on stock at the momemnt.");

//Third level
menuitems.Add("011",
"1. IBM ThinkPad R61e 7650-DPG, USD 1000\\0x0D\\0x0A"+
"2. IBM ThinkPad X5 NF5DCHV, USD 1200\\0x0D\\0x0A"+
"0. Main menu");

menuitems.Add("012",
"DELL Inspiron 1525-97015,\\0x0D\\0x0A"+
"15.4 (1280x800) WXGA 16:9 GlareType,\\0x0D\\0x0A"+
"Intel Mobile Celeron 2000 MHz CPU,\\0x0D\\0x0A"+
"1024MB RAM,\\0x0D\\0x0A"+
"120GB HDD 5400RPM SATA\\0x0D\\0x0A"+
"Price: USD 1312\\0x0D\\0x0A"+
"Call dealer: +44555555\\0x0D\\0x0A");

menuitems.Add("013","No Sony laptops are available currently.");

//Forth level
menuitems.Add("0111","Call us for more information on IBM ThinkPad R61e. Tel: +44999999");
menuitems.Add("0112","Call us for more information on IBM ThinkPad X5. Tel: +44999999");

//************************************************************
//Process the incoming message
//************************************************************

string directory = @"C:\Program Files\Ozeki\OzekiNG - SMS Gateway\config\salesmenu\";
string filename = directory+sender+".txt";

string phonestate = "0";
//Read
if (File.Exists(filename)) {
   try {
       StreamReader sr = new StreamReader(filename);
           phonestate = sr.ReadToEnd().Trim();
           sr.Close();
   } catch {
       phonestate = "0";
   }
}

phonestate = phonestate+messagedata;

//************************************************************
//create the response message(s) in the following format:
//http://www.ozekisms.com/index.php?owpn=355
//************************************************************

string responsemessage = "";
string newstateforphone = "";

if (menuitems.Contains(phonestate)) {
    newstateforphone = phonestate;
        responsemessage = (string)menuitems[phonestate];
} else {
    newstateforphone = "0";
        responsemessage = (string)menuitems["0"];
}

string destnum = sender;
string resptype = "SMS:TEXT:FORMATTED";

string resp = "{"+resptype+"}{}{}{"+destnum+"}{"+responsemessage+"}";

Response.Write(resp);

//************************************************************
//save the state of the phone
//************************************************************
try {
    StreamWriter SW;
    SW=File.CreateText(filename);
    SW.WriteLine(newstateforphone);
    SW.Close();
} catch {
}

%>


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





Next page: Google maps
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