Case Study: "Sorceress"
Abstract
Most companies spend hundreds of rands to send SMS's in bulk or to send SMS's internally.
Both efficiently and from one central billing point, Mobile Solutions decided that it was necessary to do this from a component perspective and we ensued developing a system which would be intranet based and would communicate with the serial port using standard commands.
This case study defines our methodology and implementation of the Serial Port Component product into our systems as a serial port communication tool.
Compatibility
Our key issue was to ensure the system would work with any standard internal GSM modem; we tested the Serial Port Component application on a web layer on the following handsets and premicells:
- Nokia 30;
- Nokia 22;
- Ericcson F221;
- Nokia 6310i connected via a serial cable;
Serial Port Knowledge
After a bit of thinking and browsing the internet for compatible commands, we came up with the following commands which could be used to communicate with the serial port and the handset or premicell. These commands would then enable the handset / premicell to send an sms, we tested this in Hyper Terminal:
AT+CMGF=1 {Enter} AT+CMGS="<mobile number>" {Enter} > <short text message> {Enter} Ctrl-Z {Enter}
These commands then sent the sms (<short text message>) to the relevant mobile number (<mobile number>).
Implementation
After being able to this our next task was to complete this system and make it more user efficient by developing it on a web platform.
The end result was a fully functional and basic demo system for the Department of Justice who wanted to purchase a range of the Nokia 30 to send SMS's via their servers, we would be implementing these systems.
Fig 1.1 the web based system
Clicking on the send button automatically used the Serial Port Component product dll to send the commands to the serial interface (COM Port) that was selected, find below the code for this page.
<%
' ****************************************************************
' Department of Justice Demonstration
' NOTE:
' The file must be named 'initmodem.asp'
' © Copyright 2001 by ActiveXperts Software - www.activexperts.com - Serial Port Component Serial Communicator
' © Copyright 2003 by Sorceress Entertainment - SMS Application
' ****************************************************************
%>
<!--#include file="AComport.inc"-->
<object runat=server progid="ActiveXperts.ComPort" id=acObj> </object>
<%
Sub WriteStr( o, str )
o.WriteString str
response.write(" Received:" &str & "<br>")
End Sub
%>
<%
Function ReadStr( o )
strResult = ""
str = "notempty"
o.Sleep 200
Do While str <> ""
str = o.ReadString
If str <> "" Then
ReadStr = str
response.write("Sent:" &str & "<br>")
End If
Loop
End Function
%>
<%
If Request( "BUTTON_SUBMIT" ) <> "" Then
acObj.PortID = Request( "NUM_PORTID" )
acObj.Open
If acObj.LastError = acERR_SUCCESS Then
STR_CMD1 = "AT+CMGF=1"
WriteStr acObj, STR_CMD1
str=readstr(acobj)
STR_CMD2 = "AT+CMGS=" + """" + Request( "STR_CMD2" ) + """"
WriteStr acObj, STR_CMD2
str=readstr(acobj)
If Request( "STR_CMD3" ) <> "" Then
WriteStr acObj, Request( "STR_CMD3" )
str=readstr(acobj)
str = chr(26)
acObj.WriteString(str)
str=readstr(acobj)
End If
acObj.Close
End If
%>
<html>
<body>
<hr>
<h1>Department of Justice Demonstration</h1>
<h2>Your message was sent successfully</h2>
</body>
</html>
<%
Else
%>
<html>
<body>
<hr>
<h1>Department of Justice Demonstration</h1>
<hr>
<br>
<form action="initmodem.asp" method="post">
<table>
<tr>
<td>Comport:</td>
<td>
<select size="1" name="NUM_PORTID">
<option selected>1</option> <option>2</option>
<option>3</option> <option>4</option>
</select>
</td>
</tr>
<td>Cellphone:</td><td><input size=15 type=text name="STR_CMD2" value=""></td>
</tr>
<tr>
<td>Message:</td><td><input type="text" name="STR_CMD3" value=""></td>
</tr>
</table>
<p><input type="submit" value="Send" name="BUTTON_SUBMIT"></p>
</form>
</body>
</html>
<% End If %>
In Conclusion
We highly recommend Serial Port Component, instead of developing your own code to use as a serial port communication object, we have found this product to be compatible to any device that has a standard GSM modem and that connects to a serial port for sending SMS's or paging.
This component assisted us in closing the deal and successfully presenting the combined efforts of telecommunications and web development. For one this application combined with a bit of technique can be used to save your company immense costs on SMS's and also save you extensively on bulk messaging applications, you may use the code above as a guideline, We used the standard code provided in the demo of the product.
We have contacted and ensued adding all of ActiveXperts Software and their services as our Strategic Partner going forward.