|
Page 1 of 5 Download Project Here
Hi everybody, its been a while that i have posted an article in code globe. This is my first article since code globe has moved to a website. Now lets get into our business. Lets talk about Short Message Service(SMS) and how to send a SMS in C#.NET. I have already posted a small description about this topic in http://codeglobe.blogspot.com under the C# category. This time i am trying to give a more good idea about SMS and how you can send it through C#.NET.Now lets get started
What is SMS?
The Short Message Service (SMS) is a basic service allowing the exchange of short text messages between subscribers. The first short text message is believed to have been transferred in 1992 over signaling channels of a European GSM network. SMS was developed as part of the GSM Phase 1 ETSI technical specifications. Work on the standardization of SMS was initiated by ETSI and is now being carried out in the scope of 3GPP activities. Note that SMS uses signalling radio channels which is different from voice channel. hence you could send messages even if you have unclear voice.
A single SMS can hold up to 160 characters. Each character is represented by 7-bit default alphabet. These characters are packed as octets for transmission, hence more clearly we say that 140 octets can embed 160 7-bit alphabets(i.e [140 x 8] / 7 =160). Confused just leave it we will make it clear later. If you are sending Arabic, Korean, or other languages that require 16-bit encoding, you will be limited to 70 characters for your message content.
There are two ways that all mobile phones have support for sending and receiving SMS. They are
- PDU (Protocol Data Unit) mode.
- Text mode.
We will be describing PDU mode in great detail here because fundamentally all messages are send in this mode even if it is text mode. The difference is that in text mode all encoding and decoding are done by the mobile phone.
So what is this PDU? Before knowing what this PDU is all about lets have a general idea about GSM and SMS. Really knowing this is not a waste of time, it will help you in one way or another, trust me.
How SMS Works
The mobile user types the content and selects the intended recipient. The intended recipeint address and the sender address is automatically filled by the mobile device along with other needed parameters. Then this SMS is typically send to the subscriber's home network Service Centre(Mobile Originated Short Messages are normally sent to an Service Centre in the subscriber's home network irrespective of where in the world the mobile subscriber happens to be).The address of the senders service centre is stored in the SIM and is automatically filled by the mobile device. When this SMS is recieved at the Service Centre of the Sender's network the Service Centre sends back an acknowledgment sometimes displayed as "Message Send"(Usually misunderstood by users that SMS has been recieved by the intended recipient). Now the Service Centre secures the SMS and starts to make attempt to send it to the intended recipient. If the intended receiver's mobile device is available then the message is sent. If the reciever's mobile device is not available or if there are any network problems on the delivery side then the Service Centre delivery attempt will fail and the SMS is held back for the retry Schedule. One of the important factor for the sucessful delivery of a pending SMS is the validity period of that SMS. Usually it is set by default (4 days) by mobile devices. If the SMS cannot be delivered by the Service Centre the SMS is automatically deleted by the Service Centre. Once a SMS is successfully send the receiving mobile device sends an acknowledgement back to the Service Centre.
The diagram below depicts a GSM architecture that has support for SMS.

TE(Terminal Equipment):- TE is a device such as a PDA or a mobile phone.
ME(Mobile Equipment):- The ME contains the radio transciever,the display and digital signal processor.
SIM(Subscriber Identity Module): - SIM allows the network to identify the user. BTS(Base Transciever Station) - BTS contains the radio transmitters for communicating with Mobile Stations.The Base Transceiver Station (BTS) implements the air communications interface with all active MSs located under its coverage area (cell site). This includes signal modulation/demodulation, signal equalizing, and error coding. Several BTSs are connected to a single Base Station Controller (BSC). A BTS is typically capable of handling 20–40 simultaneous communications.
BSC (Base Station Controller):- The BSC manages the radio resources for one or more BTS's.The BSC supplies a set of functions for managing connections of BTSs under its control.Functions enable operations such as handover, cell site con?guration, management of radioresources, and tuning of BTS radio frequency power levels. In addition, the BSC realizes a first concentration of circuits towards the MSC. In a typical GSM network, the BSC controls over 70 BTSs.
HLR(Home Location Register): - The HLR database contains all administrative information about each registered users.An HLR is typically capable of managing information for hundreds of thousands of subscribers.
VLR(Visitor Location Register ):- The Visitor Location Register (VLR) contains dynamic information about users who are attached to the mobile network including the user’s geographical location. The VLR is usually integrated to the MSC.
MSC (Mobile Switching Centre): - The Mobile Switching Center (MSC) performs the communications switching functions of the system and is responsible for call set-up, release, and routing. It also provides functions for service billing and for interfacing other networks.
SMSC: - The Service Center (SC) or SMS Center (SMSC) plays a key role in the SMS architecture. The main functions of the SMSC are the relaying of short messages between SMEs and the store-and-forwarding of short messages. The SMSC may be integrated as part of the mobile network (e.g., integrated to the MSC) or as an independent network entity. The SMSC may also be located outside the network and be managed by a third party organization. Practically, it is very common for network operators to acquire one or more SMSCs since SMS is now considered as a very popular service to be provided by any mobile network.
PSTN - Public Switch Telephone Network.
|