SendSMS developers manual
Preface
For information and other staff related to the curent system, see http://zlatko.ludost.net/sendsms/.
For contacts - Zlatko Kostadinov.
You may want to take a look at the user
manual to get more familiar with the system purpose and usage. We
do not intend to discuss those subjects in the current document.
Introduction
This document is oriented to potential developers of the SendSMS
library. Those developers are expected to change/improve the library
module or to create new sender implementations.
Basically the system consists of three parts - some interfaces to
define the functionality of the system from developers point of view,
SendSMS core that manages the senders and sender implementations. The
idea behind this division is that every sender implementation will
implement different sending approach for a different set of receivers.
The core will be configured to use some specifiec senders that may be
found in the library path. Thus when the user wants to change the
approach use (for example if a service is no more available or if a
better service occured), he will need to add/delete some library files
and to change configuration files without need to recompile the
program. This is because of the current state in BG IT, that we suppose
will be subject of frequent changes in teh next few years.
Here
is a diagram of all classes followed by description of the three parts:
Interfaces
The framework defines three interfaces to describe the functionality:
- IAddress - describes the info needed to send the message to a
specific address. Curently the address includes only phone number.
- ISMS - interface to contain all info needed for the message
sending. Currently this includes the message content (text) and the
address to be sent to.
- ISender - defines the functinality that a SMS sender object
should implement in order to be used by the SendSMS library. This
includes init method, that will be called immediately after creation to
initialize the instance, accept method which must return true if the
provided parameter is an SMS message that may be sent using this sender
and a send method that send the specified ISMS implementation using the
sender specific approach. send method is not obliged to send messages
that are not approved by the accept method. Anyway, this stil may be
implemented. By convention every ISender imlpementation must provide
public constructor without parameters for the instances to be created.
SendSMS
SendSMS is a singleton class. One may send SMS message calling the send
method on it's single instance. The SendSMS class uses the
System.Configuration, System.Xml and System.Xml.XPath namespaces to
initialize it's state and the System.Reflection to create the senders.
Every instance ( still there is only one instance :-) ) keeps it's own
senders collection order by priority. The senders along with their
priority are defined in the configuration file.
The send method raises NotSendException if the message may not be
send. There is no way defined to know if the messge have not been
received.
Sender implementations
Email2SMSSender is a simple ISender implementation. Its work consists
of sending an email message to email formatted like <phone-number>@sms.mtel.net.
This is done using the System.Web.Mail namespace. Some configuration
parameters like SMTP server, sender email, etc. are provided using a
XML file.
Building a binary distribution
- Checkout the SendSMS module from the CVS repository. You may also
want to checkout the TestSendSMS module to see an example of SendSMS
client. Alternative way of the cvs checkout is to download the
developer package from the web server.
- Your files obtained should look like that (some may be skipped):
- SendSMS
- config - a directory containing the configuration files for
the system
- Email2SMSSender.xml - config file for the email2sms sender
implementation
- SendSMS.xml - config file for the SendSMS core
- dist - a directory to contain the binary files produced by
the make procedure
- doc - a directory containing the docs for the system
- UserManual.html - a user manual for the system
- DeveloperManual.html - the current document
- model - directory for the UML modelling projects
- SendSMS.zargo - an Argo UML model of the system
- src - a directory containing the sources for the system
- csharp - a directory for the system source files
- email2sms - a direcotry for the Email2SMS sender source
files
- Email2SMSSender.cs - the sources for Email2SMS sender
- Interfaces.cs - the interfaces definition
- SimpleImplementations.cs - the simple interfaces
implementations
- SendSMS.cs - the SendSMS core definition
- makefile - a build file for the make tool
- makefile.conf - containn some make configuration options
- TestSendSMS - the project for testing send sms.
- Go to SendSMS dir and edit the makefile.conf file. You should set
some proerties like compiler location, path to additional dll files,
etc. All those properties should be defined and described in the file -
you may need to change their values.
- Type make in to build the distribution files. Thos files will be
created in the DIST_DIR specified in the previous step.
Further works
The first thing that should be implemented is a sender that uses a
phone connected to the PC using a USB port, or some similar decision.
This will allow us to find better frames for the framework - what IS
possible to be done in a regular sender and what IS NOT and to define
some functionality like "this sender can do this this and this can
not". If you are interested in participating this stage development (or
any other stage :-)), please contact Zlatko Kostadinov.
Thanks for all your attention!
SendSMS developers team