Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

SMS Gateway

Written By: 

Anshul Thakur

 After the invention of video games, ‘Short Message Service’ is by far the best thing that could have happened to the youth of the world. Short Message Service or lovingly shortened as SMS, has been one of the most significant means of exchanging information in the modern era of thumb twiddling youth. They are fast paced, tech savvy and almost always running short of time as well as mobile talk-time. Advances in technology makes them engrossed with computer and electronic gadgets for a better part of their time and sometimes, even picking up the phone to type a message seems to be a herculean task. Much like the youth is the industrial sector that thrives on youth’s desires.


The advertisement sector finds it prohibitively expensive on time and money to employ teams for typing advertising SMS on mobile phones and sending them to different numbers in a bid to garner customers. But with continued innovation in the field of technology, the divide between all sorts of communication methods is lapsing and means are being invented to extract more time from our already congested lifestyles and more juice from the limited resources. Typing with a keyboard is easy, and an add-on is that typing repetitively is no longer necessary, do it once and we are set. Use a computer and broadcast the SMS.


Anyone reading this must have used an online SMS sending website to send a couple of message to different phone numbers when running short of balance or were just too lazy to fetch the phone from the next room. If you have, then you already have experienced the magnificence of this technology, and if not, please go and do it now. A SMS is a short text message which can be sent over the wireless channel using certain standardized communication methods over the ‘Mobile Application Part’ (MAP) of the SS7 protocol. The GSM 7-bit alphabet encoding scheme limits the maximum payload length to 160 characters. There are a few ways in which the same message can be sent from a computer and we are going to discuss a few of them in the following discussion.
The first step to use any technology is, to have a motive. In case of PC based SMS, the motive may vary with the size of organization and the targeted audience base for the SMS. The two broad types of classifications of PC Based SMS technology can be inferred from the following diagram:
Block Diagram Showing Classification of PC Based SMS Technology
Fig. 1: Block Diagram Showing Classification of PC Based SMS Technology


Light Weight Messaging:

Lightweight Messaging is what individuals do. A GSM modem is interfaced with the computer over a serial or a USB port and a GUI (Graphical User Interface) or a CLI (Command Line Interface) is used to send messages to any mobile using the GSM modem. A GSM Modem is like a Dial-Up Modem in function, the major difference being that a dial-up modem uses transmission lines while GSM modem uses wireless network. It uses the SMS specifications to send messages, much like any GSM phone and also needs a SIM card to be able to send SMS. These are called ‘Direct to the Mobile Appliance’ type of devices, as these can directly access the mobile SS7 networks through the modem and can deliver messages right into the destination mobile device(s). Such devices do not use any kind of internet access or infrastructure in between and act as a gateway from the computer into the wireless network.
Modern Internet USB dongles are a much refined version of such GSM modems which are capable of full phone functionalities. Most network providers scrap down the capabilities of the dongles by using their own, toned down firmware with the devices. Many ‘Do It Yourself’ project ideas revolving around applications of a GSM modem interfaced with a computer are available online. The device communication is done through a sequence of AT commands which are quite easy after little practice. More information on this is available here.
This type of technology is intended for tech savvy individuals and to cater to the intra-company needs of the corporate. Seniors in big corporate offices can use such Direct to Mobile Appliances to broadcast message to the mobiles of a large number of people within the organization, for example, meeting notifications to a particular team. The advantage would be that, the contacts listing, sorting and managing can be automated and much more simplified by the use of a computer, rather than a mobile phone.
A novel use of such technology has been in the medical field, where the doctor is sent an alarm SMS from the bedside monitoring instruments of a patient in case some spurious reading is detected, indicating a critical situation which demands immediate attention. This not only increases the efficiency of the medical teams, but also reduces the workload on staff on duty.

Bulk Messaging:

Bulk messaging is the way we receive advertisements on our mobiles from various advertising companies. It is obvious that a single GSM interfaced modem cannot take care of such transmissions. Not only it is too time consuming, but the number of mobile subscribers to which the SMS is to be sent is just too large to be allowed on a single phone. Thus, mobile service providers have provided alternative means to get around this limitation for the companies. They provide direct access to their SMS Centers for companies through internet or leased lines via a SMS gateway.
An SMS gateway is generally offered as Software as a Service (SaaS), or a well documented API which can be integrated into the backend of the server. It falls into the ‘Direct to SMSC Appliance’ type of SMS devices. It generally interacts with only one SMSC at a time, which offers bulk SMS services at a certain pricing. Its function is to convert incoming SMS sending requests into a format that is compatible with the Short Messaging Service Center (SMSC).
The incoming request can be from a webpage, in the form of a hyper text transfer protocol (http), or some form of script request calling a function in the software. A typical HTTP request may look like:
Detailed View of TYpical HTTP Request
Fig. 2: Detailed View of Typical HTTP Request
A similar functionality can be provided in the form of software to be loaded on the computers. An example code snippet from JAVA can be:

Example of JAVA Code Snippet

Fig. 3: Example of JAVA Code Snippet


These messages need to be converted into the format the serving SMSC works in. For example, Nokia SMSCs use Computer Interface to Message Distribution (CIMD) protocol, while CMG, another SMSC provider uses External Machine Interface (EMI) which is an extension to Universal Computer Protocol (UCP). There are other providers too who use Simple Network Paging Protocol (SNPP). Each protocol is different from the other in most respects except the function that they perform. For example, the above request converted into the two common SMSC protocols is shown below:

Figure Showing SMS Send Request in EM1 Protocol

Fig. 4: Figure Showing SMS Send Request in EM1 Protocol



SMS Send Request in EMI Protocol



Types of SMS Gateways

There are basically two types of SMS Gateways which can be used to send bulk messaging.
SMS Aggregators: These are the gateways used by most web based SMS service providers. The aggregators do not have access beyond the SMSCs and can only route packets up to the message centre. This is an example of Local Termination Model. They do not have access to the wireless mobile networks and cannot ensure delivery on their own and are also bounded by national boundary restrictions most of the time. After the message has been submitted at the SMSC, these gateways are pretty much at the mercy of the network service provider for the delivery of messages over the air using the SS7 protocols.
Let us look into the pros and cons of such gateways. These are generally much cheaper that sending individual messages to multiple mobile numbers from a mobile device. If the network delivery services of the provider are reliable, then the gateway itself is reliable too. Non-critical messages can be easily sent using such method. The infrastructure required is minimal, is generally software tailored to suit the requirements of the customer or can be implemented independently by the user himself too. On the flipside, the message delivery not being guaranteed means that important message may not be sent using it, as there is no assurance of them being delivered.
SS7 Providers: SS7 providers achieve what SMS Aggregators fall short of, guaranteed message delivery provided that the destination number is valid and in service. Such type of gateways is far more complex and need a lot more infrastructure. Dedicated machines may be required to install such service. The SS7 provider Gateways have access to the SS7 channels of the mobile network, and thus, can exercise full control over the Message routing through the Wireless network right up to the delivery of the message on the destination mobile device. This follows International Termination Model and also enables sending of international SMS’s. But like most of the excellent things, such services are very expensive for just any company to buy.
This type of Direct to SMSC devices are intended for advertising companies, awareness agencies and companies offering personalized mobile services. They generally use A2P (Application to Person) services. Business ventures floating new shares in the market may send out notifications to their existing shareholders through such services. Advertisement agencies send regional advertisements and local offers using such type of devices to maximize turnouts. Banks and insurance companies offer personalized mobile services following a query response model and also providing advice and alerts to their subscribers. Governments have started to exploit the Mobile penetration to spread awareness about various activities to all people who have access to mobile phones, which encompasses a big majority of the world population. A recent example is the sending out of SMS notifications and reminders regarding the Mega Earthquake Disaster Management Mock Drill organized by DDMA. Mobile Network providers offer value added services like sports and news updates using such devices. Even Google provides SMS based localized search.
The technology may often cause nuisance by causing disturbance at the wrong hours, and may sometimes be used as a tool of mischief by individuals to send harassing SMS from websites anonymously. TO remedy this, the companies have started to offer Do Not Disturb (DND) services and the recipients may also choose not to receive any kind of SMS from that service.
Computer based SMS has gained much prominence and made an impact on society. In 2011 alone, more than 8 trillion text messages were sent and mobile advertisement revenue was around US $3.3 billion which is estimated to cross $20.6 billion by 2015. Countries like England, France and Germany have been found to be very receptive towards Mobile Advertisements. SMS has been a hit among people since it was first introduced in 1992 and till such creative innovations keep on simplifying things, SMS will continue to deliver big contents in a cramped 160 character message.




diagram not clear.. could have been simple..

Short message service centers  is the portion of a wireless network that handles Bulk SMS operations, such as routing, forwarding and storing incoming text messages on their way to desired endpoints.