Business 160 bytes. Part Two, Technical

    In the first part of the planned series of articles, we examined some general issues of working with SMS messages, now we are publishing another article with a slight delay. So, let’s remember: messages can be incoming and outgoing, SMS centers are responsible for processing messages, it is possible to replace the sender of the message.

    Let's start the second part with the most important - with the protocol. Of course, to work with SMS messages, a protocol has been developed - SMPP (Short Message Peer-to-Peer Protocol), on which communication between SMS centers takes place. The protocol is developed by SMSforum, which publishes its specifications. There are a number of libraries in different languages ​​for working with this protocol [ 1 ] [ 2 ] [ 3], but the most popular open source solution is the kannel server , which implements all the basic aspects of working with SMS and at the same time is a WAP gateway. SMS centers can send messages not only through SMPP, but also through any other protocol - HTTP, OSCAR, XMPP or mail protocol for sending to e-mail. To work with various web projects, a transformation into the HTTP protocol is used, the most convenient and familiar for a web developer. Therefore, as was correctly noted in the comments to the first part, it is not necessary for the developer to know and use SMPP.

    Almost all companies providing SMS mailing or SMS payment services use their own protocols, more or less the same type and differing only in the number and names of parameters, as well as in implementation (SOAP, GET / POST, XML-RPC). A description of such a protocol can be considered on the example of our SMS: transit service . You can see that it uses a lot of international standards, so to determine the country and operator the parameters MCC and MNC are used, and the subscriber number is usually transmitted in the international format with the required country code.

    As you already understood, to work with SMS you do not need to know the SMPP protocol, the protocols developed by service providers are much simpler and more convenient to use, and in many cases they can even offer you ready-made solutions for most tasks. SMS mailing companies provide not only libraries for working with their protocol, but also full-fledged software to simplify work as much as possible. In the field of SMS payments, the situation is no worse. So our company, in addition to the usual SMS transport with code examples in several languages, has developed a lot of ready-made solutions for specific purposes, we call them services , as well as dozens of modules for the vast majority of well-known CMS. Other service providers also do not stand still, so the market is replete with high-quality solutions to implement almost any ideas.

    Let us return to the curious details of the SMS payment process. There are three types of subscriber billing: MO billing, at which the subscriber pays at the time of sending the message, MT billing, at which he pays at the time of receiving the response, and DO-Double billing, at which the subscriber comes after sending the message request for confirmation, and only after it the payment process occurs. The technical difference between them is as follows: in the first and last options you will receive a message from the subscriber only if he has funds on his balance, in the case of MT-tariffing you will receive a message and process it before checking the balance and withdrawing funds that will be made only after the subscriber receives a response from you. You will receive a notification of delivery of the response, but it does not necessarily mean the fact of payment. Often, this disadvantage of MT-billing can be circumvented by sending an additional system message, for example, with the cost of the service, only after receiving notification of its delivery, the desired answer will be sent to the subscriber. The disadvantage of this method is the need to pay for the delivery of an additional message, which reduces the already small income.

    However, MT billing has its advantages. For example, in the case of a mistake made by the subscriber, you can not deduct funds from him. In addition, you can use several tariffs on one short number at once, which can be very useful for rooms priced between $ 500-10000. Only MT-tariffication allows you to implement a subscription: the subscriber agrees to regularly withdraw a certain amount after a certain period of time and automatically receives the service thus paid without additional effort. Our company provides a similar service in several countries. It gives a wonderful result for those services where you can implement a subscription, for example, for file sharing services, torrent trackers. Earnings of our partners increases up to several times due to the multiplication of the client base, while subscribers do not express dissatisfaction, moreover, some thanked for this opportunity. Of course, the subscriber always has the opportunity to terminate such a subscription, and in a number of countries he receives additional messages with information about how much was removed from him this month and for the entire period.

    In the comments to the first part, several questions were raised, which we will answer additionally.
    1. What is the length of SMS and how to send SMS more than this limit?
    The length of SMS with a header is 160 characters for 7-bit encoding, 140 characters for 8-bit and 70 characters for 16-bit encoding. Messages of greater length can both receive and send all modern devices, data on its parts are stored in the message header. Particularly ingenious have already linked this information with the maximum length of a message on Twitter and turned out to be absolutely right, the service was created for and for working with SMS.

    2. SMS and WAP
    One of our readers suggested that sending SMS via wap is inconvenient, which is incorrect. When working with browsers through a mobile device, you can use format linkssms: 4443? body = dam999 , which will open the already completed SMS sending form like the usual mailto links. This opportunity is very convenient to use when creating paid services on sites with a large "mobile" audience.

    What else might be interesting? Automatic sending SMS by phone. Unfortunately, this opportunity is actively used by scammers who do everything possible to ensure that the victim downloads an application that, after launch, practically hangs the device with requests to send SMS. Excellent examples of using this opportunity for legitimate purposes are extending the subscription in a mobile game, paying for the full version of the program after the trial period has ended, and a whole host of others, for example, applications for communicating on Twitter, which, in the absence of an Internet connection, can use SMS to send statuses.

    It is difficult to cover all technical issues in one article, but we tried to highlight the most important and interesting points, and your comments will help to develop the description further in the directions that interest you. One way or another, in the following parts we will discuss the problems of fraud, the legal and financial aspects of the work, share interesting statistics that we have been collecting for the last 3 years, and a ton of other "insider" information.

    Thanks to everyone who comments and subscribed, it is clear that the topic is not only poorly described, but also arouses keen interest, which also gives us an incentive to write articles with great interest.

    Also popular now: